Help with PLC 214,(Subroutines,tables and memory)

Status
Not open for further replies.

KRAIG

Member level 1
Joined
Nov 23, 2005
Messages
34
Helped
4
Reputation
8
Reaction score
0
Trophy points
1,286
Activity points
1,536
how to use subroutines in s7 software

I made a program in ladder diagram which turns on an output for 3secs.Then it turns it off and turns on another output for 5 secs.It does this 4 times.

I want to do the same in a subroutine.

As i understood from the help of Mirco/Win i have to make a table and to fill memory with the data i want.

Problem is i didnt understand anything else.

Can someone tell me 2 things to understand how i can do it with a subroutine that is called again and again and does it with variables that change the output and the duration.

Also if you have any links i could study

Thank you in advance
 

subroutine micro win


is the plc Siemens s7 214 ?
 

s7 212 manual

Yes this is the plc(s7 214).
 

subroutine plc ladder

KRAIG said:
Yes this is the plc(s7 214).
do you know how a plc works?
do you have the manual of the s7 214 ?
 

plc subroutine

i have studied the only source of information i have and that is the help file of micro win v4.0.1.I know a lot about mcu programming,however.

We dont have any books in my school,nor the manual.That is the reason why i ask for some links.

Anyway today i was able to do something.

I made a subroutine.When i close the I0.0 switch it enters the sub.

sub:

net 1:

( in ladder):
move the address of Vb0 to (pointer) Ac1 (MOV_DW,&VB)->AC1)

net 2:

add to the ac1 the number 2,so as to go to the next variable. Then de-reference the pointer and i use it as a value to a timer.(T32,PT= *AC1)

.
So by using these variables and setting tha data block like this:

vb0 0000
vb2 2000
vb4 1000
...


I think that my subroutine is able to pass different value(tha ones in the datablock) to the timer.


am i wrong somewhere?

I also used the same method to have different ouputs for every time.
 

s7 ac1 +i


i used the plc s7 212 once to program some runing lights but i didn't use subroutines just blocks and they keep reccuring, and a few timers. i bet the plc s7 214 is not that different from it.

i am not really getting what you really want to do with the sub routine ?
what are you using the plc for ?
 

plc subroutin

I want to turn on Q0.0 for 3 secs,then turn it off and turn on for 5secs Q0.1 then turn Q0.1 off and turn on Q0.2 for 7 secs.
 

plc subroutines

KRAIG said:
I want to turn on Q0.0 for 3 secs,then turn it off and turn on for 5secs Q0.1 then turn Q0.1 off and turn on Q0.2 for 7 secs.

definitley you need more than 2 networks

simplest way is

---|T1|---|/T2|---|/T3|---(q0.0)

---|/T1|---|T2|---|/T3|---(q0.1)

---|/T1|---|/T2|---|T3|---(q0.2)

this is the logic now you need to implement it, i dont have the s7 software sry :|.

Do you know how timers work ?
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…