Help Please-Simple Program Is Not Functioning

speedcat

Member
Join Date
Mar 2009
Location
cairo
Posts
27
Am Student And Am Making My First Steps In PLC World & I Need A Little Help,I Attatched The Ladder Of A Simle Program It's Function To Count The Pulses Of Input I0.0 Then When Input I0.1 Is Enabled 2 Function Should Provided The Counter Has To Be Reseted But Just BEfore It Reseted The Value In The Counter Should Multiplied By 60 & Stored In Memory Vw100,I BAsed My Program On My Little Knowledge That Program Is Executed Rung By Rung & I Figured That Counter WillN Not Reseted Until Next Scan Cycle While In Current Cycle I Would Be Able To Store Value In Memory,But When I Run It On The Simulator The Value ISnt Stored,Is It A Simulator Bug?Or My Program Is Wrong?I Thing My Program Is Incorrect.It Seems that It Resets The Counter Before Executing The Third Rung & I Dont Why,Shouldnt It Be The Reverse Of That....By The Way I Have S7-200 CPU 222 Unit But I Havent Run The Program On It Yet..Should I?
Thanks In Advance

untitled.JPG
 
Last edited:
The first time that I0.1 becomes true the value of c255 * 60 will be written to VW100 but on the next program scan C255 will be reset to 0 and so network 3 will write 0*60 to Vw100.

Something else to considder. You probably need to count rising edges. I suspect that your progran may count up 1 every program scan. This task seems to about learning about how PLCs execute code in a cyclic sequential manner. To count rising edges only try the following: modify network 1 to trigger a countup with A I0.0 AN M0.1 then add network 4 A I0.0 = M0.1. Try to understand how and why this works and apply this knowledge to the problem with over-writing VW100.

Nick
 
A neat way to get a rising edge trigger with Siemens is to put a [P] in the rung after I0.1(From the same box you choose timers, or maths functions). You have to assign a Flag to it, say M0.2.

Negative edge triggers are [N].
 
Simatic counters only look for the rising edge on its input to count.
However markie is correct when he states that you will require a [P] in network 2
 
Simatic counters only look for the rising edge on its input to count.
However markie is correct when he states that you will require a [P] in network 2

It is not the only way to do it.

@OP:

The general idea behind what you are trying to do is good. It shows you know how the PLC functions. Partly anyways.

Now for some information that should help you:

A counter in S7 has a state. Either it's true or it's false. A boolean state. All you need to do it figure out which state the counter has when it's zero (when you reset it) and then add that as an additional condition for the Mul_I. (search in the help files for this, they explain it pretty well)

The first scan when the reset-input is presses would then multiply the counter with 60 and pass it on to the VW.
The second scan the counter is reset and because the multiplication is only possible when the counter is greater then zero, it won't multiply and thus not pass 0 into the VW.

There are times when you'd require positive or negative edge detection, this is not one of them.
 
Thanks Alot Guys I Completed My Program Successfully, It Working Properly & I Really Learned Alot From It...Thankssss Alott :)
 

Similar Topics

RUNG 1 : [A]-----(B) RUNG 2 : [B\]----[A\]-----(C) RUNG 3: [C]-----(DLatch) RUNG 4...
Replies
35
Views
15,196
Hi, I am new to PLC. Who can help me solve these PLC problems? Here is the address: http://lj21991.spaces.live.com/ Please email me...
Replies
5
Views
1,963
please help me . I have to make this ladder diagram and I can’t figure it out :(
Replies
12
Views
339
Hello, I am trying to get a Yokogawa Hart pressure Transmitter and a Rosemount Temp Transmitter to read on a 1769-IF4 module on an L33ERM...
Replies
10
Views
378
Back
Top Bottom