LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Index Array for running data

Solved!
Go to solution

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 

0 Kudos
Message 1 of 30
(3,428 Views)

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.

0 Kudos
Message 2 of 30
(3,422 Views)
If your live data is inside the array then yes you can index it. The classical way to handle this is via a queue, where you have some code put data into the queue, and you have other code that reads data from the queue for later use.
0 Kudos
Message 3 of 30
(3,420 Views)

'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? 

0 Kudos
Message 4 of 30
(3,408 Views)

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.

0 Kudos
Message 5 of 30
(3,394 Views)

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



-Matt
0 Kudos
Message 6 of 30
(3,393 Views)

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 

 

Code_datacollection.png

0 Kudos
Message 7 of 30
(3,385 Views)

Sample data file - I couldnt attach it before 

Data.png

 

0 Kudos
Message 8 of 30
(3,376 Views)

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



-Matt
0 Kudos
Message 9 of 30
(3,368 Views)

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 

0 Kudos
Message 10 of 30
(3,364 Views)