From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help Parsing Hex String

Solved!
Go to solution

It is very slow because you only parse one block per second. Typically systems like this would use parallel loops.  One loop would acquire the signals coming in from the external device.  The second loop would parse the string.  The parsing loop would run quite fast as long as the string has more than 4 characters.  When it has fewer than 4 it waits for more data from the other loop.

 

Depending on how you get the raw data, you may be able to use a single loop with a delay which depends on the amount of data in the string. Use a case structure to only read data from the external device when it is available.  It is hard to be more specific without knowing more about your system.

 

Lynn

0 Kudos
Message 11 of 13
(604 Views)

At the moment I have 1 loop for reading from the serial port and this is where I am parsing the string and inserting it into the queue. Another loop that reads from the queue and separates that data depending on the header. and a third loop that only analyzes the separated data. I'm sure I can figure this out so if I don't I will be back. What you told me is a very good starting point

0 Kudos
Message 12 of 13
(600 Views)

Here is my solution to that problem. Seems to work quite well and much faster than one element every scan.

Message 13 of 13
(588 Views)