Siemens SINUMERIK 828D Function Manual page 1048

Hide thumbs Also See for SINUMERIK 828D:
Table of Contents

Advertisement

P3: Basic PLC Program for SINUMERIK 840D sl
13.13 Block descriptions
General
A separate, internal data area is provided to allow the high­speed exchange of data between the PLC and NCK.
The size of the internal data field is preset to 4096 bytes. The accesses (read/write) from PLC take place via the
FC 21. The occupation of this range (structure) must be defined identically in the NC part program and the PLC
user program.
These data can be accessed from the NC parts program by commands $A_DBB[x], $A_DBW[x], $A_DBD[x],
$A_DBR[x] (see Parameter Manual System variables).
The concrete address is the data field is specified by a byte offset (0 to 4095) in parameter IVAR1. In this case,
the alignment must be selected according to the data format, i.e. a Dword starts at a 4­byte limit and a word at a
2­byte limit. Bytes can be positioned on any chosen offset within the data field, single­bit access operations are
not supported and converted to a byte access operation by FC 21. Data type information and quantity of data are
taken from the ANY parameter, transferred via S7Var.
Without additional programming actions, data consistency is only ensured for 1 and 2 byte access in the NCK
and in the PLC. For the 2-byte consistency this is true only for the data type WORD or INT, but not for the data
type BYTE.
In the case of longer data types or transfer of fields, which should be transferred consistently, a semaphore byte
must be programmed in parameter IVAR2 that can be used by FC 21 to determine the validity or consistency of a
block. This handling must be supported by the NC, i.e. in the part program, by writing or deleting the semaphore
byte. The semaphore byte is stored in the same data field as the actual user data.
The semaphore byte is identified by a value between 0 and 4095 in IVAR2.
The PLC reads and describes the semaphore byte via FC 21 in the same call, which should transfer the user
data. The PLC programmer only needs to set up a semaphore variable. For access from the NC via the parts
program, the semaphore feature must be programmed using individual instructions according to the flow chart
shown below. The sequence is different for reading and writing variables.
Only individual variables or ARRAYs can be supported directly by the semaphore technique. Structure transfers
must be subdivided into individual jobs. The user must ensure data consistency of this structure by programming
a semaphore system.
If IVAR2 is set to -1, data are transferred without a semaphore.
Basic Functions
1048
Function Manual, 09/2011, 6FC5397-0BP40-2BA0

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840d sl

Table of Contents