hello dear forum,
I want use M6start.ms1 to control MODBUS PLC to change tool in the CNC machine
the macro is as following
-------------------------------------------------
tool = GetSelectedTool()
ActivateSignal(OUTPUT3)
Code "G4 P5"
While IsMoving()
Wend
DeactivateSignal(OUTPUT3) 'Engage Turret holding pin
SetCurrentTool(tool)
SystemWaitFor GetOEMLED(1000)
--------------------------------------------
in the brain control I get an input from MODBUS PLC to OEMLED(1000)
it is activated as you can see in following picture

my question ;
why does not the macro end after seeing the OEMLED (1000 ) is 1 ?
the G-code program doesnot pass beyond the line " M6T04"
I can see the macro running until last line becouse I see OUTPUT3 turn on and off the LED in the MODBUS PLC
please advise
thank you