As you say, I give the command to the pin but it don't turn off on layer change, it works on manual command but not from gcode. If you need more information I can give more details about the machine and my changes of Marlin.
Thanks
Thanks