The Balluff BVS-ID-3-005-E is a vision sensor with barcode reader tools. The sensor can be triggered using an RS-232 serial command.
The RS-232 serial command to trigger the camera is:
TRIGGER<0x00>
where <0x00> is a byte with the value of zero.
The response is:
<0x02>OK&ACK<0x0D><0x0A>
byte value 02 followed by ASCII ending with Carriage Return and Line Feed bytes 13 (0D) and 10 (0A)
When using ethernet the trigger command is:
TRIGGER
No Null byte is needed.
The response is:
OK&ACK<0x00>
The null byte is part of the response.
Why are these different? I spent about 5 hours troubleshooting this.
Edit 20200121:
And get this, the PLC that needs to send the trigger command can't automatically send the <0x00> null byte at the end of the TRIGGER string. The PLC's string and serial com library treat the <0x00> as the null termination character for the string. So it doesn't send the the <0x00> byte. We tried to concatenate a '$00' in structured text (which is the null byte <0x00>) and it just ignores it. Ultimately Roger, the programmer of the PLC, had to overwrite the serial communication "Data to Send" register, from 7 to 8 bytes. Sysmax studio may require the overwrite.
No comments:
Post a Comment