07-28-2016 03:08 PM
Hi,
I have live running data, and I'm trying to read certain points with Index Array. Is this for data which is already collected, or is there another way I can collect data which is live?
Thanks,
Andrea
Solved! Go to Solution.
07-28-2016 03:11 PM
I'm sorry, but your question is very ambiguous.
Index array picks out elements from an array. How that relates to data which is already collected or "data which is live" only means something within the context of how you wrote your VI. Something we can't comment on because you haven't shown us your VI.
07-28-2016 03:12 PM
07-28-2016 03:24 PM
'Live' meaning actively collecting data. It's coming in form of a string, how do I best extract the information that I need, and display it as it is coming in?
07-28-2016 03:47 PM
Does the string have some kind of delimeter (space, comma, tab ... ) to separate the data points? If so, then you can write a code to change it from a string to an array of numbers. After that, you can use index array to pick out the point you want.
07-28-2016 03:49 PM
Andrea,
You say its coming from a string, an array of strings? If an array of strings youll need to index the array at the element youre looking for or display the entire array depending on the size. Otherwise if you are looking to parce the data you can use match pattern or match regular expression and then youll need a string indicator to display the data to the front panel. Uploading code or at the minimum a picture is the best suggestion for a quick answer to this question though.
Matt
07-28-2016 04:06 PM - edited 07-28-2016 04:10 PM
Here's the code ... I'm free to changing the structure, I was just playing around with it according to my coding abilities. It's not quite working because I think I need to put an event structure around the boolean (!=1) into the case statement. B
Basically it's reading data in from an open communication. If data is coming in and it is continually changing, can there be an index assigned?
I have attached, sample data file as well
07-28-2016 04:12 PM - edited 07-28-2016 04:17 PM
Sample data file - I couldnt attach it before
07-28-2016 04:25 PM
Do you have any control over the data file format? It would probably be easier if you had a termination character so you could chunk your received data when the entire string is received. Because it sounds like youre having trouble capturing the right data because when you read it will read either 1651 chars or until timeout. You dont really know if you received all the data.
Is that correct?
Matt
07-28-2016 04:34 PM
In the requirements, it is indicated that the data received is received in 1651 byte chunks, the data is formatted correctly. I don't have any control in how the data is received, I would have to modify it on my end