Section 7. Installation
SerialInRecord()
2
•
Can run in pipeline mode inside the digital measurement task (along with
SDM instructions) if the
COMPort
parameter is set to a constant argument
such as
COM1
,
COM2
,
COM3
, or
COM4
, and the number of bytes is also
entered as a constant.
•
Simplifies synchronization with one way.
•
Simplifies working with protocols that send a "record" of data with known
start and/or end characters, or a fixed number of records in response to a poll
command.
•
If a start and end word is not present, then a time gap is the only remaining
separator of records. Using
COM1
,
COM2
,
COM3
, or
COM4
coincidentally detects a time gap of >100 bits if the records are less than 256
bytes.
•
Buffer size margin (one extra one byte).
1
Processing instructions
2
Measurement instruction in the pipeline mode
3
Measurement instruction if expression evaluates to a constant
7.9.17.5.2 Serial I/O Input Programming Basics
Applications with the purpose of receiving data from another device usually
include the following procedures. Other procedures may be required depending on
the application.
1. Know what the sensor supports and exactly what the data are. Most sensors
work well with TTL voltage levels and RS-232 logic. Some things to
consider:
o
Become thoroughly familiar with the data to be captured.
o
Can the sensor be polled?
o
Does the sensor send data on its own schedule?
o
Are there markers at the beginning or end of data? Markers are very
useful for identifying a variable length record.
o
Does the record have a delimiter character such as a comma, space, or
tab? Delimiters are useful for parsing the received serial string into
usable numbers.
o
Will the sensor be sending multiple data strings? Multiple strings usually
require filtering before parsing.
o
How fast will data be sent to the CR1000?
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 CR1000.
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).
251
Содержание CR1000
Страница 2: ......
Страница 4: ......
Страница 6: ......
Страница 32: ......
Страница 36: ......
Страница 38: ......
Страница 40: ......
Страница 60: ...Section 4 System Quickstart Figure 16 PC200W View Line Graph 60 ...
Страница 96: ......
Страница 98: ...98 ...
Страница 302: ......
Страница 350: ...Section 8 Operation Figure 91 Pulse Sensor Output Signal Types Figure 92 Switch Closure Pulse Sensor 350 ...
Страница 453: ...Section 8 Operation Figure 115 Using the Keyboard Display 453 ...
Страница 454: ...Section 8 Operation 8 8 1 Data Display Figure 116 Displaying Data with the Keyboard Display 454 ...
Страница 456: ...Section 8 Operation Figure 118 Real Time Custom 456 ...
Страница 457: ...Section 8 Operation 8 8 1 3 Final Memory Tables Figure 119 Final Memory Tables 457 ...
Страница 458: ...Section 8 Operation 8 8 2 Run Stop Program Figure 120 Run Stop Program 458 ...
Страница 460: ...Section 8 Operation Figure 122 File Edit 460 ...
Страница 461: ...Section 8 Operation 8 8 4 PCCard Memory Card Display Figure 123 PCCard CF Card Display 461 ...
Страница 478: ......
Страница 506: ......
Страница 536: ......
Страница 636: ......
Страница 642: ......
Страница 644: ......
Страница 676: ......
Страница 677: ......