LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read 7 bytes interrupted on receipt of 0A


I want to read the positions of the absolute encoder, 3 bytes of hex 4042 02 are sent for reading, and in response hex consisting of 7 bytes for example 4042 0000 0009 0B 1-byte address
2-byte read function positions
3,4,5,6-bytes absolute position
7- check summ.
In the Hiperface or COM Port Toolkit terminals, everything is read correctly but inconveniently. I created an example in LabVIEW, but when 0A appears in the received bytes from the encoder, then 7 bytes are divided into two after 0A by 5 and 2, 6 and 1 bytes.
000A / 10 = 6 and rb2
010A / 266 = 6 and rb2
020A / 522 = 6 and rb2
030A / 778 = 6 and rb2
040A / 1034 = 6 and rb2
050A / 1290 = 6 and rb2
060A / 1546 = 6 and rb2
070A / 1802 = 6 and rb2
080A / 2058 = 6 and rb2
090A / 2314 = 6 and rb2

from 0A00 / 2560 = 5 and rb2
,,,,,,,,,,,,,,
0A0A / 2570 = 5 and rb2 rb3
,,,,,,,,,,,,,,
to 0AFF / 2815 = 5 and rb2

0B0A / 2826 = 6 and rb2
0C0A / 3082 = 6 and rb2
0D0A / 3338 = 6 and rb2
0E0A / 3594 = 6 and rb2
0F0A / 3850 = 6 and rb2

In LabVIEW, I added two more reading functions and the function of determining the bytes of reading and then combining bytes (concatenate string) and everything seems to work, but how can it be done in an easier way.

0 Kudos
Message 1 of 4
(1,186 Views)

hex 0009.jpghex 000A.jpghex 0A00.jpghex 0A0A.jpg

0 Kudos
Message 2 of 4
(1,183 Views)

 VIWeek 2020/Proper way to communicate over serial  

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 4
(1,171 Views)

Read the article mentioned by RTLSV. It explains lots of details. You have a binary data protocol, but default communication is normally in ASCII form. Look at the Configure Serial Port.vi and disable the "Enable termination Character" setting by wiring a FALSE constant to it.

Rolf Kalbermatter
My Blog
0 Kudos
Message 4 of 4
(1,091 Views)