Which products are affected?
ESP-DDS2-x (Global Drive PLC Developer Studio V2.x)
What happens?
When compiling a DDS project, one of the following error messages occurs in the message window:
Error 4001: Variable ''xyz' not declared.
or:
Error 4267: A function block request must begin with the name of an instance.
When does the problem occur?
The error messages described above occur if the name of the POU is identical with the name of a variable or a step (SFC = sequential function chart).
The error message 4001 occurs if you access a variable of the program from another POU and if the name of the program is
- identical with the name of a global variable or
- identical with the name of a local variable of the POU or
- identical with the name of a step of the POU.
The error message 4267 occurs if a POU is activated and if the name of this POU is
- identical with the name of a global variable or
- identical with the name of a local variable of the POU to be activated or
- identical with the name of the step of the POU to be activated.
Possible diagnostics?
Verify with the help of the menu item
Project>Global search if the name of the POU is identical with the name of a variable or a step.
Short-term measures/recommendations?
Ensure that the names of POUs, steps, local and global variables are different from each other. Use e. g. the Hungarian Notation (see DDS Online help) to create variable names.
Evaluation:
If the name of a POU is identical with the name of a variable or a step, this might lead to a compiling error. Due to this compiling error, the DDS project cannot be loaded to the PLC target system (e. g. Servo PLC). The menu item Project>Global search can be used to verify where a certain name is used in the DDS project.