counting on ladder

axxxxxx

Member
Join Date
Nov 2005
Location
Salonika
Posts
4
how can i count on ladder?
i want to count how many time an output is active/on/set (in hours/mins/secs)
if i have 2 outputs can i compare which was "active" for the longest time?

i use the windldr program, but it doesnt matter. i just want the main idea

thank you very much
 
Do you want to count or time? Your post does not make it clear. If you want to time how long an item has been on for in total, then put an examine on contact of your output to a retentive timer. You would then need to reset the timer with something, a reset pushbutton or similar.
 
Here's some pseudo code that should be easy to code in ladder.

Assume bSample is true once per scan every 100ms. di... are 32 bit integer variables.
If bSample AND bOutput1 then diOutput1On=diOutput1On + 1
If bSample AND bOutput2 then diOutput2On=diOutput2On + 1
If bResetTime then diOutput1On=0
If bResetTime then diOutput2On=0
diOnTime1InSecs=diOutput1On/10
diOnTime2inSecs=diOutput2On/10
 
I want to know how many time the output will be on.
I dont know how to make it more clear
I tried to use a counter, but it accepts inputs (1, 2, 3 etc)
I tried to use timer, but you have to give him a time, to start a countdown

Is there anything that when I will give it a signal it will start count time normally?
 
How about...

LD Input 'This is your trigger
AND P_1s 'This is the PLC 1 second pulse bit
OUT @INC D1 'This is an Increment instruction that will increase the value of address D0 by 1 every second that the input is on.
Extropolate the value of D0 to give you Hrs. Min. and Sec.

Hope this helps.

By the way, what PLC are you using? (the above is based upon Omron, but the theory should be applicable to most PLC types)
 
I use the microsmart plc by idec
ever heart it?
i will try to find which are the:
LD Input, AND P_1s and OUT @INC D1 in my plc :p
 
A simple idea was as stated, use the Output with an examine On bit.

ouput on timer done Timer1
|-----[ ]-----[/]--------------|60secs|--|
| timer done counter done Counter1
|-----[ ]-----[/]--------------| 60 |--|



This may have to be adjusted for the plc but when the output is on it turns on the timer with a preset of 60 secs, each time the timer counts to 60 it adds one to the counter and resets itself to restart the count. This will give you the number of minutes it is on, another counter driven from the first counter can give you hours.
 
Hej

Time_Count.JPG


Jesper
 
i have use the windldr b4. u can use special relay m8121(1 sec clock) for ur condition.
output1 M8121
|-||------------||------[SOT]---------[INC D0]
|output2 M8121
|-||------------||-------[SOT]--------[INC D1]
|M8000
|-||-+----------[CMP> D0 D1 M1]
| |__________[CMP> D1 D0 M2]
|
hope it may help. the plc that i used was opennet + interbus master module to link with wago remote i/o. i also have been using omron, misthubishi,delta,siemens plc b4. if hav any Q. pls mail me.
 

Similar Topics

Hello, I am in need of a solution to a problem I've failed to come up with a solution to that doesn't take entirely too long for my needs. I...
Replies
40
Views
15,787
I'm working with a TWDLCAA24DRF that is having trouble missing pulses off of a flow meter. I'm not real familiar with the Twido PLCs but it...
Replies
6
Views
3,591
Hello my friends, i need help .. i have to make a program for my plc to count from 0 to 99 .. and transfer the counting to two seven segments...
Replies
21
Views
7,407
Hello I am looking for tips on how to count the duration of a given function and then how to display it on the hmi panel in the hh:mm:ss format...
Replies
4
Views
1,713
Guys, I know it will be silly but can't get my head around it. I have 3 conveyors, every one on a separate servo drive, and 2...
Replies
25
Views
3,534
Back
Top Bottom