A4: Digital and analog NCK I/Os for SINUMERIK 840D sl
1.2 Access via PLC
Extended Functions
Function Manual, 03/2013, 6FC5397-1BP40-3BA1
53
Reading from PLC-I/Os
The following assumptions are made in this example:
● PLC I/Os:
- log. addr. 420: 16-bit analog input module
- log. addr. 422: 32-bit digital input module
- log. addr. 426: 32-bit DP slave input
- log. addr. 430: 8-bit digital input module
● $A_PBx_IN is used to read in data from a part program into R parameters.
● In order to avoid slowing down the PLC user program unnecessarily (OB1), an update
time (for read access) was configured via MD10398 $MN_PLCIO_IN_UPDATE_TIME so
that an update is only performed in every third interpolation cycle.
Parameter assignment
The machine data should be set as follows:
MD10395 $MN_PLCIO_LOGIC_ADRESS_IN = 420 ; Data is read in from log.
addr. 420 onwards
MD10394 $MN_PLCIO_NUM_BYTES_IN = 11 ;
total of 11 bytes have to be
read in
MD10398 $MN_PLCIO_IN_UPDATE_TIME = 0.03 ; Update time period = 30 ms
(interpolation cycle = 12 ms)
MD10399 $MN_PLCIO_TYPE_REPRESENTATION = 1 ; Data is displayed in big-
endian format
Run-up of NCK and PLC:
The update (for read access) is now performed in every third interpolation cycle after the
NCK and PLC have run up.
Programming
Loading and starting of the part program with the following content:
Program code Comment
...
R1=$A_PBW_IN[0] ; Read in 16-bit integer
R2=$A_PBD_IN[2] ; Read in 32-bit integer
R3=$A_PBR_IN[6] ; Read in 32-bit float
R4=$A_PBB_IN[10] ; Read in 8-bit integer
...