@benjorni in that case the simplest option would be to use a SAMMYC21 connected to the CAN bus to interface to the welding power source via a RS485 driver. There is sample code for the SAMMYC21 in our Duet3Expansion github repository. You would need to choose a SERCOM-capable port to connect the RS485 driver to.

The modifications to the sample code that you would need are in file src/GPIO/GpioPorts.cpp:

In function HandleM950Gpio, if the specified pin is the MODBUS port, initialise the pin in UART mode. You may also want to send a "welding power off" command at this point. In function HandleGpioWrite, if the port is the MODBUS port, write appropriate data to the UART instead of calling WriteAnalog.

As you want to control three parameters (voltage, current, wire feed speed) you might want to define 3 "pins" that write to the same UART.

In config.g you would use M950 commands to set up the connection to the SAMMYC21, then in the GCode you would use M42 commands to control the parameters.

I have it in mind to add a function similar to M260/M261 that writes to UART instead of I2C. If/when I implement this, it would simplify achieving your objective.