04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Section 7. Installation<br />

7.8.8.1 Introduction<br />

Serial denotes transmission of bits (1s and 0s) sequentially, or "serially." A byte<br />

is a packet of sequential bits. RS-232 and TTL standards use bytes containing<br />

eight bits each. Imagine that an instrument transmits the byte "11001010" to the<br />

<strong>CR1000</strong>. The instrument does this by translating "11001010" into a series of<br />

higher and lower voltages, which it transmits to the <strong>CR1000</strong>. The <strong>CR1000</strong><br />

receives and reconstructs these voltage levels as "11001010." Because an RS-232<br />

or TTL standard is adhered to by both the instrument and the <strong>CR1000</strong>, the byte<br />

successfully passes between them.<br />

If the byte is displayed on a terminal as it was received, it will appear as an ASCII<br />

/ ANSI character or control code. Table ASCII / ANSI Equivalents (p. 201) shows a<br />

sample of ASCII / ANSI character and code equivalents.<br />

Table 30. ASCII / ANSI Equivalents<br />

Byte<br />

Received<br />

ASCII<br />

Character<br />

Displayed<br />

Decimal<br />

ASCII<br />

Code<br />

Hex<br />

ASCII<br />

Code<br />

00110010 2 50 32<br />

1100010 b 98 62<br />

00101011 + 43 2b<br />

00001101 cr 13 d<br />

00000001 ☺ 1 1<br />

Read More! See the appendix ASCII / ANSI Table (p. 553) for a complete list of<br />

ASCII / ANSI codes and their binary and hex equivalents.<br />

The face value of the byte, however, is not what is usually of interest. The<br />

manufacturer of the instrument must specify what information in the byte is of<br />

interest. For instance, two bytes may be received, one for character 2, the other for<br />

character b. The pair of characters together, "2b", is the hexadecimal code for "+",<br />

"+" being the information of interest. Or, perhaps, the leading bit, the MSB (Most<br />

Significant Bit), on each of two bytes is dropped, the remaining bits combined,<br />

and the resulting "super byte" translated from the remaining bits into a decimal<br />

value. The variety of protocols is limited only by the number of instruments on<br />

the market. For one in-depth example of how bits may be translated into usable<br />

information, see the appendix FP2 Data Format (p. 557).<br />

Note ASCII / ANSI control character ff-form feed (binary 00001100) causes a<br />

terminal screen to clear. This can be frustrating for a developer who prefers to see<br />

information on a screen, rather than a blank screen. Some third party terminal<br />

emulator programs, such as Procomm, are useful tools in serial I/O development<br />

since they handle this and other idiosyncrasies of serial communication.<br />

When a standardized serial protocol is supported by the <strong>CR1000</strong>, such as<br />

PakBus® or Modbus, translation of bytes is relatively easy and transparent.<br />

However, when bytes require specialized translation, specialized code is required<br />

in the user-entered CRBasic program, and development time can extend into<br />

several hours or days.<br />

201

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!