move a timer help in siemens S7 300

ason

Member
Join Date
Oct 2005
Location
Home
Posts
317
Hello, i got a prob that need a fast solution, i have made a program in microwin for s7 200.
Bur now a costumer want a siemens 300 in this machine, becuese they only have that in there plant.
the prob is that we already have made the machine ready for shiping to the costumer.
so in a hurry we need to convert the prog. for a 300 ;)

i will attach a PDF with a part of the program that i have the big problem to solve.

net 3
we store the time that I0.1 "1" in VD4

Net 7
samething, store a time in VD16..

Net 10
we use that time base in in the TP timer we stored in VD4 earlier

im not so good in this, that i have problems with is how to store the time base that i do in net 3 and net 7

think of to use a pulse generator and a counter but cant find any pulse generator.

Thanks,

Markus Andersson
 
You can define a byte as pulsegenerator (7 different pulsfrequencies)in the HardWare Configuration (Manager->insert->station). Choose your cpu and other modules. Then you choose the page 'cycle/clock memory'. Below this page you must make the 'clock memory byte' active and choose a byte-number. Save and compile your hardware and download this to the cpu.
 
Thanks for the help. saw this in the help file about

A period duration/frequency is assigned to each bit of the clock memory byte:

Code:
Bit	    7	    6	  5	  4	  3	  2	  1	      0
Period
duration (s):	2  1.6	  1	0.8	0.5	   0.4	     0.2    0.1
Frequency
(Hz):	0.5	0.625	1	1.25	2	2.5	      5	     10
So if use memory byte 100 in hardware conf.

i can do something like this.


 -----| M100.6 |-------------| I0.0 |-------|C1|



the counter C1 will countup 1 every sec if I0.0 is "1"

If so i will give this solution a big :geek:
 
If you use a s7-300 you should know this about the S7-timers;

The timers use a time what can be a constant time (example S5T# 5s 10 ms) or a not-fixed time. You want to use this not-fixed time. there for you need to use a 'MW' (merkerword; e.g. MW10 ) or 'DBW' (datablockword; e.g. DB1.DBW0). But there is more to know;

the time wich you want to write to e.g. MW10 has to be in BCD-code.

The 'time' is made up of a 3 BCD-coded numbers and a 'time-resolution'.

The BCD-code numbers range from 0-9 so the time-numbers go from 000 to 999. These time-numbers will be multiplied together with the time-resolution. There are 2 bits that effect the time-resolution;

00 -> resolution 10 ms -> time-range: 10 ms to 9s 990 ms
01 -> resolution 0,1 s -> time-range: 100 ms to 1 m 39 s 900 ms
10 -> resolution 1 s -> time-range: 1 s to 16 m 39 s
11 -> resolution 10 s -> time-range: 10 s to 2 h 46 m 30 s

The 3 BCD-numbers are from bit 0 to bit 11, the resulotion-bits are bit 12 and 13. Bits 14-15 are not used.

Example: 00 10 0001 0010 0011 means

1s x 123 = 123 s


Values that exceed 2h46m30s are not accepted. A value whose resolution is too high for the range limits is truncated down to a valid resolution.
 
thanks for the help guys,

right now im looking for the right timer that i need,
and conf. like i want it.
this is what i have done so far..

net 1
i use M100.0 for pulse generate to C1 resolution 0,1 s/pulse

net 8 i use T32 and i want it to run 0,1 s for every pulse i got in MW10,

how do i scale the value to right resolution?
thinking that i need to do ADD_I : Add Integer or something, but dont know how :confused:
 
My opinion is you were on the right track with the IEC timer depending on how many you need. While in the LAD/FDB/STL editor, look at Libraries->Standard Library->System Function Blocks SFB3,4,5. The drawback is that each timer is an FB requiring an instance DB (not a big deal especially if you use as a multi-instance). The upside is you can use a variable at the input which represents ms.
 
I was taking a quick check in the SFB´s helpfile and the TP timer is what i need, and that is what i used in the 200.
going to give it a try..

Thanks alot
 
When i put in a sfc 3 TP timer i cant name it like T32 or M90.0, what should i call them?

To late i saw that it take a hole DB, then i tryied to name it DB1 and it looks right,
is´t that i should name them?
 
Last edited:
When i put in a sfc 3 TP timer i cant name it like T32 or M90.0, what should i call them?

To late i saw that it take a hole DB, then i tryied to name it DB1 and it looks right,
is´t that i should name them?

There is two different way to do that.
1. Better way -> Because you are using FB1 -> use FB's multi-instance capability and put all your SFBs to the STAT variable. When you call your FB1 in OBx -> CALL FB1,DB1 this command creates instance-db for FB1 automaticly. Then you can name DB like you want.
2. Bad way -> create to all SFB-function their own instance-db. So, if you have 15 SFB calls, then you have 15 different instance-DBs too.


I modified your plc-program a little bit. I increased to FB1 networks 9-11 and there is "one kind of example" how you can calculate time variable + timer call.

I try to attach your program here, cross the fingers
 
It is so many way to do this i think :=)

first of all i see that i have done this wrong when i did the program in FB, forgot that it should be in a FC,
going to change that now..

And now over to that u made,
what is the highest time i can store in this if i use 100ms?

net 9
this is only for scaling my counter for the timer?

net 10
what is M110.1?
#_Time is the value from net 9?

and if im going to use one more setup of this what do i need to do then?
 

Similar Topics

Hello I dont often use allen bradley and need a little help I am trying to figure out how to take accumulated value of a timer (TON) from one...
Replies
10
Views
2,599
Hello everyone: I am new in the world of PLC's and I would like some help on writing a program using a ton timer with sw1,sw2 and two mov...
Replies
4
Views
1,590
So I'm pretty green when it comes to troubleshooting in the field so bear with me. We have a Danfoss valve that opens/closes from an analog output...
Replies
23
Views
892
Hi. This is pretty basic but I'm struggling to find an efficient solution. I have a float value of let say 666.555 that I want to move / split...
Replies
3
Views
146
hi, I got a plc S7-1200 with SEW movitrac **** and i need to program something ridiculous if my application reaches sensor 1 then my SEW has to...
Replies
0
Views
177
Back
Top Bottom