Section 7. Installation
312
—
Example:
Public
SerialInString As String * 25
o
Observe the input string in the input string variable in a numeric
monitor
(p. 547).
Note SerialIn() and SerialInRecord() both receive data. SerialInRecord() is
best for receiving streaming data. SerialIn() is best for receiving discrete
blocks.
4. Parse (split up) the serial string using SplitStr()
o
Separates string into numeric and / or string variables.
o
Example:
SplitStr
(InStringSplit,SerialInString,"",2,0)
o
Declare an array to accept the parsed data.
—
Example:
Public
InStringSplit(2)
As String
—
Example:
Public
SplitResult(2)
As Float
7.7.18.5.3
Serial I/O Output Programming Basics
Applications with the purpose of transmitting data to another device usually
include the following procedures. Other procedures may be required depending on
the application.
1. Open a serial port with SerialOpen() to configure it for communications.
o
Parameters are set according to the requirements of the
communication link and the serial device.
o
Example:
SerialOpen
(Com1,9600,0,0,10000)
o
Designate the correct port in CRBasic.
o
Correctly wire the device to the CR3000.
o
Match the port baud rate to the baud rate of the device in CRBasic.
o
Use a fixed baud rate (rather than auto baud) when possible.
2. Build the output string.
o
Example:
SerialOutString
= "*" & "27.435" & "," & "56.789" & "#"
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: ......