Section 7. Installation
SerialOpen()
instruction cause other power cycles?
A
: The RS-232 port is left on under the following conditions:
•
When the setting
RS-232Power
(p. 627)
is set
•
When a
SerialOpen()
with argument
COMRS232
is used in the program
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. 95)
because the software
sends information as part of the protocol that lets the CR1000 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 CR1000 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?
265
Summary of Contents for CR1000
Page 2: ......
Page 4: ......
Page 6: ......
Page 32: ......
Page 36: ......
Page 38: ......
Page 40: ......
Page 60: ...Section 4 System Quickstart Figure 16 PC200W View Line Graph 60 ...
Page 96: ......
Page 98: ...98 ...
Page 302: ......
Page 453: ...Section 8 Operation Figure 115 Using the Keyboard Display 453 ...
Page 456: ...Section 8 Operation Figure 118 Real Time Custom 456 ...
Page 457: ...Section 8 Operation 8 8 1 3 Final Memory Tables Figure 119 Final Memory Tables 457 ...
Page 458: ...Section 8 Operation 8 8 2 Run Stop Program Figure 120 Run Stop Program 458 ...
Page 460: ...Section 8 Operation Figure 122 File Edit 460 ...
Page 461: ...Section 8 Operation 8 8 4 PCCard Memory Card Display Figure 123 PCCard CF Card Display 461 ...
Page 478: ......
Page 506: ......
Page 536: ......
Page 636: ......
Page 642: ......
Page 644: ......
Page 676: ......
Page 677: ......