Hello Guest it is December 15, 2019, 09:10:16 AM

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

0 Members and 1 Guest are viewing this topic.

Offline Mauri

*
  •  306 306
    • 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.