Hi Tweakie
Thanks for the speedy reply. The controller's analog output is 0 to 10V PWM, and the digital output is 24V. The laser have 2 inputs. Input one is labeled 5V TTL and input two is just labeled TTL and that one can use PWM to 24V. On the 5V input I connected a 4K2 resistor. That is the only two inputs on the laser. On another controller output I connected a solid state relay for the power supply, and is currently connected on the flood output. If i switch the laser's power supply on it takes about 3 seconds to stabilize. So I cannot use it to switch the laser on with the long delay. If I switch the power supply manually and I use the M62/63 P1 commands to activate the laser everything works perfectly but I can only cut. I know there must be a way to manually set the analog register's value in a M command but I am running in circles. I tried the following code but now I'm stuck.
function M200()
local inst = mc.mcGetInstance()
local hreg = mc.mcRegGetHandle(inst, "CSMIO-IP/Analog Output 0");
regvalue = 5;
mc.mcRegSetValue(hreg, regvalue)
end
if(mc.mcInEditor() == 1) then
-- If you are in the mcLua editor, this will cause your script to execute if you Run or Debug
-- Make sure your Capitalization and numbers match that of the function you are calling
M200()
end
Any thoughts?
Thanks
Johan