Siemens SINUMERIK 840D sl Function Manual page 42

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

Advertisement

Detailed description
2.2 Functions
Block
number
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 WORD is to be transferred from the PLC to the NC.
The position offset within the NCK 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 (extract)
. . .
CALL FC21 (
Enable :=M10.0,
Funct :=B#16#4,
S7Var :=P#M 104.0 WORD1,
IVAR1 :=04,
IVAR2 :=-1,
Error :=M10.1,
ErrCode :=MW12);
. . .
)
36
If a read/write access is made from the NCK to a variable in the dualport RAM, the
conversion is performed twice. It is impossible to prevent differences between read and
written values because the data are stored in both formats.
Example
Bypassing the problem by means of comparison on "EPSILON" (minor deviation)
Program code
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
Comment
;if TRUE, then FC21 active
Basic logic functions: Various NC/PLC interface signals and functions (A2)
Function Manual, 11/2006, 6FC5397-0BP10-2BA0

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 840di slSinumerik 840dSinumerik 840diSinumerik 810dSinumerik 840d powerlineSinumerik 840de powerline ... Show all

Table of Contents