Section 7. Installation
288
7.7.17.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 CR800.
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" & "#"
o
Tip — concatenate (add) strings together using & instead of +.
o
Tip — use
CHR()
instruction to insert ASCII / ANSI characters into
a string.
3. Output string via the serial port (
SerialOut()
or
SerialOutBlock()
command).
o
Example:
SerialOut
(Com1,SerialOutString,"",0,100)
o
Declare the output string variable large enough to hold the entire
concatenation.
o
Example:
Public
SerialOutString
As String
* 100
•
SerialOut()
and
SerialOutBlock()
output the same data, except that
SerialOutBlock()
transmits null values while
SerialOut()
strings are
terminated by a null value.
Содержание 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: ......