LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multi word serial reception

Solved!
Go to solution

Hi all,

I receive from my equipment data ,on serial communication ,with words separate by 'return' .

I use a master/slave loop to avoid missing message .

My problem is that the number of word is not the same on each reception (i don't know the number i will receive):

ie :

first reception : 23455\r

second : 35435\r56755\r

third : 354353\r56765756567\r456464\r

fourth : 7567\r

..............

But I need to answer to each word ,but as the text (Data received) enter in my buffer are not same lengh my answer is not correct.

As anyone have a solution ?

 

regards

 

Rock31

0 Kudos
Message 1 of 3
(1,993 Views)
Solution
Accepted by topic author rock_31

Just set the Termination character to \r and enable end on termination character using Serial Initialize.vi.  Read 1024 characters.

 

Then Read.vi will return whenever it sees a \r coming in (or 1024 characters Or timeout but you'll see the \r first Smiley Wink)


"Should be" isn't "Is" -Jay
Message 2 of 3
(1,991 Views)

Thanks a lot for your help Jeff !!

 

It's works now.

 

Smiley Very Happy

 

Rock31

0 Kudos
Message 3 of 3
(1,969 Views)