
Section 7. Installation
326
packet. For this reason SerialOpen() leaves the interface powered up so no
incoming bytes are lost.
When the CR3000 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?
A: Open the port in binary mode (mode 3) instead of PakBus-enabled mode
(mode 0).
Q: Tests with an oscilloscope showed the sensor was responding quickly, but the
data were getting held up in the internals of the CR3000 somewhere for 30 ms or
so. Characters at the start of a response from a sensor, which come out in 5 ms,
were apparently not accessible by the program for 30 ms or so; in fact, no data
were in the serial buffer for 30 ms or so.
A: As a result of internal buffering in the CR3000 and / or external interfaces, data
may not appear in the serial port buffer for a period ranging up to 50 ms
(depending on the serial port being used). This should be kept in mind when
setting timeouts for the SerialIn() and SerialOut() instructions, or user-defined
timeouts in constructs using the SerialInChk() instruction.
Summary of Contents for CR3000 Micrologger
Page 2: ......
Page 3: ......
Page 4: ......
Page 6: ......
Page 30: ......
Page 34: ......
Page 36: ......
Page 96: ......
Page 485: ...Section 8 Operation 485 8 11 2 Data Display FIGURE 110 Keyboard and Display Displaying Data ...
Page 487: ...Section 8 Operation 487 FIGURE 112 CR1000KD Real Time Custom ...
Page 491: ...Section 8 Operation 491 FIGURE 116 Keyboard and Display File Edit ...
Page 496: ......
Page 502: ......
Page 564: ...Section 11 Glossary 564 FIGURE 126 Relationships of Accuracy Precision and Resolution ...
Page 566: ......
Page 594: ......
Page 598: ......
Page 600: ......
Page 602: ......
Page 624: ......
Page 642: ......
Page 643: ......