beautypg.com

2 input programming basics – Campbell Scientific CR3000 Micrologger User Manual

Page 211

background image

Section 7. Installation

211

 

• Buffer-size margin (one extra record + one byte).

SerialOutBlock()

1,3

• Binary
• Can run in pipeline mode inside the digital measurement task (along with

SDM instructions) if the COMPort parameter is set to a constant argument
such as

COM1

,

COM2

,

COM3

, or

COM4

, and the number of bytes is also

entered as constant.

SerialOut()

• Handy for ASCII command and a known response, e.g., Hayes-modem

commands.

• Returns 0 if not open, else the number of bytes sent

SerialInRecord()

2

• Can run in pipeline mode inside the digital measurement task (along with

SDM instructions) if the COMPort parameter is set to a constant argument
such as

COM1

,

COM2

,

COM3

, or

COM4

, and the number of bytes is also

entered as a constant.

• Simplifies synchronization with one way.
• Simplifies working with protocols that send a "record" of data with known

start and/or end characters, or a fixed number of records in response to a poll
command.

• If a start and end word is not present, then a time gap is the only remaining

separator of records. Using

COM1

,

COM2

,

COM3

, or

COM4

coincidentally

detects a time gap of >100 bits if the records are less than 256 bytes.

• Buffer size margin (one extra record + one byte).

1

Processing instructions

2

Measurement instruction in the pipeline mode

3

Measurement instruction if expression evaluates to a constant

7.8.8.5.2 Input Programming Basics

Applications with the purpose of receiving data from another device usually
include the following procedures. Other procedures may be required depending on
the application.

1. Know what the sensor supports and exactly what the data are. Most sensors

work well with TTL voltage levels and RS-232 logic. Some things to
consider:

• Become thoroughly familiar with the data to be captured.
• Can the sensor be polled?
• Does the sensor send data on its own schedule?
• Are there markers at the beginning or end of data? Markers are very useful

for identifying a variable length record.