Hello Guest it is April 18, 2024, 07:09:40 AM

Author Topic: CV On/Off Button  (Read 1182 times)

0 Members and 1 Guest are viewing this topic.

Offline Mauri

*
  •  328 328
    • View Profile
CV On/Off Button
« on: January 21, 2017, 04:28:44 PM »
Hi,
I am trying to make a CV On/Off button but it does not seem to work?

PLC code
local cvState =  mc.mcMotionGetCVAngleEnable(inst)
if (cvState == 1) then
        mc.mcMotionSetCVAngleEnable(inst,1)  -- Turns CV On
    else
        mc.mcMotionSetCVAngleEnable(inst,0)  -- Turns CV Off
end

Toggle ON and OFF button code
Down Script
mc.mcMotionSetCVAngleEnable(inst,1)  -- Turns CV On
Up Script
mc.mcMotionSetCVAngleEnable(inst,0)  -- Turns CV Off

Can anyone assist in making this work?

Regards,
Mauri.