Question:
Why is there an incorrect value in a code of a Servo PLC or Drive PC, which was set via AIF interface?
Answer:
The system task of the PLC sets the data to a code Byte by Byte. If the system task was interrupted during code setting (the code's type > one Byte), the code could have an incorrect value for one or several program cycles.
If the user program is supposed to react on a modified code, a semaphore will be useful. For this purpose after code setting an auxiliary code is set to value 1, so that the receiver can see that the data were modified. The content of the original code can now be read out safely, and the auxiliary code will then be set to 0 by the receiver.
Another remedial measure is using a scale function - on condition that the code variable is no global variable:
If the value of a code modifies, the values of the related variable will modify, too. With each code setting a scale function, which is created by the user and linked to the variable, can be restarted.
Generating a scale function:
- Open the Object Organizer, tab Organization units and select the function block you want to assign a scale function to.
- Select ProjectAdd scale function to open the dialog box Add scale function.
- Open the dialog box Add scale function to select the programming language and the associated variable. The name of the scale function will be assigned automatically ('SCAL_' + name of the variable).
- Use the button Add to add the scale function or Close to cancel the process and close the dialog box.
The scale function is added underneath the associated FB in the Object Organizer. Double-click the scale function in the editor to open and program it.