Example Commands - Basler A102K User Manual

Hide thumbs Also See for A102K:
Table of Contents

Advertisement

Configuring the Camera

4.2.3 Example Commands

4.2.3.1 Read Command
An example of the command message used to read the camera status is:
0x02, 0x43, 0x82, 0xC1, 0x03
0x02 - is the STX. The STX is always 0x02.
0x43 - is the first byte of the descriptor. The first byte of the descriptor is the command ID.
Command IDs can be found in the tables on pages 4-10 through 4-28. If you check
the table on page 4-26, you will find that the ID for the camera status read command
is 0x43.
0x82 - is the second byte of the descriptor. The MSB in this byte represents the read/write
flag and since this is a read command, the bit should be set to a 1. The other seven
bits of this byte represent the data size (in bytes) that will be transferred using this
command. If you check the table on page 4-26, the data size for the camera status
command is 2 bytes. So the arrangement of the bits in the second byte of the
descriptor should be 1000 0010 which translates to 0x82.
Note that for read commands, the data size specified in the descriptor represents the
number of bytes of data that you expect to see in the response. No data bytes are
actually included in the read command.
0xC1 - is the block check character (BCC). See page 4-9 for instructions on calculating a
BCC.
0x03 - is the ETX. The ETX is always 0x03.
4.2.3.2 Write Command
An example of the command message used to copy the Work Set to User Set 2 is:
0x02, 0x46, 0x01, 0x02, 0x45, 0x03
0x02 - is the STX. The STX is always 0x02.
0x46 - is the first byte of the descriptor. If you check the table on page 4-24, you will find that
the ID for the command to copy the Work Set to a User Set is 0x46.
0x01 - is the second byte of the descriptor. The MSB in this byte represents the read/write
flag and since this is a write command, the bit should be set to a 0. The other seven
bits of this byte represent the data size (in bytes) that will be transferred using this
command. If you check the table on page 4-24, the data size for the Copy Work Set
to User Set command is 1 byte. So the arrangement of the bits in the second byte of
the descriptor should be 0000 0001 which translates to 0x01.
0x02 - is the data byte. If you check the table on page 4-24, you will find that to copy the Work
Set to User Set 2, the data byte must be set to 0x02.
0x45 - is the block check character (BCC). See page 4-9 for instructions on calculating a
BCC.
0x03 - is the ETX. The ETX is always 0x03.
4-8
DRAFT
k
BASLER A102

Advertisement

Table of Contents
loading

Table of Contents