Packet description – IDEC DS2_Series User Manual

Page 32

Advertising
background image

Instruction manual

DS2 series

31

7.2 Operating mode: DS2 (master) Host Interface (slave)

At powering the DS2 becomes the master and transmits periodically, as previously explained, a
packet at each scanning of the measurement information according to the configuration. The host,
which is the slave, receives the packet and elaborates the data. This is the only case where a
response packet is not necessary.

7.2.1. Packet description

a. Complete binary scanning result (Complete beam status array) - 0x41 (‘A’ ASCII)

Sends to host the pattern with the binary information relative to each beam.

DS2 sends:

0x02

n

0x41

aaa bbb ccc ….. zzz s

0x03

x


where:
n

= 0x0E (600 mm model), 0x14 (900 mm model), 0x1A (1200 mm model), 0x23 (1650 mm

model)

aaa = 3 bytes with information concerning the 01-21 photoelements
bbb = 3 bytes with information concerning the 22-42 photoelements
ccc = 3 bytes with information concerning the 42-63 photoelements
zzz = 3 bytes with information concerning the last 21 photoelements
s

= 1 byte indicating scanning status:

bit 0 = Power LED (0 OFF, 1 ON)
bit 1 = Failure LED (0 OFF, 1 ON)
bit 2 = Output LED (0 OFF, 1 ON)
bit 3 = PNP/NPN output (0 deactivated, 1 active)
bit 4 = Short-circuit output (0 no, 1 yes)
bit 5 = Misaligned photoelements or stability (0 no, 1 si)
bit 6 = N/A.
bit 7 = Programming mode (0 local, 1 remote)


x = checksum (complement to one of the Length, Type and Data field bytes sum)

Example:
Supposing to have the following data range:

0x01 0x02 0x03 0x04 0x05 0x06

the length will be 0x07 (one byte of the Type field plus six bytes of the Data field).
If the packet is a 0x41 type (‘A’ ASCII), then the checksum will be:

checksum = (0x07 + 0x41 + 0x01 + 0x02 + 0x03 + 0x04 + 0x05 + 0x06) XOR 0xFF = 0xA2

The correspondence between the photoelements (21) and the bits of a bytes tern is given below:

first byte

second byte

third byte


The position of one beam can be identified by the weight of the single bits, and the status from its
value from zero or one.
A bit at zero, indicates a non-obscured beam, and a bit at one indicates an obscured beam.

Photoelement

21 20 19 18 17 16 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01

Bytes tern

D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0

Advertising