LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Streaming data from cRIO

Hi everybody,

 

This is quite a general question and I am looking for some pointers\opinions\suggestions.

 

I want to stream data from several channels at diffferent rates from my cRIO to the host PC. As far as I can see there are three options:

1)  Use a network shared variable (NSV) for each channel and read them in a loop on the host PC.

2)  Use one NSV which uses a cluster of an enum and variant. In this case the enum specifies which channel (and therefore data type) the packet contains and the variant contains the data.

3)  Use STM to stream the data over the network using TCP/IP

 

These are my questions/thoughts:

1)  not very scaleable as each NSV has to be read individually also just seems messy!

2)  Seems nice and clean and scaleable, multiplexes the data into one channel. I am aware NSVs are not quite as efficient as directly using STM TCP/IP  BUT... is there an additional (significant) overhead converting all the data to variant?

3) According to the documentation on NSVs using TCP/IP is the fastest way to stream the data. This method seems to offer the same avantages as (2) - clean, multiplexes the data. BUT it does add complexity in developing the cod. Also the data is still flattened to string, is this much different than converting to a variant?

 

THE QUESTION: is method (2) a reasonable compromise if the absolute highest data rates are not required?

 

Many thanks,

Steve.

 

0 Kudos
Message 1 of 4
(3,687 Views)

Method 2 seems fine to me as a comprimise.  Also you can get the data dynamically from method #1 using the the Tag API, but I think it requires DSC. 

 

Typically I like the NSV if I need to do logging, alarming, and other SCADA operations.  If I just need to do messages I stick STM.

Brian K.
0 Kudos
Message 2 of 4
(3,679 Views)

Hi Steve,

 

I have been looking into this problem for you. It seems that each of the three options you highlighted could be used to achieve your goal though since you want to stream multiple channels method 1 would be highly inefficient and therefore should not be considered for this application. I would suggest that method 3 which uses TCP/IP to stream the data over the network is the optimal solution in this case though as you have alluded to, this does add a level of complexity. If you decide to pursue this option I have found a really useful link provides more details about this methodology and a LabVIEW example which should help you get started with the coding. I have also found this link to a forum which may be of interest to you (especially the final post by Kurt).

 

I would also like to add that I completely agree with Brian K, in that I believe method 2 is a very acceptable compromise, especially if high data rates are not necessary. 

 

I hope this helps.

 

Best Regards,

 

Christian Hartshorne

Applications Engineering

National Instruments

0 Kudos
Message 3 of 4
(3,641 Views)

Hi Christain,

 

I haven't checked back here for a while. Thanks for the advice and links. I decided to go with method 2 as the structure of the code could then be easily adapted for the TCP/IP method if required in the future.

 

I did look at using the VIs on the shared variable pallete to programatically access theshared variables but couldn't find any examples on it. Do you know of any?

 

What is a use case for this approach or dataSocket?

 

Regards,

Steve.

0 Kudos
Message 4 of 4
(3,597 Views)