LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to parse serial data?

Solved!
Go to solution

@guyh2 wrote:

@COq Rouge

Thank you for your comments

I did try that, and it works as long as the stream is not already running.

 

If I start the VI and then start the stream, it ignores the text header and properly processes the packets

BUT if the stream is already running it is not so reliable it seems to overrun sometimes when I switch from reading 1 byte at a time to 20 bytes.

 

With execution highlighting on, it works 100% at full speed it works 50%

Probably some weird PC biffering issue



Now I am sure what you are talking about. I think your problems are related not to Labview. But to your Labview skills. But we all have to learn one time so being a beginner is nothing to to be ashamed of. Instead of going round in circles. Post your code even if it do not work. And tell us what kind of interment you are using. If you have any relevant data for the instrument post that to ( like a document describing the protocol). Then we will be able to help MUCH faster



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 11 of 13
(1,294 Views)
Ok, here is my original - now please bear in mind I first laid eyes on Labview 36 hrs ago ...
As it happened this VI did enable me to get started - but I know I really should read the manual and tutorials properly
It is generally very nasty - I can see that now
It did teach me that I was doing something very wrong - which is why I popped up on here 🙂
The 'protocol' is literally some ascii text strings each terminated with \r\n sent at startup then 9 16-bit signed integers sent little-endian (I was told big, but have now found out using my VI 😄 that it is little) then teh packets are delimited by 2 bytes of 0xAA chosen because it helps to keep the serial stream in sych and is really obvious on a scope & in hex. This is sent every 5ms
well, at least it will serve as an example of how not to do it 😞

@COq Rouge wrote:


Now I am sure what you are talking about. I think your problems are related not to Labview. But to your Labview skills. But we all have to learn one time so being a beginner is nothing to to be ashamed of. Instead of going round in circles. Post your code even if it do not work. And tell us what kind of interment you are using. If you have any relevant data for the instrument post that to ( like a document describing the protocol). Then we will be able to help MUCH faster


 

0 Kudos
Message 12 of 13
(1,286 Views)

Edit: Nevermind. I see you were not asking a question but showing how you were doing it wrong Smiley Very Happy

 

The code in the 0 case will execute on the first loop iteration, the code in the 1 case will execute on the second loop iteration, then the code in case 0 will execute for the remainder of the loop iterations since it is the default case.

=====================
LabVIEW 2012


0 Kudos
Message 13 of 13
(1,256 Views)