Siemens SINUMERIK 840D sl Function Manual page 59

Hide thumbs Also See for SINUMERIK 840D sl:
Table of Contents

Advertisement

● The user's programming engineer is responsible for coordinating access operations to the
communications buffer from different channels.
● Data consistency can be guaranteed only for access operations up to 16 bits (byte and
word). The user is solely responsible for ensuring consistent transmission of 32-bit variables
(double and real). A simple semaphore mechanism is available in the PLC for this purpose.
● The PLC stores data in 'Little Endian' format in the DPR.
● Values transferred with $A_DBR are subject to data conversion and hence to loss of
accuracy. The data format for floating-point numbers is DOUBLE (64 bits) in the NC, but
only FLOAT (32 bits) in the PLC. The format used for storage in the dual-port RAM is
FLOAT. Conversion takes place respectively before/after storage in the dual-port RAM.
If a read/write access is made from the NC to a variable in the dual-port RAM, the conversion
is performed twice. It is impossible to prevent differences between read and written values
because the data is stored in both formats.
Example
Bypassing the problem by means of comparison on "EPSILON" (minor deviation)
Program code
N10
N12
N20
N30
N40
N50
N60
N70
N80
N90
N99
Activation
The maximum number of simultaneously writable output variables is adjustable via:
MD28150 $MC_MM_NUM_VDIVAR_ELEMENTS (number of elements for writing PLC
variables)
Example
A variable of type WORD is to be transferred from the PLC to the NC.
The position offset within the NC input (PLC output area) should be the fourth byte. The position
offset must be a whole-number multiple of the data width.
Writing from PLC:
Program code
. . .
CALL FC21 (
Enable
Basic Functions
Function Manual, 01/2015, 6FC5397-0BP40-5BA2
DEF REAL DBR
DEF REAL EPSILON = 0.00001
$A_DBR[0]=145.145
G4 F2
STOPRE
DBR=$A_DBR[0]
IF ( ABS(DBR/145.145-1.0) < EPSILON ) GOTOF ENDE
MSG ( "error" )
M0
END:
M30
:=M10.0,
A2: Various NC/PLC interface signals and functions
Comment
; if TRUE, then FC21 active
2.3 Functions
59

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 828dSinumerik 840de sl

Table of Contents