thank you! now it works, it was so easy XD. Btw what AOI means?
AOI = Add-On Instruction
An AOI is a user-defined entity that encapsulates a quantum of logic not available in the basic OEM-defined set of instructions, especially if that logic is required in several separate instances in the same program.
It's roughly analogous to a subroutine in a procedural programming environment.
TL;DR
An AOI usually
- Combines several basic instructions to achieve complex logic specific to the user's process, and
- Is able to be specified multiple times (instances) in one program, with different inputs each time, just like a built-in OEM instruction, and
- Operates on "dummy arguments" as proxies for the inputs and outputs used
Say you had a bank of 30 pumps that required unique but identical logic, involving several steps, for startup. Rather than code those steps 30 times, once for each pump, you might create an AOI with the logic, and then make 30 instances of that logic, each with the inputs and outputs specific to one pump. Note especially the advantage to doing this if a bug is found in the implmentation, or it needs to be updated to handle a new additional input: the logic need be changed only once, in the AOI, not in 30 copies (instances; although any new input would need to be added to the 30 instances).
For example, someone might write an AOI, "MULTI_OR," to perform a logical OR of three or four or more discrete bits; the final operation is no different than combining the inputs in OR-arranged branches, but it would be cleaner on the page and make it easier to read. So if there were a bank of several identical units, instances of this MULTI_OR AOI could be used to identify if
- any of the units are on
- any of the units are in alarm
- any of the units are in maintenance mode
- etc.
Another example would be a scaling AOI for a PLC that does not already have a built-in scaling instruction, or where there needs to be additional logic e.g. non-linear scaling.