BS2 serial string truncated
tabbott
Posts: 26
I use the BS2 to collect data from our tools·and send to a·PLC. There has been some complaints of the data string occasionally missing·the last entry. Connecting a tee to the serial line and observing the sent data on a laptop confirms this issue. About one in a 100 lines has the dropped data. It's puzzling me because the last 3 entries are·all sent in the same command. Devices used at different locations have the same problem.
So we will see something like this on both devices monitoring the serial data:
112761······· 65.0····· 348······ 21221
112762······· 65.2····· 351······ 21221
112763······· 65.3····· 353······ 21221
112764······· 65.2····· 351······ 21221
112765······· 65.2····· 351······ 21221
112766······· 65.1····· 350······ 21221
112767······· 65.2····· 351······
112768······· 65.2····· 351······ 21221
112769······· 65.2····· 351······ 21221
112770······· 65.4····· 355······ 21221
112761······· 65.2····· 351······ 21221
Attached is the full code, but this segment is the issue:
IF UpperCount=0 THEN Skip6·······
SEROUT 16,16780,[noparse][[/noparse]DEC UpperCount,DEC4 ClampCount,9]
GOTO Skip7
Skip6:·············
SEROUT 16,16780,[noparse][[/noparse]DEC ClampCount,9]
Skip7:·············
SEROUT 16,16780,[noparse][[/noparse]DEC Result/10,".",DEC Result//10,9,DEC Force,9,DEC SerialNumber,9]
...
SEROUT 16,16780,[noparse][[/noparse]10,13]
Any ideas as to the cause and/or a fix?
·····
So we will see something like this on both devices monitoring the serial data:
112761······· 65.0····· 348······ 21221
112762······· 65.2····· 351······ 21221
112763······· 65.3····· 353······ 21221
112764······· 65.2····· 351······ 21221
112765······· 65.2····· 351······ 21221
112766······· 65.1····· 350······ 21221
112767······· 65.2····· 351······
112768······· 65.2····· 351······ 21221
112769······· 65.2····· 351······ 21221
112770······· 65.4····· 355······ 21221
112761······· 65.2····· 351······ 21221
Attached is the full code, but this segment is the issue:
IF UpperCount=0 THEN Skip6·······
SEROUT 16,16780,[noparse][[/noparse]DEC UpperCount,DEC4 ClampCount,9]
GOTO Skip7
Skip6:·············
SEROUT 16,16780,[noparse][[/noparse]DEC ClampCount,9]
Skip7:·············
SEROUT 16,16780,[noparse][[/noparse]DEC Result/10,".",DEC Result//10,9,DEC Force,9,DEC SerialNumber,9]
...
SEROUT 16,16780,[noparse][[/noparse]10,13]
Any ideas as to the cause and/or a fix?
·····
bs2
13K
Comments
Edit:· Yup, review shows, at line 268 if "tempSerial" is zero, you call "SetYellow".· One side effect of "SetYellow" is to set SerialNumber to the (holding zero) "tempSerial".
Post Edited (allanlane5) : 9/6/2007 12:25:11 AM GMT
And I belive I would see the number 0 instead of a blank - I am using the DEC modifier.
SetYellow: 'place the box in a "new tool" mode (tool has been disconnected)
HIGH YellowLED
LOW GreenLED
NewTool = 1
SerialNumber = tempserial
PAUSE 10
GOTO CheckTool