Campbell Scientific CR6 CR6 Measurement and Control System - Page 252
Input Instruction Set Basics
View all Campbell Scientific CR6 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 252 highlights
Section 7. Installation Term. stop bit Is the end of the data bits. The stop bit can be 1, 1.5 or 2. Term. TX Transmit 7.9.16.5 CRBasic Programming To transmit or receive RS-232 or TTL signals, a serial port (see table CR6 Serial Ports ) 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. 257) 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(). • BaudRrate - Baud rate mismatch is frequently a problem when developing a new application. Check for matching baud rates. Some developers prefer to use a fixed baud rate during initial development. When set to -nnnn (where nnnn is the baud rate) or 0, auto baud-rate detect is enabled. Autobaud is useful when using the CS I/O and RS-232 ports since it allows ports to be simultaneously used for sensor and PC telecommunications. • Format - Determines data type and if PakBus® communications can occur on the COM port. If the port is expected to read sensor data and support normal PakBus® telemetry operations, use an auto-baud rate argument (0 or nnnn) and ensure this option supports PakBus® in the specific application. • BufferSize - The buffer holds received data until it is removed. SerialIn(), SerialInRecord(), and SerialInBlock() instructions are used to read data from the buffer to variables. Once data are in variables, string manipulation instructions are used to format and parse the data. SerialClose() must be used before SerialOpen() can be used again to reconfigure the same serial port, or before the port can be used to communicate with a PC. 7.9.16.5.1 Input Instruction Set Basics Caution - The following feature or information pertains to the CR6 datalogger in concept only. It is not yet adapted to CR6 specifics. SerialOpen()1 • Be aware of buffer size (ring memory) • Closes PPP (if active) • Returns TRUE or FALSE when set equal to a Boolean variable SerialClose() • Examples of when to close o Reopen PPP o Finished setting new settings in a Hayes modem 252