Section 7. Installation
287
o
Is power consumption critical?
o
Does the sensor compute a checksum? Which type? A checksum is
useful to test for data corruption.
2. Open a serial port with
SerialOpen()
.
o
Example:
SerialOpen(Com1,9600,0,0,10000)
o
Designate the correct port in CRBasic.
o
Correctly wire the device to the CR800.
o
Match the port baud rate to the baud rate of the device in CRBasic
(use a fixed baud rate — rather than autobaud — when possible).
3. Receive serial data as a string with
SerialIn()
or
SerialInRecord()
.
—
Example:
SerialInRecord
(Com2,SerialInString,42,0,35,"",01)
o
Declare the string variable large enough to accept the string.
—
Example:
Public
SerialInString As String * 25
o
Observe the input string in the input string variable in a
numeric
monitor
(p. 506).
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
Содержание CR800 Series
Страница 2: ......
Страница 4: ......
Страница 6: ......
Страница 32: ......
Страница 34: ......
Страница 54: ......
Страница 92: ......
Страница 190: ...Section 7 Installation 190 FIGURE 40 Running Average Frequency Response FIGURE 41 Running Average Signal Attenuation ...
Страница 310: ......
Страница 446: ...Section 8 Operation 446 8 11 2 Data Display FIGURE 100 CR1000KD Displaying Data ...
Страница 448: ...Section 8 Operation 448 FIGURE 102 CR1000KD Real Time Custom ...
Страница 449: ...Section 8 Operation 449 8 11 2 3 Final Storage Data FIGURE 103 CR1000KD Final Storage Data ...
Страница 450: ...Section 8 Operation 450 8 11 3 Run Stop Program FIGURE 104 CR1000KD Run Stop Program ...
Страница 452: ...Section 8 Operation 452 FIGURE 106 CR1000KD File Edit ...
Страница 456: ......
Страница 462: ......
Страница 523: ...Section 11 Glossary 523 FIGURE 116 Relationships of Accuracy Precision and Resolution ...
Страница 524: ......
Страница 526: ......
Страница 556: ......
Страница 558: ......
Страница 560: ......
Страница 597: ......