Description
Leuze
electronic
12
ODS 96
Leuze electronic
ODS 96 M/D has a digital output which is realized either through the RS 232
or the RS 485 interface. The transmission rate is 9600 baud at the RS 232
interface and 9600 baud without termination at the RS 485 interface.
A "C" program example demonstrates how bytes are read and processed for
further usage:
Program example in "C"
//Start of the program for measurement value generation-------------------------------
Rxbyte = inportb(RXB(COM2.port_adr)); //Read transmitted byte
if (flag==0)
//First byte has to be a
//Low-Byte
{
if ((Rxbyte & 0x01) == 0)
//Test on Low-Byte
{
value = (Rxbyte & 0xFE) >> 1; //Insert measurement value
//point-aligned
flag = 1;
//Next received
//byte has to be a
//High-Byte
}
}
else
{
if ((Rxbyte & 0x01) == 1)
//Test on High-Byte
{
value|=((Rxbyte&0xFE) << 6); //Insert point-aligned in
//measurement value
flag = 0;
//14 Bit measurement value
//is generated
measurement value = value; //Save measurement value
}
}
// End of program of measurement value generation--------------------------------------
The behavior of the switching output of the ODS M/D can be set as described
with the ODS 96 M/V. However, the ODS 96 M/D type with RS 485 interface
does not offer a teach input.