I use a PLC/5 and RSLogix5 software.
How Can I detect a input pulse (I:00/00) with some program-code?
The pulse that I must detect is a false to true and
then from true to false type.
The challenge with input pulses is to determinate how long they remain ON:
1) If they remain ON longer than the time that takes the PLC to complete one program scan, then..too easy! You just read the input in your program like you normally would do with any other digital input.
2) If the pulse stays ON for a period shorter than the time that takes your PLC to complete one program scan, then chances are you will be loosing pulses. This problem can be addressed using 2 kind of interruptions: event interruptions and time interruptions. Even interruptions the most efficient method, because they will execute every time the pulse is detected. Whereas, time interruption will increase your overall program scan time in direct proportion to the number of time the interruption is executed in one program scan time.
I have little experience with AB PLC 5 (years ago), but I still have fresh in my mind have these 2 interruptions where called in the AB SLC family (RXLogix500):
a) STI: time interruption.
b) DII: event interruption.
The part of detecting a pulse raising edge or falling edge can be easily addressed with PLC instruction set or by creating your own edge detection logic (like in the old good days).
In some applications where inductive proximity switches and flags are used to detect speed or position (in lieu of encoders) some people use falling and rising edges to increment the precision by 2). The draw back is that by having twice as much pulses in the same period, problems might develop due to the PLC scan time.
a simple program (in the interruption) will detect the pulse (rising or falling edge)and latch a flag, then ...
As soon as the main program realises that the flag is ON, execute "the control action" required and at the end unlatch the flag (main program) ... then await for the next time the flag is latched again in the interruption.
Thank you for the information Artecerv.
The pulses during On are greater then the program scan.
So I will using a detection edge with a latch function.