02-20-2013 07:29 AM
Hello I need to store 3 different arguments of data received from serial port via visa into one value. For example I received 3 then 4 then 5 then 6,7,8,,,,,
I need to get the first argument as 345 second as 678 and so on
pleas help me
and thank you 🙂
02-20-2013 07:43 AM
Hi Alex,
Instead of reading 'bytes at port' number of bytes from your Read Port function, you should try to read the equivalent of 3 characters. Each character being coded on 1 byte, cabling '3' to your Read Port should return a string of 3 characters at every loop iteration. Otherwise the Read Port will wait until 3 characters are present in the buffer or tiemout occurs.
02-20-2013 07:46 AM
Create an empty string array and connect to a shift register on the acquisition loop. Create another shift register on the acquistion loop, initialized with an empty string. As the characters are received you would append them to the string, using concatenate. When the character count = 3 append that string to the array, clearing the shift register that holds the characters.