beautypg.com

5 crbasic programming – Campbell Scientific CR1000 Measurement and Control System User Manual

Page 204

background image

Section 7. Installation

204 

 

 

Marks and Spaces 

RS‐232 signal levels are inverted logic compared to TTL. The different 
levels are called marks and spaces. When referenced to signal ground, 
the valid RS‐232 voltage level for a mark is ‐3 to ‐25, and for a space is 
+3 to +25 with ‐3 to + 3 defined as the transition range that contains no 
information. A mark is a logic 1 and negative voltage. A space is a logic 0 
and positive voltage. 

MSB 

Most significant bit (the leading bit). 

RS‐232C 

Refers to the standard used to define the hardware signals and voltage 
levels. The CR1000 supports several options of serial logic and voltage 
levels including RS‐232 logic at TTL levels and TTL logic at TTL levels. 

RX 

Receive 

SP 

Space 

Start bit 

Is the bit used to indicate the beginning of data. 

Is the end of the data bits. The stop bit can be 1, 1.5 or 2. 

TX 

Transmit 

7.8.8.5 CRBasic Programming

To transmit or receive RS-232 or TTL signals, a serial port (see table CR1000
Serial Ports

(p. 202)

) must be opened and configured through CRBasic with the

SerialOpen() instruction. The SerialClose() instruction can be used to close the
serial port. Below is practical advice regarding the use of SerialOpen() and
SerialClose(). Program CRBasic example Receiving an RS-232 String

(p. 210)

shows the use of SerialOpen(). Consult CRBasic Editor Help for more
information.

SerialOpen

(COMPort,BaudRate,Format,TXDelay,BufferSize)

 

COMPort — Refer to CRBasic Editor Help for a complete list of COM ports

available for use by SerialOpen().