6.3.29 Reading (RNP) and writing (WNP) system or user variables
Description
The RNP (Read NC PLC) command can be used to read NC or PLC variables or machine
data.
Programming
Syntax: RNP ("
System or user variable", value
)
Description: Reads NC or PLC variable or machine data
Parameters: System or user varia‐
ble
Name of NC or PLC variable
Value Value that is to be written to the system or user variable.
If the value is a String type, it must be written in double
quotation marks.
Example
VAR2=RNP("$AA_IN[2]") ; Read NC variable
Description
The WNP (Write NC PLC) command can be used to write NC or PLC variables or machine
data.
NC/PLC variables are accessed anew every time the WNP function is executed, i.e., NC/PLC
access is always executed in a CHANGE method. It is advisable to use this option in cases
where a system or user variable changes value frequently. If an NC/PLC variable is to be
accessed only once, then it must be configured in a LOAD or UNLOAD method.
Programming
Syntax: WNP
("System or user variable", value)
Description: Writes NC or PLC variable or machine data
Parameters: System or user variable Name of NC or PLC variable
Value Value that is to be written to the system or user var‐
iable.
If the value is a String type, it must be written in dou‐
ble quotation marks.
Example
WNP("DB20.DBB1",1) ; Write PLC variable
Programming commands
6.3 Functions
SINUMERIK Integrate Run MyScreens (BE2)
172 Programming Manual, 12/2017, 6FC5397-1DP40-6BA1