LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use scan interface mode when collecting data from cRIO? How do I display the continuously collected data on a waveform graph?

Solved!
Go to solution

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!

0 Kudos
Message 1 of 23
(3,112 Views)

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)

 

 

 

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 2 of 23
(3,103 Views)

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!

0 Kudos
Message 3 of 23
(3,098 Views)

It sounds like you should be using a waveform chart rather than the graph.  Is there some other requirement prohibiting this?

Example_VI_BD.png

--
Tim Elsey
Certified LabVIEW Architect
Message 4 of 23
(3,093 Views)
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!
Message 5 of 23
(3,083 Views)

@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. 

Example_VI_BD.png

 

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.

 

 

 

--
Tim Elsey
Certified LabVIEW Architect
Message 6 of 23
(3,079 Views)

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!

0 Kudos
Message 7 of 23
(3,058 Views)

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.

 

Example_VI_BD.png

 

 

--
Tim Elsey
Certified LabVIEW Architect
Message 8 of 23
(3,054 Views)

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?

0 Kudos
Message 9 of 23
(3,028 Views)

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)

--
Tim Elsey
Certified LabVIEW Architect
Message 10 of 23
(3,024 Views)