Hi,
I need to make the same channel on my controller control two types of motors, according to the user's choice.
For this, I created two virtual motors and a plc that makes the selection between the setups according to a Boolean flag, but it is not working.
Follow the plc:
if (homeInit == 0)
{
if (Gate3[0].Chan[0].Status & $100)
{
Motor[12].ServoCtrl = 0
Motor[12].pDac = Sys.pushm
Motor[11].ServoCtrl = 1
Motor[11].pDac = PowerBrick[0].Chan[0].Pwm[0].a
setup = 1
}
else
{
Motor[11].ServoCtrl = 0
Motor[11].pDac = Sys.pushm
Motor[12].ServoCtrl = 1
Motor[12].pDac = PowerBrick[0].Chan[0].Pwm[0].a
setup = 2
}
homeValue = Gate3[0].Chan[0].Status & $100
homeInit = 1
}