![Campbell CR800 Series Скачать руководство пользователя страница 284](http://html1.mh-extra.com/html/campbell/cr800-series/cr800-series_operators-manual_489099284.webp)
Section 7. Installation
284
7.7.17.5 Serial I/O CRBasic Programming
To transmit or receive RS-232 or TTL signals, a serial port (see table
CR800
Serial Ports
(p. 280))
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. 290)
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()
.
•
BaudRate
— 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 comms.
•
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 executed 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.7.17.5.1 Serial I/O Programming Basics
SerialOpen()
1
•
Closes PPP (if active)
•
Returns TRUE or FALSE when set equal to a Boolean variable
•
Be aware of buffer size (ring memory)
Содержание CR800 Series
Страница 2: ......
Страница 4: ......
Страница 6: ......
Страница 32: ......
Страница 34: ......
Страница 54: ......
Страница 92: ......
Страница 190: ...Section 7 Installation 190 FIGURE 40 Running Average Frequency Response FIGURE 41 Running Average Signal Attenuation ...
Страница 310: ......
Страница 446: ...Section 8 Operation 446 8 11 2 Data Display FIGURE 100 CR1000KD Displaying Data ...
Страница 448: ...Section 8 Operation 448 FIGURE 102 CR1000KD Real Time Custom ...
Страница 449: ...Section 8 Operation 449 8 11 2 3 Final Storage Data FIGURE 103 CR1000KD Final Storage Data ...
Страница 450: ...Section 8 Operation 450 8 11 3 Run Stop Program FIGURE 104 CR1000KD Run Stop Program ...
Страница 452: ...Section 8 Operation 452 FIGURE 106 CR1000KD File Edit ...
Страница 456: ......
Страница 462: ......
Страница 523: ...Section 11 Glossary 523 FIGURE 116 Relationships of Accuracy Precision and Resolution ...
Страница 524: ......
Страница 526: ......
Страница 556: ......
Страница 558: ......
Страница 560: ......
Страница 597: ......