6 Programming
6-16
NJ-series CPU Unit Software User’s Manual (W501)
You can access the input and output variables of a function block from outside the function block. Vari-
ables are written as follows:
InstanceName.VariableName
Example: To Access Output Variable B of Function Block Instance FB1_Instance
FB1_Instance.B
You can access the input and output variables for a function block only within the program that contains
the function block. However, you cannot access these variables from within other function block
instances even if they are in the same program. You cannot access them from other programs.
The in-out variables, and input variables for some instructions, cannot be accessed from external
devices.
Refer to the NJ-series Instructions Reference Manual (Cat. No. W502) for details.
Accessing Variables in a Function Block from Outside the Function
Block
F
B1
A
B
F
B1_Instance
F
B2
C
D
F
B2_Instance
F
B2_Instance.B
F
B1_Instance.B
Can be accessed.
Input and Output Variables for FB1
• Access is possible only from within program P1.
• Access is not possible from program P2.
• Access is not possible from within FB2.
Program P1
Program P2
Cannot be
accessed.
Cannot be
accessed.