Section 7. Installation
301
Both conditions power-up the interface and leave it on with no timeout. If
SerialClose()
is used after
SerialOpen()
, the port is powered down and in a state
waiting for characters to come in.
Under normal operation, the port is powered down waiting for input. After
receiving input, there is a 40 second software timeout that must expire before
shutting down. The 40 second timeout is generally circumvented when
communicating with the
datalogger support software
(p. 86)
because the software
sends information as part of the protocol that lets the CR800 know that it can shut
down the port.
When in the "dormant" state with the interface powered down, hardware is
configured to detect activity and wake up, but there is the penalty of losing the
first character of the incoming data stream. PakBus
®
takes this into consideration
in the "ring packets" that are preceded with extra sync bytes at the start of the
packet. For this reason
SerialOpen()
leaves the interface powered up so no
incoming bytes are lost.
When the CR800 has data to send with the RS-232 port, if the data are not a
response to a received packet, such as sending a beacon, it will power up the
interface, send the data, and return to the "dormant" state with no 40 second
timeout.
Q
: How can I reference specific characters in a string?
A
: The third 'dimension' of a string variable provides access to that part of the
string after the position specified. For example, if
TempData = "STOP"
then,
TempData(1,1,2) = "TOP"
TempData(1,1,3) = "OP"
TempData(1,1,1) = "STOP"
To handle single-character manipulations, declare a string with a size of 1. This
single-character string is then used to search for specific characters. In the
following example, the first character of string
LargerString
is determined and
used to control program logic:
Public
TempData
As String
* 1
TempData = LargerString
If
TempData = "S"
Then
...
A single character can be retrieved from any position in a string. The following
example retrieves the fifth character of a string:
Public
TempData
As String
* 1
TempData = LargerString(1,1,5)
Q
: How can I get
SerialIn()
,
SerialInBlock()
, and
SerialInRecord()
to read
extended characters?
Summary of Contents for CR800 Series
Page 2: ......
Page 4: ......
Page 6: ......
Page 32: ......
Page 34: ......
Page 54: ......
Page 92: ......
Page 310: ......
Page 446: ...Section 8 Operation 446 8 11 2 Data Display FIGURE 100 CR1000KD Displaying Data ...
Page 448: ...Section 8 Operation 448 FIGURE 102 CR1000KD Real Time Custom ...
Page 449: ...Section 8 Operation 449 8 11 2 3 Final Storage Data FIGURE 103 CR1000KD Final Storage Data ...
Page 450: ...Section 8 Operation 450 8 11 3 Run Stop Program FIGURE 104 CR1000KD Run Stop Program ...
Page 452: ...Section 8 Operation 452 FIGURE 106 CR1000KD File Edit ...
Page 456: ......
Page 462: ......
Page 523: ...Section 11 Glossary 523 FIGURE 116 Relationships of Accuracy Precision and Resolution ...
Page 524: ......
Page 526: ......
Page 556: ......
Page 558: ......
Page 560: ......
Page 597: ......