Quantcast
Channel: LabVIEW topics
Viewing all 69675 articles
Browse latest View live

A Newbie looking for guidance

$
0
0

I am trying to teach myself LabVIEW and have ended up creating a huge mess to solve a problem. I am trying to create a program that reads in analog voltage and produces a waveform out to a spreadsheet. 

 

My first error is that I have a dialog box that continously pops up asking for me direct the path. Coding this part was very challenging for me so I am not sure where I got it wrong. 

 

I know there are probably several issues here, but if someone could point me into the right direction that would be great!


DaqMX Channel Constants as something like a Menu Ring

$
0
0

Hi All,

 

I have a pinout on my DAQ board to control all my hardware. I would like it that if I change the pinout I don't have to trawl through my entire program changing references to Dev/a0 to Dev/a1 etc. Is there anyway of have a menu ring type constant whereby I can type define this thing and if I click "Device 1" then it will output whichever port I have specified in the congiruation?

 

Regards,

 

Craig

Database Query Error -2147467259 ADO Error: 0x80004005

$
0
0

So I'm having more database issues.  This one I think is a bit more straight forward.  I have an Access database and in it I have a table with several columns of data.  I want to get the Maximum value of a column, from that table.  One of my columns gives me an issue with this and I'm not sure why.  Here is my code:

 

Test Get MAX.png

 

You can see reading Voltage and Power work just fine, but trying to read current returns an error.  Searching on NI's site this error is used for a lot of things and it is usually because of a 32 or 64 bit issue but in this case the read worked on two previous columns that are also an I32 but the third time it doesn't.  It also fails right away when you try Current first so it is likely something with this column.  Is there something I can check?  I opened it in Access and was able to make a query with the Query Wizard to find the min max of current.  The database it self is over 1GB so posted won't be possible.  Even pruning it might be an issue.  Any suggestions?  Thanks.

System Exec wait until completion Issue/Bug

$
0
0

I've noticed and issue with the System Exec.vi which I wanted to detail here. I will also make reference to System Exec+.vi which can be found here http://www.ni.com/example/29935/en/

 

I am attempting to connect to and send commands to a camera. The camera has it's own command line or shell that I can access for a faster response. After opening a connection to the camera's shell, I am using Windows APIs to send keystrokes to the shell in order to send commands to the camera. To access the camera's shell, I have written a program in C to check for a connection, open the shell, and then verify a valid connection. I am running this C program from Labview, and leaving the shell window open and minimized. In order to open a window for the camera's shell, I am running the system command:

start "name" /MIN <command> <args>

 

I want Labview to wait for completion of the C code (.exe file), which is the default (true) option for both System Exec.vi and System Exec+.vi while leaving the camera's shell window open and minimized. I am running Labview 2011 SP1 on Windows 7. I would also like access to the return code and stdout values provided by the System Exec.vi so I can know if my code executed without issue or not. These outputs are not provided by System Exec+.vi.

 

Running my C code in the command line leaves me with an open shell window and an available command promt. The "start" command in windows serves to run the command in a new window and not wait for completion.

 

If I run my code from labview using System Exec.vi, the System Exec call never finishes. Labview ends up waiting for the new shell window to close before it will release control of that call. This behavior is the issue, and is contrary to how the Windows command line treats the 'start' command. To reiterate, I am running code from Labview with the wait for completion condition, and this code is in turn opening another window with the do not wait for completion condition; while the code is completing (it's minimized window closes), Labview is waiting for the new window to close, escentially waiting for it to complete, despite it being opened with a do not wait condition.

 

Of interest is the System Exec+.vi behavior. System Exec+ behaves as I would expect, waiting for the main C code to complete, but not waiting for the additional shell window to complete. The downside to this VI call is the lack of access to return code, stdout, and stderr. System Exec.vi is locked and the block diagram for it cannot be accessed. System Exec+.vi can be accessed, but it relies on a DLL that I seem to be unable to uncompile, so I cannot attempt to edit it's functionality. It is my opinion that the System Exec.vi should behave more like the command line and System Exec+.vi when it comes to waiting for completion. My suspicion is that it is improperly looking for children of the process it creates and not looking for completion returns from the command line it is calling.

 

My solution: In order to get the desired result, I broke my code up into three chunks. First, I run some C code to check for a connection and do some housekeeping using System Exec, waiting for completion and returning a pass or fail condition. Then I run a short batch file using System Exec+, opening the new shell window, waiting for completion of the batch file but not waiting for the shell to close, and receiving no status on success or failure. Finally, I run the rest of the C code to check that the established connection is working using System Exec, waiting for completion and and returning a pass or fail condition.

 

Hopefully this post can serve in part as a bug report and in part as information for anyone else trying to do something similar. Again I reiterate that System Exec.vi does not function as I would expect, but that a workaround can be made through a combination of System Exec and System Exec+. Cheers.

Spectrum Unit Conversion Help

$
0
0

I'm trying to create a spectrum analyzer program by utilizing a DAQ and LabView. I've attached a very limited scaled down program just for clarification. I have sampled 1 second of data at 100k sample rate and stored that in the constant waveform. If I take and do a simple FFT on this data, it is very similar to what my HP3562A shows. But now I want to do a noise measurement on this data. I can set up the analyzer to display in Vrms/root Hz and I get what is shown in the bottom picture. In order to make this measurement in LabView, I figured that the best way was to use the Spectrum Unit Conversion VI. The problem is that there is no example or any real type of help on how to use this VI. I set up what I thought would the the correct way to use it, but it obviously doesn't work. What am I missing (not doing an FFT on the signal, do I do this before the conversion or after, etc. - I've tried these but still don't get the response I desire.)? I am not sure what the VI expects or how to use it in order to mimic the performance of the 3562. Thanks for any help you can give me. Or does anyone know if NI sells a canned spectrum analyzer program that utilize DAQMx cards that is fully functional. I thought they did at one time, but I looked and can no longer find it - which is why I decided to try and build my own.

LabVIEW 2015 not seeing CAN ports...

$
0
0

My lab recently upgraded to LabVIEW 2015. I wrote a simple CAN loopback VI, but XNET in LabVIEW does not seem to "see" the interfaces. The interfaces appear in NI MAX as "CAN1", "CAN2", etc. Am I missing something?

 

Error code: -1074384758

 

CPU usage jumping to 100% for no obvious reason

$
0
0

Hi

 

Yesterday I downloaded the MyRio 2015 software bundle (required) located here:http://www.ni.com/product-documentation/14603/en/

 

Today, I started up my computer and about 3-4 hours in experienced severe mouse and keyboard latency. When I opened task manager I got the below Screenshot. Note I havent started any NI software today. As you can see there are 5 processes taking up 20% of the CPU each, all from National instruments. I'm worried about this as I have a pretty High calibre system (i5-6600K, Asus Maximus Hero viii, Nvidia 970, 16gb ram, Windows 10). If I cant fix the problem I will have to uninstall. Any suggestions would be greatly appreciated. P.s I am sorry if I have put this in the wrong place.

 

Task Manager Pic.png

IWebBrowser Headers

$
0
0

Hi

 

I'b creating a login form that uses Active-X IE

 

Alll going well however I need to add headders to the Navigate method, has anyone done this?

 

Thanks in advance


FPGA FIFO: Flip-flops, lut, block memory

$
0
0

What are the advantages/disadvantages of implementing a FPGA FIFO using one of the following implementations: Flip-flops vs Look-Up Tables vs Block Memory.

 

Most documentation states that small amounts of data should be placed on the FFs (<100 bytes), medium amounts of data (100-300 bytes) on the LUTs, and large amounts of data on the Block Memory. Does this have something to do with speed or resource availability?

 

Thanks,
Craig

Subpanel in cluster

$
0
0

How come labview lets you put a subpabel into a cluster? Is this some kind of bug?

 

Notice they will restrict you from inserting the subpanel into an array.

 

subpanel in cluster.png

 

And you will be able to actually insert a VI in that subpanel if you put the array terminal in a disable structure.

 

subpanel in cluster weird.png

Play WAV file once within for&while loops

$
0
0

I've searched quite a bit but I can't find a detailed, step-by-step explanation addressing my problem.  I've attached my work so far-I just want the .wav files to play once without the temperature range bracket functionality that I built into my VI (because if my range is too wide, the .wav file plays multiple times).  It's just a simple heating process of a thermocouple (from ~22degC to ~70degC) which feeds into a breadboard with LEDs, providing warnings for every 5 degrees celsius increase in temp.  Any help would be massively appreciated.  Cheers!

How to debug/highlight-execute Asynchronous VI on Real Time Target from Dev-Environment

$
0
0

Hi everyone!

 

My RealTime Application has a similar structure to the following:

  • MAIN.vi (controller)
    • some subVIs called from MAIN.vi, and one that starts Module.vi asynchronously
  • Module.vi (Asynchronous VI)

I have set a deployment-dir "/c/ni-rt/startup/data" (the Support-Dir in BUILD-properties),

since running my program from the DEV-environment wouldn't find the Module.vi,

i have made a symlink in "/usr/local/natinst/labview" to data.

so my program can find all files (including the asynchronous module).

 

Unfortunately i cannot Highlight-Execution-Debug this Module,

since it is run only on the RealTime Target.

 

Is there a way to debug this Asnychronous VI from the Dev-Environment, like i can with the MAIN.vi??

 

Your help (and time) is very much appreciated.

 

<edit>

just to clarify, the Module.vi depends on other stuff, so i cannot run it by itsself

</edit>

how can i display the waveform chart values to write to spreasheet

$
0
0

Hello,

 How can i Export the waveform chart values (both X-axis and Y-axis Values ) into a write to spredsheet. I need to display both time and amplitude in excel in two coloumns. Please help me with this issue.

 

Thanks

Unable to use a working matlab script for opening special extension files with MathScript

$
0
0

Hello,

I have an issue with MathScript which doesn't run a working matlabscript.

I use a code on matlab which works for openning a particular file with a particular exetension. This code calls for different other files which are put in attachement.

Here is matlab code:



cd('C:\Users\Tual\Desktop\Ramanscript\loadwantedspectra\checkboxetest\MatlabSIFReader(2.99.10001.3)\atsifio');
rc=atsif_setfileaccessmode(0); %sets up the sif library to set the access property to load the entire file
absfilepath=strcat(PathName,FileName); % sets up the file name
rc=atsif_readfromfile(absfilepath); % attempt to open the file

if (rc == 22002) % check that the file was successfully opened
signal=0;
[rc,present]=atsif_isdatasourcepresent(signal); % check there is a signal present
if present
[rc,no_frames]=atsif_getnumberframes(signal); % query the number of frames contained in the file (e.g. in the instance of a kinetic series there may be more than 1
if (no_frames > 0)
[rc,size]=atsif_getframesize(signal);
[rc,left,bottom,right,top,hBin,vBin]=atsif_getsubimageinfo(signal,0); % get the dimensions of the frame to open
xaxis=0;
[rc,data]=atsif_getframe(signal,0,size); % retrieve the frame data
[rc,pattern]=atsif_getpropertyvalue(signal,'ReadPattern');
if(pattern == '0') %FVB
calibvals = zeros(1,size);
for i=1:size,[rc,calibvals(i)]=atsif_getpixelcalibration(signal,xaxis,(i)); %gets the x-calibration of each pixel (either pixel no. or wavelength
end
%plot(calibvals,data); % display the 1D data
%title('spectrum');
%set up the axis labelling appropriately
[rc,xtype]=atsif_getpropertyvalue(signal,'XAxisType');
[rc,xunit]=atsif_getpropertyvalue(signal,'XAxisUnit');
[rc,ytype]=atsif_getpropertyvalue(signal,'YAxisType');
[rc,yunit]=atsif_getpropertyvalue(signal,'YAxisUnit');
xlabel({xtype;xunit});
ylabel({ytype;yunit});
elseif(pattern == '4') % image
width = ((right - left)+1)/hBin;
height = ((top-bottom)+1)/vBin;
newdata=reshape(data,width,height); % reshape the 1D array to a 2D array for display
imagesc(newdata);
else
%TODO - implement for single-track, multi-track & random track
disp('It is not possible to display this acquisition format at this time...')
end
end
end
else
disp('Could not load file. ERROR - ');
disp(rc);
end


Hope someone can help me...

I am running labview 2014 (32bit)



serial checksum not matching

$
0
0

I'm setting up a VI to communicate with an air data device. It communicates via RS-232 with a string output that contains all the relevant data followed by a checksum, carriage return, and line feed. An example of the output string is below. 

 

094904104, 111115, 0000.00, +00.00, +00.00, +00106, 100051, 0100051, 33<CR><LF>

 

The documentation for the device only has the following to say about the checksum calculation. "The checksum calculation shall include all characters and spaces except the carriage return/line feed characters and the checksum itself." The way I decided to calculate the checksum was to convert the output string to a byte array and islolate the first 69 bytes which is every character up to the checksum (Including the space preceding it) and then add the array elements.  This does not get me a checksum that matches the reported one. I'm not sure if I'm making a mistake in how I'm converting the string or if the checksum calculation is more complicated. This is my first real attempt at serial communication so I'm hoping I'm just making some stupid mistake.  I'm guessing there's some nuance to how one calculates a checksum that I must be missing. 

 

I've attached a simple vi that just takes the message string and performs my checksum calculation on it. 


motor controller

$
0
0

Hi, I'm new at this. I need help to develop a motor controller so I can control speed, direction and angle position. I need to start from scratch.

reservation planning sheet

$
0
0

Hi everyone thanks for your help .

 

I'm finishing a hotel reservation software , but the client wants to be able to see a planning sheet like the one i've attached .

Any idea how can i achive such a think , it must be only for visualize the booked days in each room, the part of making the reservation is already done .

I started trying with table control and changing with a property node the cell background color but i'm not sure if it is the most apropiate in this case .

The thing i'm struggling is how to manage months and years .

Any idea you could suggest will be appreciated . thanks

 

Windows based front panel for RT application configuration

$
0
0

Hi,

 

I'm quite new to Realtime and I feel like I am missing something glaringly obvious,

 

I realise RT devices are intended to run "headless" but the truth is almost any system requires user access to configuration settings at the very least.  When developing the application in the development environment on windows there is a front panel available where one can change settings, see indicators,etc. The complete  communication infrastructure exists to exchange all of this data between the RT system and Labview devel environment. This even works remarkably efficiently when using Vision with two imagers on the RT system. I would expect to be able to automatically build and deploy a windows exe which provides the same functionality, yet it seems the options are either to completely recreate this interface myself using shared variables or some other protocol, or use a web interface which is much slower and less efficient than when developing and also far more finicky to implement in terms of settings, browser plugins,etc. My latest experience is that the html file loads in the browser but there is no front panel (implying the web server is running,etc), its just blank...no error...nothing

 

Is this really the way it is?

 

Thanks,

Mike

Fastest way to add action engines to a project

$
0
0

I often use action engines in projects. Sometimes they are very specific to the data in my application, other times they check for elapsed times or send a message on a queue. Sometimes when I want two action engines with the same functionality (timers of 2 different events), I'll duplicate the files and re-name/re-icon before adding to my project.

 

Then I found out about LabVIEW libraries (.lvlib). I made a library (call it Timer_AE.lvlib) and implemented some standard vi's and wrappers: core, init, set interval, reset timer, check timer... Thanks to the library, I can have many "core.vi" in different libraries, and LabVIEW doesn't get confused. I can easily change the icons for a library all at once. It seems like a great way to do what I want, but I know that when dealing with LabVIEW it's always better to deal with toolbars and pallettes in LabVIEW rather than copy+pasting in windows explorer.

 

Am I abusing the LabVIEW libraries? Does LabVIEW have a built in way to do what I am describing?

LabVIEW Bug Report: Create VI from selection

$
0
0

In the attached VI:

 

Create SubVI selection.png

 

select objects following the "Selection 1" box and go to Edit>>Create SubVI.

You should get something like this:

 

Screen Shot 2015-11-11 at 14.05.28.png

Everything works as expected (except for wire routing, but that is expected too).

 

Now Undo and repeat the process using the "Selection 2" contour. You should strive to obtain that selection:

 

Screen Shot 2015-11-11 at 14.07.10.png

 in which the polymorphic label of the top VI is "accidentally" selected. Now Edit>>Create subVI should give you this:

 

Screen Shot 2015-11-11 at 14.08.25.png

 

Notice how the constant is now disconnected from the two top and bottom VIs.

 

Tested in LV 2015 64 bit

Viewing all 69675 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>