Chapter 3: Commands
Only three commands are required to operate the 232OPSDA: the read A/D command, read digital I/O command, and the set digital output command. The command string consists of four bytes. The read A/D and digital I/O commands require an additional data byte. See Table 3.1.
Table 3.1: 232OPSDA Commands
Function | Command | Response |
Read A/D | !0RA{#} | |
Channels |
| {ch0msb}{ch0lsb} |
Read | !0RD | {I/O states} |
Digital I/O |
|
|
Set Digital | !0SO{#} | no response |
Output |
|
|
NOTE: Each {…} represents one byte.
In addition to the commands mentioned above, an extended set of commands are provided that support
Table 3.1: 232OPSDA Commands
Function | Command | Response |
Read A/D | #0RA{#}~{#} | {ch#msb}~{ch#msb}{ch#lsb}{ch#lsb} |
Channels |
| |
|
| ~{ch0msb}{ch0lsb}~{ch0lsb} |
Read | #0RD | {I/O states}~{I/O states} |
Digital I/O |
|
|
Set Digital | #0SO{#}~{#} | no response |
Output |
|
|
NOTE: ~{…} represents the complement of one byte.
Before going into the specifics of each command, it is important to understand that a byte has a value from 0 to 255 and can be represented in decimal (0 to 255), hexadecimal (00 to FF), or by an ASCII character. The commands in Table 3.1 are shown in ASCII, for example: “!0RD”. The decimal and hexadecimal equivalents of some ASCII characters are shown in Table 3.2. Notice that the ASCII representation of the character “0” does not have a value of 0. Refer to Appendix A for more ASCII, decimal, and hexadecimal equivalents.
Documentation Number 232OPSDA1397 Manual | 11 |
B&B Electronics
PH (815)