G-Shine is a manufacturer and supplier of advanced Load Cells, Force Sensors, Torque Sensors, Pressure Sensors, Signal Conditioners......
Weighing Accessories XK3196G Weighing Indicator Protocol

Weighing Accessories XK3196G Weighing Indicator Protocol

1.The 9 pins of indicator
1,2:nothing;3,8,9:earth; 
4:RS232 TXD;5:RS232 RXD;
6,7:large display data(TTL)

Indicator pins

4

5

3,8,9

 

Computer 9 pins

2

3

5

Short:4-6,7-8

Computer 15 pins

8

14

5

Short:5-7

Computer 25 pins

3

2

7

Short:4-5,6-10



2.Connection of indicator pins and computer pins
3.Indicator and computer communication
Weighing indicator continual send the current weight data to computer, 7 bytes a suite: the first is start bit (&HCD),other 6 bytes means the 6 digits weight,as the follow rule:(PS:&H means hex)

Not display data------&H0A
Display weight--------display "8",the byte is &H08,display"8.",the first is 1,namely &H88
Minus---------------&H0B
Lock "L"-------&H11 (dynamic G indicator can lock the data, the first digit is"L",the code is &H11)

Example:

weight

1st byte

2nd byte

3rd byte

4th byte

5th byte

6th byte

7th byte

1234

&HCD

&H0A

&H0A

&H01

&H02

&H03

&H04

123.4

&HCD

&H0A

&H0A

&H01

&H02

&H83

&H04

-123.4

&HCD

&H0A

&H0B

&H01

&H02

&H83

&H04

L1234

&HCD

&H11

&H0A

&H01

&H02

&H03

&H04


Example Programme(VB)
'Receiving 13 bytes from RS232'
dim ss as Variant
dim i,j as integer
dim tmpstr as string
 
ss = MSComm1.Input
If LenB(ss) < 13 Then
Exit Sub
End If

'judge which byte the data start(algorism 205 is hex CD)
While ss(i)<>205 and i<7
i=i+1
wend

'give up the data which has not 6 bytes after start bit
if i>6 then exit sub

tmpstr=""
for j=i+1 to i+6
If ss(j) <> 10 Then
If ss(j) = 11 Then
tmpstr = tmpstr & "-"
ElseIf ss(j) > 127 Then
tmpstr = tmpstr & CStr(ss(j) And 127) & "."
Else
tmpstr = tmpstr & CStr(ss(j))
End If
End If
next j

PS: the last tmpstr is the data that indicator sends to computer. 7 bytes is a weight data, the data is continually sent to computer, so this program gets 13 bytes every time to make sure there is one weight data. Customer can improve on it to match their requirement.