Serial sensors are not as easy to handle. The following example of pressure readings
illustrates this issue.
First you have to set up the datalogger‘s ports for communication with a non-PakBus
device.
SerialOpen(Com1,9600,10,0,0)
SerialOpen(Com2,9600,10,0,0)
When the serial open function is executed, the serial ports are "opened" at 9600
baud and subsequent textual messages will flow in and out of the port in between
PakBus packetes. The format parameter "10" specifies the type of error detection
to be used for the exchange of data. "10" equates the manufacturers’ instructions
of an RS232 logic type, even parity, one stop bit and 7 data bits for communication
with Vaisalas PTB210 barometer.
Accordingly serial text messages have to be transmitted through the serial lines for
operating the digital sensors.
SerialOut(Com1,Command,"",0,100)
SerialOut(Com2,Command,"",0,100)
Thus, the as constant defined "Command" is sent to both sensors including the
necessary parameters for operation, ".P", carriage return <cr> and line feed <lf>.
As a result serial data of both sensors in form of pressure readings in hPa is received
within the AirPress-Array as follows:
SerialIn(AirPress(1),Com1,100,10,10)
SerialIn(AirPress(2),Com2,100,10,10)
The acquired information of port configuration and measuring processing can be
brought forward to handle all the other sensors. For details see the appendix section
A on page 79.
48
Commentaires sur ces manuels