Fb2: Get - Read Nc Variable - 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
13.17.2

FB2: GET - read NC variable

Function
The FB2 "GET" function block is used to read 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 FB2, the variable addresses are transferred in the
following form: Parameter "Addr1" to "Addr8" = "<DB name>.<S7 name>"
Request for reading NC variables
Call of FB2 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 read request
Read request successfully completed: Parameter "Done" == 1.
Read request completed with error:"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 FB2 parameters "Addr<x>", e.g. "ADDR1: = "NCVAR".<NC
variable>"
General conditions
● FB2 has multi-instance capability.
● Every call of FB2 must be assigned a separate instance DB from the user area.
● When channel-specific variables are read, only variables from exactly one channel may be
addressed via "Addr1" to "Addr8" if FB2 is called.
● When drive-specific variables are read, only variables from exactly one SERVO drive object
may be addressed via "Addr1" to "Addr8" if FB2 is called. The SERVO drive object must
be assigned to a machine axis of the NC. The line index corresponds to the logical drive
number.
● In a read job, only variables from the same area, channel, or drive object can be read.
Note
Error case
When reading variables from different channels or drive objects, or simultaneously from a
channel and a drive object, an error message is output:
● "Error" == TRUE
● "State" == W#16#02
922
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