UCCNC MODBUS MACROS.
Posted: Mon Jul 11, 2022 10:10 pm
// Check CW and CCW LEDs, start or stop the spindle based on LED states.
// After exiting this macro the Modbus register is set up for CW, CCW or Stop
//
if ( AS3.GetLED(50) == true ) // If the RUN CW LED is active
{
exec.SetModbusregister(SpindleRunReg, RunSpindleCW); //Turn spindle on in CW rotation if LED is on
}
else
if ( AS3.GetLED(51) == true ) // If the RUN CCW LED is active
{
exec.SetModbusregister(SpindleRunReg, RunSpindleCCW); //Turn spindle on in CCW rotation if LED is on
}
else // CW and CCW LEDs are off, send turn spindle OFF commnad
{
exec.SetModbusregister(SpindleRunReg, StopSpindleRun); // Send Rexroth EFC5610 STOP command to VFD
}
// ----------------------------------------------------------------------------------------------------
In this code snippet " if ( AS3.GetLED(51) == true ) // If the RUN CCW LED is active
{
blah blah
}
else
{
blah blah
}
not working but
" blah blah "
without if statement works perfectly fine.
please help. Thanks in advance.
// After exiting this macro the Modbus register is set up for CW, CCW or Stop
//
if ( AS3.GetLED(50) == true ) // If the RUN CW LED is active
{
exec.SetModbusregister(SpindleRunReg, RunSpindleCW); //Turn spindle on in CW rotation if LED is on
}
else
if ( AS3.GetLED(51) == true ) // If the RUN CCW LED is active
{
exec.SetModbusregister(SpindleRunReg, RunSpindleCCW); //Turn spindle on in CCW rotation if LED is on
}
else // CW and CCW LEDs are off, send turn spindle OFF commnad
{
exec.SetModbusregister(SpindleRunReg, StopSpindleRun); // Send Rexroth EFC5610 STOP command to VFD
}
// ----------------------------------------------------------------------------------------------------
In this code snippet " if ( AS3.GetLED(51) == true ) // If the RUN CCW LED is active
{
blah blah
}
else
{
blah blah
}
not working but
" blah blah "
without if statement works perfectly fine.
please help. Thanks in advance.