ExampleFor example, to be able to read an NC variable of the type DOUBLE without adapting theformat, 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 readinga 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 variablesFunctionThe 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" tooland generated as STL source in a data block. A name must then be assigned to this data blockin the S7 symbol table. When calling FB3, the variable addresses are transferred in thefollowing form: Parameter "Addr1" to "Addr8" = "".Request for writing NC variablesCall of FB3 with positive edge change, parameter "Req" = 0 → 1S7 names of the NC variables: Parameter "Addr1" to "Addr8" = "NCVAR"."Pointer for writing the variable values: Parameters "RD1" to "RD8" = "P#"Completion of the write requestWrite 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 asymbol (default: NCVAR) in the S7 symbol table of the S7 project. Via this symbol, the NCvariable is then specified in the FB3 parameters "Addr", e.g. "ADDR1":= "NCVAR".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 thedata 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 maybe addressed via "Addr1" to "Addr8" if FB2 is called.P3: Basic PLC program for SINUMERIK 840D sl13.17 Block descriptionsBasic Functions930 Function Manual, 01/2015, 6FC5397-0BP40-5BA2 PreviousNext |