1

What I'm trying to achieve is to switch on and off specific I/Os via gcode call. In some motion controllers I worked before, that could be done with an M-command (i.e. M10Pn, where n indicates the pin address).

For example:

  • Move to position X10 Y10
  • Turn on cooling
  • Move to position X0 Y0
  • Turn off cooling

Assuming that the cooling is linked to a dedicated ethercat module, how do I address it? I browsed the beckhoff infosys, and it looks like M commands are the starting point, but I'm not sure how to program them.

Does anyone know where to find an example?

piter123
  • 61
  • 1
  • 3
  • Some updates: M-functions are channel (or axis) specific and can be added by editing the respective SDA parameters. I.e., to add "M50", add msynch[50] and choose the appropriate synchronization. By doing so it will be added, for channel specific functions, to [P-CHAN-00041](https://infosys.beckhoff.com/english.php?content=../content/1033/tf5200_channel_parameter/index.html&id=). Still need to figure out how to fetch it from the plc side – piter123 Nov 30 '21 at 23:50
  • Another update: The whole array of M-Functions is stored in the global variable CNCSystem. I.e., to find out the state of M50 on Channel 0 -> `CNCSystem.Channel[0].M[50]` As it took quite some time and frustration to figure it out, if someone is interested I can explain it better – piter123 Dec 01 '21 at 15:40
  • 1
    if you have the answer to the question you can just write it and mark it as answered. In that case anyone else that will have the same problem/question in the future can find it for future reference. – Jakob Dec 01 '21 at 20:17
  • @Jakob good point. I'll post a full answer as soon as I manage to put it together. – piter123 Dec 03 '21 at 09:34

0 Answers0