‎03-21-2013 03:32 PM
Hi,
I'm intending to use cRIO as a standalone hardware device to collect some data off a homemade tachometer. My goal is to store the data in the cRIO chassis, since it has its internal memory, but I can't even get a cluster of data from any of its devices' analog input channels. I dragged and dropped the channel I'm collecting the data from into a while loop, but that's only one data point. If I want to see the data with respect to different time, what should I do? Can this be done in Scan Interface Mode? If so, could someone give me a simple example that displays continuous data on a waveform? I'd much appreciate it!
Solved! Go to Solution.
‎03-21-2013 03:40 PM
That sounds like the right approach. At least for basic acquisition. Take a look at the Basic IO - RIO IO Scan example that ships with LabVIEW (Help -> Find Examples and search for scan)
‎03-21-2013 03:44 PM
Hi Tim,
Thanks for your quick response! I have looked at the examples, but they didn't help me much. I am not intending to use any shared global variables. Do you know of any simple example to display the data on a waveform? When I just wire the local variable representing the channel, it has an error because the local variable is only a number, while the waveform graph is a 1D array.... Please help!
‎03-21-2013 04:19 PM
It sounds like you should be using a waveform chart rather than the graph. Is there some other requirement prohibiting this?
‎03-21-2013 05:14 PM
‎03-21-2013 05:39 PM
@gleekd wrote:
Thank you for replying!! Actually I am interested in detecting the peaks for the continuously collected data. I know that if the data can be displayed on the waveform graph, then it can be connected to the peak detector vi as well, because they can both connect to 1D array. I think I should have worded the question more directly. I hope I am making sense. Do you have solutions to this? Thanks again for your response!
So, there's a few paths you could take with this. One, there's a pt by pt Peak Detector that will accept a scalar and internally keep track of the preceding points. With this method you could use the Waveform Chart.
Two, if you're not concerned with seeing the data charted live, you can simply index your values at the edge of the loop and wire them to the Waveform Graph and Peak detector vis after it is all collected.
Third, If you want to see the data live and not do pt by pt, I would use the Waveform Chart, but build an array with each point as they come in, like so.
If you go this route there are better ways to build your array and may yet be better suited for what you're trying to accomplish anyway.
‎03-25-2013 12:12 PM
Hi Tim,
Thanks for the example. Doesn't the peak detector point by point only return a boolean value of whether a peak or a valley exists? I am more interested in where the peak/valley exists because that would help me with my calculations of peak frequencies. Is there a way to do so with the pt by pt detector?
Thanks!
‎03-25-2013 12:34 PM
If you know when a peak exists, it's not terribly difficult to keep track of timing or indices or whatever you need. For a simple example look at the attached snippet. You could additionally keep track of a tick count or something if you need specific timing.
‎03-26-2013 03:48 PM
That helped, Tim! Thanks so much.
Now I am having trouble writing the data file to a cRIO device (NI 9074). How do I access the internal memory of cRIO in LabVIEW?
‎03-26-2013 04:28 PM
It should be very similar to saving a file on a PC. See this document.
You should be able to ftp into your crio to see if the files are saving properly. (In Windows Explorer or a browser type ftp://cRIOipAddress)