Frequently, most sensors do not require constant monitoring during continuous program operation, for example, at idle transitions or at the time of stopping or inactivity of equipment. But the tasks at certain points of the equipment operation, which require quick reaction on the selected sensor. In such cases, the fastest method of processing will be to enable the trigger and assign it to the required controller input with enabling automatic tracking of the change in the state of the signal level at the selected input, and when the state changes in the right direction (from “0” to “1” or “ 1 “in” 0 ”) to perform the necessary actions. The trigger as a function is faster than the usual input processing inside the plc procedure. A striking example of the work of the trigger is the work of the sensor “arc response” on plasma cutting. The state of this sensor requires constant processing only during the operation of the plasma source, in the cutting process. When the plasma source is turned off (i.e., at idle transitions or in the process of waiting), tracking of the sensor is not required. Therefore, the response of the sensor during the waiting time should be ignored, but during the cutting process, the response to the sensor should be as fast as possible.Therefore, this sensor is most convenient to handle using a trigger.
myCNC software supports up to 4 Triggers.
Main window:
Basic functions:
Arc ON signal from Plasma power source represents current Plasma Arc state. Running program should be stopped if the signal failed during cutting. The signal Falling during “no cutting” operation should be ignored. A solution is to set up “Arc ON” input, falling edge as Trigger, Enable the trigger just after piercing operation in M71/M03 PLC procedures and disable it in M74/M05 PLC procedures just before OFF plasma power source.
#define relay_PLAZMA_ON 2 #define input_ARC_READY 5 main() { timer=0; portset (relay_PLAZMA_ON); timer=timeout_plasma_ready; //wait till plasma arc ready timer=5000; do { timer--; a=portget(input_ARC_READY); if (a!=0) { timer=0; }; }while(timer>0); //pause a=portget(input_ARC_READY); //doublecheck arc sensor if (a==0) { message=PLCCMD_TRIGGER1_ON; timer=3;do{timer--;}while(timer>0); } else { portclr(relay_PLAZMA_ON); exit(plc_exit_plasma_fail); }; exit(99); };
#define relay_PLAZMA_ON 2
#define input_ARC_READY 5
timer=0;
portset (relay_PLAZMA_ON);
timer=5000; do { timer--; a=portget(input_ARC_READY); if (a!=0) { timer=0; }; }while(timer>0); //pause
a=portget(input_ARC_READY); //doublecheck arc sensor if (a==0) { message=PLCCMD_TRIGGER1_ON; timer=3;do{timer--;}while(timer>0); }
else { portclr(relay_PLAZMA_ON); exit(plc_exit_plasma_fail); };
#define relay_PLAZMA_ON 2 #define input_ARC_READY 5 main() { timer=0; portclr (relay_PLAZMA_ON); message=PLCCMD_TRIGGER1_OFF; timer=3;do{timer--;}while(timer>0); exit(99); };
#define relay_PLAZMA_ON 2
#define input_ARC_READY 5
timer=0;
portclr (relay_PLAZMA_ON);
message=PLCCMD_TRIGGER1_OFF; timer=3;do{timer--;}while(timer>0);