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
Digital outputs
Set output - M54 P...
The P word must be between 1 and 10 where 1 is AUX1 and 10 is AUX10.
If the connected controller only has one AUX output, 2 is mapped to FLOOD and 3 to MIST.
Clear output - M55 P...
Clear output. The P word must be between 1 and 10 where 1 is AUX1 and 10 is AUX10.
If the connected controller only has one AUX output, 2 is mapped to FLOOD and 3 to MIST.
Read outputs - M57 P
Read output x, store the result in variable #5399
Output | P value |
|---|---|
AUX1-AUXn | 1 to n |
Machine On | 51 |
Drive Enable | 52 |
Coolant1 (Flood) | 61 |
Coolant2 (Mist) | 62 |
Tool | 63 |
Tool direction | 64 |
Digital inputs
Read input - M56 P...
P value | Input |
|---|---|
51 - 56 | Home Inputs X-C |
61 | Probe Input |
62 | Sync Input |
63 | HWA Input |
64 | HWB Input |
65 | ESTOP1 |
66 | ESTOP2 |
67 | EXTERR |
68 | PAUSE |
The result is stored in variable #5399
Example: erad AUX input 3:
Example: read home-input of X axis:
Read input + wait - 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 (seconds)
Note that we use wait (L2) here, in the event of a timeout, the value of #5399 is -1.
In order to make this code simulation and rendering proof we need to extend it like this:
Analog inputs
Read analog input - M56 E…
Read analog input E, result stored in #5399
PWM
Set PWM - M54 E... Q...
Set PWM output E to permille value Q (0 <= y <= 1000)
Read PWM output - M57 E...
Read PWM output, result stored in #5399
Optional IOCARD
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