Hi
I am looking for function to calculate runtime for motor, signal ..... in specific period of time
for CPU 300
thanx
[?] runtime totalizing
-
- Posts: 5
- Joined: Tue Apr 27, 2010 7:33 pm
Re: [?] runtime totalizing
FB31
Show
Code: Select all
FUNCTION_BLOCK FB31
TITLE ='MOTOR_WORK_HOUR'
VERSION : 0.1
VAR_INPUT
RUNNIG : BOOL ; //MOTOR RUNING
CYCLE_TIME : REAL ; //OB35 CYCLE TIME AS milisecond
RESET : BOOL ; //RESET MOTOR WORKING TIME
END_VAR
VAR_OUTPUT
WORK_TIME : REAL ; //MOTOR WORKING TIME AS HOUR
END_VAR
VAR
ADDED : REAL ;
END_VAR
VAR_TEMP
CYCLE_RATIO : REAL ;
END_VAR
BEGIN
NETWORK
TITLE =
L 3.600000e+006;
L #CYCLE_TIME;
/R ;
T #CYCLE_RATIO;
NOP 0;
NETWORK
TITLE =
A #RUNNIG;
AN #RESET;
JNB _001;
L 1.000000e+000;
L #ADDED;
+R ;
T #ADDED;
_001: NOP 0;
NETWORK
TITLE =
A #RUNNIG;
AN #RESET;
JNB _002;
L #ADDED;
L #CYCLE_RATIO;
/R ;
T #WORK_TIME;
_002: NOP 0;
NETWORK
TITLE =
A #RESET;
= L 4.0;
A L 4.0;
JNB _003;
L 0.000000e+000;
T #WORK_TIME;
_003: NOP 0;
A L 4.0;
JNB _004;
L 0.000000e+000;
T #ADDED;
_004: NOP 0;
END_FUNCTION_BLOCK
-
- Posts: 61
- Joined: Thu Mar 19, 2009 11:00 am
- Location: Sudan
Re: [?] runtime totalizing
thank you FLiMBO
I will check and give feedback
I will check and give feedback
-
- Posts: 61
- Joined: Thu Mar 19, 2009 11:00 am
- Location: Sudan
Re: [?] runtime totalizing
work like a charm
simple and perfect
I appreciate your help
simple and perfect
I appreciate your help
-
- Posts: 122
- Joined: Fri Aug 11, 2006 6:16 pm
- Location: Russia, Komi
-
- Posts: 32
- Joined: Fri Oct 03, 2008 2:17 am
- Location: America
Re: [?] runtime totalizing
Hello,
another way to measure time is shown here:
for TIA V11
http://support.automation.siemens.com/W ... reecontent
and here for step7 v5.5
http://support.automation.siemens.com/N ... reecontent
and also you can see here:
viewtopic.php?f=1&t=19300
greetings
another way to measure time is shown here:
for TIA V11
http://support.automation.siemens.com/W ... reecontent
and here for step7 v5.5
http://support.automation.siemens.com/N ... reecontent
and also you can see here:
viewtopic.php?f=1&t=19300
greetings