Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 66739

Parse a string from a serial port.

$
0
0

Hello.

 

I have some sensors connected to a serial port and each minute I have a burst of 216 bytes coming in and then wait for the next burst.

The data have a specific format and I want to parse them and create a *.csv file.

 

I am having problems understanding some things for the VISA drivers and some things about the continuous parsing.

 

Attached is my simplified vi.

 

So, here are my questions:

 

1. What does the timeout in the wait for event function do? I put it 100 randomly. What happens if the timeout occurs while the data are coming in?

 

2. How does the read function knows when to give me the string? When I place an indicator in the count, I read 216, why does it not wait for 300, which is the number I have in there?

 

3. Since every minute I have 216 bytes, how will the parsing mechanism know that it is time to start/stop parsing?

 

4. How can I divide the string into smaller sub strings? Should I do it by using a lot of search/split strings lineary? How can I store it?

 

5. After the parsing of a string, how can I store it in an array of strings and store the next string in the next index of the array?

 

 

I know it's too much but can you point me to an example or a tutorial?

 

Thanks a lot,

Vasileis.


Viewing all articles
Browse latest Browse all 66739

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>