Driver Program For The Plc Control (E.g. Siemens S7-200) - Leuze lumiflex Scan Connecting And Operating Instructions

Leuze lumiflex scan measuring light curtain
Table of Contents

Advertisement

In case of an error/message, the error number determines the contents of the usable
data:
Error numbers 0..30: Usable data (NDT) 1 byte with an indication of the error
Error numbers 31:
STZ:
NDT:
Example:
CRC:
Example of a complete send string:
3.6

Driver Program for the PLC Control (e.g. Siemens S7-200)

An PLC-specific software module is required in order for the control to be able to
accept the measurement data. The program configuration is clearly shown by the
following example of the driver for the Siemens S7-200 control. Based on the
transmission protocol described above, drivers for other controls can be easily created
by any programmer familiar with that particular control. Leuze lumiflex would be happy
to lend support in this regard and is endeavoring to gradually offer drivers for other
well-known controls.
The following example illustrates the program structure of the software module. The
corresponding program listing in STEP7/Micro is available upon request.
The driver program, which functions as an interrupt module, takes over the SCAN
measurement data as a serial data stream at Port 0 and deposits them in a data buffer.
The individual light axis are made available to the user bit-by-bit beginning at memory
position VB20 (1 = light, 0 = no light), continuing from the first light axis (at the SCAN
connection) to the last light axis (at SCAN´s free end).
When a data packet has been successfully received, the driver program sets the
marker „M_Userbuffer_ready". Since this marker can be deleted by the user program
after the measurement values have been read in, it can be used to control the data
receiption.
location (LOC)
Usable data (NDT) max. 250 bytebyte with copyright message
Beam number 1..240
(error/message bit = 0):
only beam data
beam 1: LSBit byte1 ... beam 240: MSBit byte30 in block
x: 0 = beam interrupted , 1 = beam unobstructed
STZ = 35: --> 5 bytes of beam data
NDT = xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 00000xxx
8 Bit CRC with generator polynomial 19B hex.
The CRC sum is arrived at by means of STK, LDP, STA, STZ, NDT.
64-beam unit,
beams 1..10 no reception,
eams 40..50 weak reception,
object in the measurement field,
no error:
0BH, 0DH, 0CH, 40H, 00H, FCH, FFH, FFH, FFH, FFH, FFH, FFH, 58H
SCAN
9

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents