LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fastest way to send data from RT controller to PC

I have my RT controller getting data from the FPGA.  I want to save that data but I'm not able to save it without delays through the USB port on my cRIO9014.  I know the ethernet port on the cRIO can send data back to the PC, but was wondering if it would cause any delays?  If it won't, is there example code someone could post to help me start on establishing connection?  Also, what about using the RT FIFO vi's?  Can I use those to transfer data from cRIO to PC?  Example code on that?

 

Thanks,

guilio

0 Kudos
Message 1 of 6
(4,161 Views)

Tell me more about the delays you are experiencing saving the data to a usb drive. We found through testing that the crio has trouble saving quickly with certain file formats. We found that saving using the binary file VIs was the fastest, despite NI's claims of TDMS efficiency on the crio devices.

 

As far as sending data back to the pc, the easiest and most efficient way would be a host-client architecture that uses shared variables to communicate between pc and crio. When you start a new project, if you use the 'real time project' option it walks you through a setup that sets up the VIs for you and you can see what I mean. There are example VIs of how to use shared variables and how to use this host-client architecture in the LabView examples. (Help > Find examples > Hardware Input and Output > Compact RIO)

 

The FIFO VIs are strickly for communicating between the FPGA backplane and the RT controller of the cRIO. They won't communicate with the pc.

 

Are you trying to stream real time data? If you gave us more information about what you are trying to do we would be able to give you better help.  

 

Also, if you have Labview 8.6 and you are using modules that support the new scan mode, I would suggest using that. It can stream the data in near real time back to the crios. It acts like a shared variable but it is raw data directly from the modules without having to do anything. Works fast too. It would probably be the simplest solution. There are a few white papers on how to do it on the website. 

Message Edited by rex1030 on 09-09-2008 01:15 PM
---------------------------------
[will work for kudos]
0 Kudos
Message 2 of 6
(4,158 Views)

When I first started saving data to the USB drive, about a month ago, I was using the gTDMS and I was doing random numbers.  The program would take the data, then stop to write it, take the data, write, etc....thats when I initially threw out that option.  I have 18 channels that I want to save as well as a timestamp that I want to add so a total of 19 channels.

 

I am trying to stream real time data.  I have my FPGA gathering imputs, manipulating the data, using various math functions and then putting the data in a cluster.  On the RT controller, I have the read/write block, and I am taking the output cluster from there to view it.  I'll still need to do some calculations with that and slight modification before saving, but before I begain that I need to get the saving portion out of the way.  I don't have 8.6 yet, but will play with that option when I get it.  I was just happy that I got my FPGA VI to compile.

 

Let me know if you need anymore info.

 

Thanks,

guilio

0 Kudos
Message 3 of 6
(4,147 Views)

Well, what we do is acquire data with the FPGA and then use the FIFOs to transfer data between FPGA and RT. On the RT side, I would read a block of mesurements (like a second's worth of samples) and write them to a binary file on the usb drive, using the 'write to binary file' vi. The FIFOs have a buffer that makes sure your not skipping data. You have to learn how to set them up well though. Anyways, then you could retrieve the files with ftp and make a VI on the pc side to read the binary files and then write them as files you can actually use, like TDMS or spreadsheet. I really suggest looking at the help example VIs for the modules you are using and looking how they acquire data and do FIFO buffer size calculations.

---------------------------------
[will work for kudos]
0 Kudos
Message 4 of 6
(4,138 Views)

I started out using the DMA transfer between RT and FPGA, but then I ran into problems with clock speed and the compile failed.  The setup I have now runs fast enough where I'm sure I'm not missing any data.  I've looked at the examples, looked online to see what everyone else is doing and so far, this method is the only thing I have that keeps my theoretical clock fast enough to compile.  I can go back and refine later but right now I have a working FPGA product and want to stick with that till my deadline passes.

 

What I wanted to do is hook our external hard drive into the USB and stream the data mainly because we could be saving data for minutes up to hours non stop.  Right now, the cRIO isn't picking up the external HD.  Does the cRIO USB have limited capabilities on what it can detect for storage?  Has anyone took an external harddrive and got the cRIO to detect it?  Even on an older version of the program we developed, running it from labview 8.0 to a PXI and back, using the USB from the PC still caused delays and we had to switch to Firewire 800.  Now the FTP is something I haven't thought of and I may have to eventually go with getting sets of data, getting it from the RT FTP, and have the PC combine it all, but want to kill every option before going that route. 

0 Kudos
Message 5 of 6
(4,128 Views)

Here are a few example programs that can help you stream data over the network using cRIO:
 
Reference Example: Streaming Data from FPGA to cRIO to Windows Example 
http://zone.ni.com/devzone/cda/epd/p/id/5919 
 
Reference Example: CompactRIO Remote DAQ Example (16 AI channels at 40kS/s each) 
http://zone.ni.com/devzone/cda/epd/p/id/5449
 
Those examples use the TCP VIs to stream the data. You could also bind the scan mode I/O variables to shared variables to buffer the data across the network. If you go that route, you can use the following example to create shared variables for all your channels:
Create and Bind Shared Variables to I/O Variables Programmatically
http://zone.ni.com/devzone/cda/epd/p/id/6017 

 

Hope this helps!

 

Kurt 

 

Message 6 of 6
(4,102 Views)