Use of in built timers in Interrupt Service Routine-FATEK FBs Series PLC

If you really need to use an interrupt then use a timed one then use a var as as counter i.e. 100ms count 30 itterations & that becomes your time i.e. 100ms x 30 = 3 secs for 5 secs it becomes 50.
see attached, note I have added an averaging for the analogue during the test so you van see what the average is, I noticed in your code you are using 32767 with no percentage differences for the alarms this will not work as the analogue value will never be that stable this has been a major failure of many posts here as to why it does not work, having an effective = value rarely works as the analogue will vary by a count or more i.e. it can junp from say 32456 to 32458 between scans due to noise or how accurate the conversion is.
 
Those timers have a 0.1s resolution, so there is no need to trigger them to start in the Interrupt Service Routine of an Emergency Switch Interrupt. Move them to a timed interrupt routine as @parky suggests, or even to the continuous scan.

The primary problem is that the X0+I Interrupt Service Routine is called only when the X0 input value transitions from 0 to 1 (rising edge), so the timer instructions in the X0+I Interrupt Service Routine are only evaluated once for each rising edge of X, so unless X0 is changing state at a rate of at least 10Hz, those timers may not get evaluated again if and when they expire.

It would be far simpler to move the timers' branches from that X0+I routine and move them to a continuously-scanned routine with two NO contacts, on M0 (System_Running) and X0, in series. The other advantage would be that the Set instructions for M70 and M71 could be placed near their corresponding Reset instructions, for clarity.
 

Similar Topics

Dear all, what type of built in port does fx2n-80mr plc has? i mean is it rs232, r rs422 or rs485. and which module should i use to convert to...
Replies
5
Views
117
Does anyone have any recommendations for Electronic Circuit Breakers with 0V Terminals built-in and Fieldbus (IO-LINK, MODBUS TCP, EtherNet/IP?)...
Replies
2
Views
193
My PLC (S7-1200) and HMI (KTP-1200 Basic) has been delivered on-site to the customer. To be able to do "off-line" updates to the code, I am using...
Replies
4
Views
224
I am wondering if anyone has seen an input IO block that has a built in AND function for the inputs and the output of the block is a normal M12 5...
Replies
13
Views
888
Hi, My PLC hardware has been delivered to customer site - many thanks for the invaluable help on this forum! I was looking into see if it's...
Replies
12
Views
2,511
Back
Top Bottom