Section 7. Installation
325
'Send printable ASCII string out RS-232 port
SerialOut
(ComRS232,OutString,"",0,220)
EndIf
NextScan
EndProg
7.7.18.7 Serial I/O Q & A
Q: I am writing a CR3000 program to transmit a serial command that contains a
null character. The string to transmit is:
CHR(02)+CHR(01)+"CWGT0"+CHR(03)+CHR(00)+CHR(13)+CHR(10)
How does the logger handle the null character?
Is there a way that we can get the logger to send this?
A: Strings created with CRBasic are NULL terminated. Adding strings together
means the second string will start at the first null it finds in the first string.
Use SerialOutBlock() instruction, which lets you send null characters, as shown
below.
SerialOutBlock
(COMRS232, CHR(02) + CHR(01) + "CWGT0" +
CHR(03),8)
SerialOutBlock
(COMRS232, CHR(0),1)
SerialOutBlock
(COMRS232, CHR(13) + CHR(10),2)
Q: Please summarize when the CR3000 powers the RS-232 port. I get that there
is an "always on" setting. How about when there are beacons? Does the
SerialOpen() instruction cause other power cycles?
A: The RS-232 port is left on under the following conditions:
•
When the setting RS-232Power
(p. 589)
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. 90)
because the software
sends information as part of the protocol that lets the CR3000 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
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: ......