ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading a comma delimited data stream

I need a clean, preferably simple way, to parse a comma delimited string that enters a local variable once a minute. The variable buffer needs to be cleared before the new string comes in. If you can help and have more questions about this I can send a detailed explanation. thanks in advance.

ssmith@bnl.gov
0 Kudos
Message 1 of 4
(2,910 Views)
I am not sure I completely understand the full question but I have a suggestion.

You can use the Spreadsheet String to Array VI to parse out the string. You simply wire the string in and wire a comma in as the delimiter. Take a look at the attached. You can see where I build up the string, which for you would simply be your local.
0 Kudos
Message 2 of 4
(2,910 Views)
Evan--
This works fine except when the next string enters the array it continues to add to the array. I need it to overwrite the existing data each time a string enters the array and clear what isnot overwritten. Any ideas??

ssmith@bnl.gov
0 Kudos
Message 3 of 4
(2,910 Views)
I placed my code inside a loop and have attached it. The data in the array is replaced every time that the function is called. You can see where I also added a step to reset the string. I am not clear what you mean by "clear what is not overwritten". Do you mean that the string length changes and you want to only display that amount of data? This example should do that. I added a random string length to show that behavior.

I feel like I am missing something about what you want. Do you have an example that shows what you are doing and you can point to where you wnat something different.
0 Kudos
Message 4 of 4
(2,910 Views)