Quantcast
Channel: Instrument Control (GPIB, Serial, VISA, IVI) topics
Viewing all articles
Browse latest Browse all 5625

cutting serial(rs232) data streem

$
0
0

Hello,

 

I'm having a trouble with data handleing so, I need some help.

I connected a NOx analyzer (nCLD63) with PC by usb-rs232 converter.

according to the instrument's displat, I should receive a data start with \06@\02* and end with \03n (n is some number).

But instrument send data constantly (cannot change this), my program read the data start with middle of it.

for example, data should be

\06@\02*,-0.8020,-0.7834,*,*,*,*,*,AmB,B@@@,GE@,0000,0000,@@@@\03G

but program read it like

@,0000,0000,@@@@\03G\06@\02*,-0.8020,-0.7834,*,*,*,*,*,AmB,B@@@,GE@,0000,0000,@@@@\03K\06@\02*,-0.8(untill bytes are full)

 

As one data packet have constant length, I think "Search spllit/string" would be possible with about twice length of read byte setting.

And here is the question

but I'm wonder that in case of read data was

@@@@\03K
\06@\02*,-0.8010,-0.7778,*,*,*,*,*,AmB,B@@@,GE@,0000,0000,@@@@\03@
\06@\02*,-0.8020,-0.7851,*,*,*,*,*,AmB,B@@@,GE@,0000,0000,

and I put "\06@\02*" as a "Search string/char" , where is the split point? is it in front of -0.8010 or in front of -0.8020?

 

and is there are any other, better solution?

 

Thanks.


Viewing all articles
Browse latest Browse all 5625

Trending Articles



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