07-08-2014 09:47 AM
Hi,
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 PC 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.
Thanks
Serdar
07-08-2014 10:00 AM
Personally, I would just read the string and then use a Notifier or a Queue to send the string straight from the UDP to the different control loops. The individual loops know where their data is in the string, so they can just parse the part(s) they need directly. Searching an array is kind of expensive, so I would just hardcode the index and length to pull out in each loop.
07-09-2014 06:24 AM
Duplicate thread: http://forums.ni.com/t5/Multifunction-DAQ/Convert-String-input-from-UDP-to-seperate-controls/m-p/291...