Working people make mistakes, some people do never make mistakes!
I work to live, my boss thinks I live to work!
Here are the functions i´ve made for outputs and inputs in a plc.
These functions are made for Siemens Step7® plc's. But a translation to another plc is easy.
The easiest way to write a time value is the IEC value T#, a Dword value in mSec.
So i´ve made tree versions of each function. One with the
value´s in the old S5Time and two in the IEC Time. The first
one uses a internal Timer(S5T), the other uses the timer discribed on
the page using SFC64
What are the functions would you say. Well i´ve made one for an output with feedback and runtime function. The other function is for reading an input. This function is very easy, its an independent ON and OFF delay. It uses only one timer.
download awl source (incl. functions.)
Symbol table:
example IO program | FB 2 | FB 2 | Example of IO program functions |
Output (S5T) T# | FC 2001 | FC 2001 | Output function using IEC T# |
Input (S5T) T# | FC 2002 | FC 2002 | Input delay ON and OFF using IEC T# |
Output (S5T#) | FC 2005 | FC 2005 | Output function using S5T# |
Input (S5T#) | FC 2006 | FC 2006 | Input delay ON and OFF using S5T# |
The function using S5T time function with IEC T# input:
The function using S5T time function with S5T# input:
Explanation:
Output: FC 2001/2005: Output function.
Input: |
F_in |
Funtion in. Marker that can be set or reset in a program. (See Step functions)
This indicates that the actuator should perform the function in. (Can
be on a cylinder: in, can be a motor: left turn, can be a spindle:
backwards, can be single actuator: on, etc) |
F_out |
Function out. The opposite of F_in. If you don´t have one you can use the inverted signal of F_in.
F_in and F_out may not be high together! Both low is no problem. |
D_in |
End sensor of the function in. |
D_out |
End sensor of the function out. If you don´t have one you can use the inverted signal of F_in.
D_in and D_out may not be high together! Both low is no problem. |
T_in |
The time that the input has to be high before D_input becomes high. |
T_out |
The time that the input has to be low before D_input becomes low. |
FreeTimer |
A internal timer of the plc. This timer may be used only once! |
Output: |
Y_in |
Output for the function in. |
Y_out |
Output for the function out. |
Runtime_in |
Becomes high if the
end sensor of the in function does not comes high before T_in elapsed.
The action has then taken to long. The output Y_in becomes low. |
Runtime_out |
Output for the function out. |
ENO |
Always high. |
top
Input: FC 2002/2006: Input delay ON and OFF.
Input: |
Input |
The input bit that has to be read. |
Time_on |
The time that the input has to be high before D_input becomes high. |
Time_off |
The time that the input has to be low before D_input becomes low. |
FreeTimer |
A internal timer of the plc. This timer may be used only once! |
In-/Output: |
D_input |
Delay_input. The marker that can be used in the program as delayed input as described above. |
Output: |
ENO |
Same value as D_input. |
top
|