Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert String input from UDP to seperate controls

I am using CRIO-9074. Host PC is sending string data to CRIO with UDP and i will take this data to control some instruments using IO modules of CRIO. With UDP host PC will send about 1000 byte data which belong to about 800 unit like lamps, analog indicators etc.

1 byte data will be used for lamp controls and

2 byte data will be used for analog indicators.

 

I am creating sub vi's for instruments. in the vi's i am using some input control datas which will come from host PC.

 

Critical point is there are too many data is coming from host PC and this data will be refresh every 125msecond. and i should make every calculations in these period.

 

I wrote a vi for input string comes from host and using this string i created the input controls for my sub vi's. but in the vi i used some array functions which takes some time but i dont want to spend time when new data come from host PC.

 

What is the good way for refresh the control values when new UDP data comes.

0 Kudos
Message 1 of 2
(3,507 Views)

Hi soz,

 

From your application description, I would recommend using a producer/consumer loop in your main VI on your cRIO. The producer loop could implement a state machine to listen for UDP packets and put all string commands from the host PC into a queue to stream to a parallel loop. The consumer loop would be executing in parallel and would get each of the string commands off of the queue to use for instrumentation. 

 

Here are some links that go into detail on the producer/consumer and state machine architectures: 

Application Design Patterns: Producer/Consumer    http://www.ni.com/white-paper/3023/en/

Application Design Patterns: State Machines             http://www.ni.com/white-paper/3024/en/

 

Regards,

Jordan G.

LabVIEW Product Marketing Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,455 Views)