M54, M55, M56, M57 (General purpose IO)
Please note that mentioned commands may fail during loading and/or simulation.
To make your macro code avoid these errors please take a look at the manual section Run behavior during loading of job file and simulation
M54 E... Q...
Set PWM output E to permille value Q (0 <= y <= 1000)
Read input. The result is stored in variable #5399
M56 P ... L... Q...
Read digital input P and specify wait mode, the result is stored in variable #5399
- P...: the input number
- L0: do not wait
- L1: Wait for High
- L2: Wait for Low
- Q...: timeout
Note that we use wait (L2) here, in the event of a timeout, the value of #5399 is -1.
Read analog input E, result stored in #5399
Read other inputs using M56
51 – 56 (axis X .. C)
Example: read home-input of X axis:
Read outputs using M57
Read output x, store result in variable #5399
1 to n
Read PWM output, result stored in #5399
If a relay board is used such as RLY8, the IO number P or E is specified like in the following examples:
- value of 103 means card 1 port 3
- value of 208 means card 2 port 8