05-27-2010 05:38 PM
I've been trying to write a VI in LV 8.6 and using DAQmxbase on a MAC OS X that will read voltage from a power supply and collected using the USB-6009 DAQ. I want it to then plot all the data on a separate graph of voltage vs. time.
I was using some of the example VIs given with DAQmxbase but found some errors. Using nidatalogger, the ready to use data acquisition and graphing program, the graph would read the correct voltage of 2V that was coming out of my power supply. When I used some of the example VIs, I would not get the correct reading, instead the graphs would show about .5V.
Now when I change the channel type on the create channel to RSE and run the VI, it changes it right back to default, not sure why.
Any suggestions to fix my problems or know why it may be reading .5V when my power supply is set to 2v?
Thanks
05-27-2010 06:07 PM
well I solved my problem, I wasn't entering the correct code for the input terminal configuration in the ring constant (RSE 10083).
Now I can read a single voltage measurement, how do I do continuous measuring of voltage and then have all the data on a single graph of voltage vs. time?
05-28-2010 07:18 AM
Solis,
Please post what you have tried so far along with specific questions about the parts which do not do what you want. It is much easier for us to help when we can look at what you have done. We can also help you learn to use LV more effectively that way.
I ran a battery monitoring system for several months with an USB-6009 connected to a Mac, so it can be done.
Lynn
06-12-2010 12:34 PM
Here is what I have so far. This is using daqmx base on my mac os.
It is able to graph voltage vs. time if I run it on "run continuously", but I am having trouble making it also graph on a similar graph with all the data instead of just the most recent 100 seconds. Last, I want all the data to be output on an excel sheet, but I am having trouble with this. The final program will be used to read voltage vs. time from fluorescence captured by a photomultiplier tube.
Any suggestions or help much appreciated, thanks.
06-12-2010 12:51 PM
Don't use Run Continuously.
Put a while loop around any code that needs to repeat.
Waveform charts have a limited history. Depending on your sampling rate and the history length will determine how much long of a time period the waveform chart will show. You can increase the history length if you want. You can also build your data into an array (just don't let the array grow indefinitely) to gather more data to show in a waveform graph.
What problems are you having with saving data into Excel. Your attached VI doesn't show any attempt at this. One of the basic ways is to write the data to a text file by using "Write to Spreadsheet File". This creates a text file that Excel can open.
06-12-2010 01:03 PM
The first thing to do is to put your read inside a while loop. Since you are reading a single channel, why do you have the read set for N channels? Fix that and eliminate the index array. You might also want to use N Samples if you want a reliable dt on the x axis. Showing 'all data' will require some clarification from you. As you should know, a chart has a settable history length. Once the length is exceeded, older points are dropped. Obviously, you will have to decide how large to make the history buffer based on how long you want the acquisition to run and how much memory your pc has. Using a graph and constantly appending new data with the Build Array has it's own set of problems.
Probably the easiest way to save data for Excel is to use the Write to Spreadsheet function. I would recomend the producer/consumer architecture so the write function is in a separate loop and does not affect the acquisition timing.
06-12-2010 03:01 PM
06-12-2010 03:21 PM
Of course not. You've got it outside the loop. Your file write is also in the wrong location and is not at all what I recomended with the producer/consumer design pattern.
Please take some time and take the free tutorials.
06-13-2010 03:11 PM
06-13-2010 03:20 PM