07-21-2009 12:17 PM
Hello, I'm a research assistant tasked with taking data received via TCP-IP and plotting it. I've had a couple of problems, probably because I've never used Labview before.
The data is sent in sets of six values separated using semicolons as delimiters, for example
"0.086842;0.00020341;0.00039838;-0.14057;-0.12614;-0.1327;" is one such data set
Receiving these strings through TCP connection is working just fine, however I just noticed that after passing a string such as my example into a 'Scan String for Tokens' block, the negative signs are dropped from the latter three values. I assumed it has something with setting '-' as an operator, but simply wiring negative sign in as an operator didn't change anything. I know there has to be a way to retain my negative signs, but I can't figure it.
07-21-2009 12:42 PM
Is this what you need?
07-21-2009 01:04 PM
Yes! Thank you very much!
Your example brings up another question, though. When you pass those values into an array, is it possible then to pass individual array elements back out?
07-21-2009 01:13 PM
if you're always sure that there are six elements in the array, you could use index array. Alternatively, instead of using the above function, use scan from string.
07-21-2009 01:16 PM
07-21-2009 01:17 PM
07-21-2009 01:18 PM
You should use a shift register to cancatenate succesive arrays to one big array.
I suppose you have a loop somewhere in your code, then add a shift register to it.
Right click on the loop and select "Add shift register"
Be sure to right click on the "Buid array" and select "Concatenate Inputs" or you will end up with a 2D array.