Fb3: Put - Write Nc Variables - Siemens SINUMERIK 840D sl Function Manual

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

Advertisement

P3: Basic PLC program for SINUMERIK 840D sl
13.17 Block descriptions
Example
For example, to be able to read an NC variable of the type DOUBLE without adapting the
format, an ANY pointer with REAL2 type must be specified in the destination area "RDx" (e.g.:
P#M100.0 REAL2). If the basic program recognizes REAL2 as the target type when reading
a variable of the DOUBLE type, the data is transferred to the PLC data area as a 64-bit floating-
point number.
13.17.3

FB3: PUT - write NC variables

Function
The FB3 "PUT" function block is used to write variables from the NC area.
In order to reference the NC variables, they are first selected with the "NC VAR selector" tool
and generated as STL source in a data block. A name must then be assigned to this data block
in the S7 symbol table. When calling FB3, the variable addresses are transferred in the
following form: Parameter "Addr1" to "Addr8" = "<DB name>".<S7 name>
Request for writing NC variables
Call of FB3 with positive edge change, parameter "Req" = 0 → 1
S7 names of the NC variables: Parameter "Addr1" to "Addr8" = "NCVAR".<S7 name>"
Pointer for writing the variable values: Parameters "RD1" to "RD8" = "P#<Address>"
Completion of the write request
Write request successfully completed: Parameter "Done" == 1.
Write request with error completed:"Parameter "Error" == 1, error cause in parameter "State"
Prerequisites
● Release of the NC/PLC communication by OB100, FB1 parameter "NCKomm" = 1
● For the data block DB120 (data interface), the S7 Symbol Editor must be used to assign a
symbol (default: NCVAR) in the S7 symbol table of the S7 project. Via this symbol, the NC
variable is then specified in the FB3 parameters "Addr<x>", e.g. "ADDR1":= "NCVAR".<NC-
Variable>"
General conditions
● FB3 has multi-instance capability.
● Every call of FB3 must be assigned a separate instance DB from the user area.
● In order to define machine data and GUD without a password, the protection level of the
data you want to access must be redefined to the lowest level.
References:
– Commissioning Manual; Section: "Protection levels concept"
– Programming Manual, Job Planning; Section: "Define protection levels for user data"
● When channel-specific variables are written, only variables from exactly one channel may
be addressed via "Addr1" to "Addr8" if FB2 is called.
930
Function Manual, 01/2015, 6FC5397-0BP40-5BA2
Basic Functions

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinumerik 828dSinumerik 840de sl

Table of Contents