Siemens SINUMERIK 840Di Function Manual page 1139

Basic machine
Hide thumbs Also See for SINUMERIK 840Di:
Table of Contents

Advertisement

...
END_FUNCTION
Functions
3, 4: Rapid PLC NCK data exchange
General
A separate, internal data area is provided to allow the highspeed exchange of data between
the PLC and NCK. The size of the internal data field is preset to 1024 bytes. The NCK is
accessed (read/written) from the PLC via FC21. The assignment of this area (structure) must
be declared identically in both the NC parts 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 Programming Guide). The concrete address is the
data field is specified by a byte offset (0 to 1023) in parameter IVAR1. In this case, the
alignment must be selected according to the data format, i.e., a Dword starts at a 4byte limit
and a word at a 2byte limit. Bytes can be positioned on any chosen offset within the data
field, singlebit 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. However, 2 byte consistency is only ensured for the data
types Word or Int, 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 1023 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.
Power Line Basic PLC Program (P3)
Function Manual, 08/2005 Edition, 6FC5397-0BP10-0BA0
:=
Funct :=
MB 11,
S7Var :=
#myAny,
IVAR1 :=
1,
IVAR2 :=
0,
Error :=
M 10.1,
ErrCode
MW 12);
:=
Detailed description
2.12 Block descriptions
//Not used
//Channel no.
2-227

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents