AxUnit: How to run a specified number of PLC cycles

0
I want to unittest a class that is using a timer in AX. When 5 PLC-cycles have passed the timer should output high (onDelay). In TIA Portal Test Suite, the function 'Run(TIME := t#5s)' is used for this purpose. What can be used in AX?
asked
1 answers
0

You could simulate the PLC cycles by calling the method multiple times in your test, since each call can represent one PLC cycle. For example, if the timer should trigger after 5 cycles, you could run the logic in a small loop and then assert the output.


Another option could be mocking or controlling the timer input/time source in your test, so you can simulate the elapsed time instead of waiting for real PLC cycles.


If this helps resolve the issue, please close the topic.


answered