LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Read Data Out of Order

This is an issue related to a program I posted a few days ago. I was having issues reading data into Labview but was able to rectify it. After resolving an issue with overflows, I'm running into an issue where the four data points I'm sending into Labview are being read out of order. I just have four constants I'm reading in for now but obviously when I switch to actual inputs I'll be wanting the data to be coming in the same order every time. I've run it and watched the memory on CCS side and the data seems to be coming in the correct order. Even pulsing Labview shows the data in differing orders each time. Apologies for having my serial setup as a different VI, I haven't gotten around to integrating them together. Any advice is appreciated!

Download All
0 Kudos
Message 1 of 2
(2,598 Views)

Is your device sending the data actually sending data in response to the "Hello World" request you are sending?  Or is it just sending data continuously?

 

Your VI only runs once and only does something if you happened to have made the Start button True before you ran it.  Since you are configuring the port inside that case structure, you are emptying the buffer before you write the Hello World and then reading the response.  If the device happens to be sending data continuously, then when you open and configure the serial port, you might just have happened to do it in the middle of a packet of data being sent.

 

Other things weird, what is going on with the search/split string?  You don't seem to be searching on anything since you have nothing wired to the Search String input.  You just have the Offset of 8.  Actually, I don't think your VI is even suppose to run because the Search String input is a required input according to LabVIEW help.

 

So you are reading 32 bytes of data.  What does that data look like?  You seem to be splitting put the 32 bytes you just received into 4 groups of 8.  However, you only read 32,  If you have 32 bytes of actual data, then you never read the termination character that you enabled which would be the 33 byte.

 

What does "pulsing LabVIEW" mean?

 

 

0 Kudos
Message 2 of 2
(2,570 Views)