Example 1 setting the flash mode to auto

To set the flash mode we use command 32. The parameter is a single byte which we set to 3 which in this command means Auto mode. The command thus consists of the following bytes:

00 32 01 00 03

Assuming that everything goes as planned, the camera will respond to this command with the response message:

00 33 01 00 00

We will now have a look at a lower level to see the actual bytes transferred between the computer and the camera. As I mentioned previously, all commands and data must be encapsulated in the low level protocol, described at the beginning of this document.

The low level protocol does things such as attaching control characters and checksums, as well as checking for any transmission errors.

The actual sequence of bytes transmitted is as follows:
Computer sends: Camera Sends Name Description
10 02 - DLE-STX Data Link Escape followed by Start of TeXt - this indicates the beginning of a packet of data to be transmitted over the serial link
00 32 01 00 03 - - This is the actual data that we want to transmit. It is the set flash command described above
10 03 - DLE-ETX Data Link Escape followed by End of TeXt - this indicates the end of the message
33 - BCC Block check character - this is a checksum computed by doing an XOR of all the data bytes as well as the final ETX character
- 06 ACK Acknowledge - the camera acknowledges that it has received the command correctly and understood it
- 10 02 DLE-STX Data Link Escape followed by Start of TeXt - this indicates the beginning of the packet of data to be transmitted to the computer
- 00 33 01 00 00 - This is the actual response message sent by the camera
- 10 03 DLE-ETX Data Link Escape followed by End of TeXt - this indicates the end of the message
- 30 BCC Block check character - this is a checksum computed by doing an XOR of all the data bytes as well as the final ETX character
06 - ACK Acknowledge - we acknowledge receipt of the camera response message

Note that only the bytes shown in bold are the actual data transmitted. The rest of the bytes are just for controlling the data flow. I.e. they belong to the low level protocol.

In calculating the checksum, the only bytes considered in addition to the bold ones are the ETX control characters at the end of each message.


Page last updated on 2nd June 1999

Back to first page , Back to home page