S7-400 timers

Outrage

Member
Join Date
Jul 2006
Location
Nottinghamshire
Posts
173
Hi All, yep i know this one has no doubt been covered a number of times but it's my first 300/400 project and I'm struggling with the basics. Im Bradley/S7-200 based. I've had a search through the original posts but think i need some explanation in laymens terms....

I'm trying to use the IEC timers SFB4 since they appear to be the most like what i'm used to in bradley and support a timer value in msecs rather than S5T format.

How do you actually address the timer block? I've dragged it onto my network but i've got ??? above the block and I can't figure out what value to enter. Pressing F1 for help on the block only gives me a few paragraphs on the block's I/O but nothing useful on actually using the block.

Any help would be appreciated!

Cheers,

Lee
 
SFB 4 requires an instance DB, the ??? above the instruction is the field to enter the DB. E.G. DB30. The software will create the block for it. I would go back to Simatic Manager and give it a symbolic name. After giving it a name, say Timer1, the members of the timer could be addresses as Timer1.Q, Timer1.PT Timer1.ET.

Don't forget to download the DB. Don't forget that F1 (Help) is your friend.

Mike
 
If this is programming an OB or FC, you have to assign an instance DB to each call of SFB4. That means simply select an unused DB number where you have the red ???. When you try to navigate away from the newly entered DB address, STEP7 will ask if the instance DB shall be generated.
Be smart and immediately assign a symbol to the DB.

If you are programming an FB, you gave the additional option of letting the timers be embedded in the FB's own instance DB. This is also called "multiple instance". It is more simple than it sounds.
In the STAT declaration part, you can add any element including SFB's. Select the SFB(?) entry and specify SFB4.
In the code part or the FB, you then specify the address of the timer by the "#" + the symbolic name from the declaration, i.e. #MyTimer.
Then, when you call the FB from another block, an instance DB for the FB will have to be assigned. The instances of the timers will be included in this instance DB.
 
Hi Mike and Jesper, thanks for your replies - I'll give that a shot tomorrow when I'm back at work.

Brand new platform (to me anyhow!) and a tight deadline make for a steep learning curve! Hope you don't mind if I pick your brains a little more over the coming weeks!

Best regards and many thanks as always,

Lee
 
Hi Mike and Jesper, thanks for your replies - I'll give that a shot tomorrow when I'm back at work.

Brand new platform (to me anyhow!) and a tight deadline make for a steep learning curve! Hope you don't mind if I pick your brains a little more over the coming weeks!

Best regards and many thanks as always,

Lee

Well, tried that this morning - worked as requested, sure i tried the same thing yesterday to no avail but never mind!

Cheers all,

Lee
 
Hi all, next question....

Can I use a datablock reference for the PT value of an SFB4 timer?

I have setup a datablock and within that block I have defined the following:

Address: 4.0
Name: STEP_TIME
Type: TIME
Initial Value: T#0MS.

When i try and enter this parameter on the timer block PT it lets me select STEP_TIME from the drop down list that appears but then comes up with the error:

"Actual data type INT does not fit the formal type TIME of the formal parameter PT"

I can enter an MDxx value and then assign a symbol and set it up as a TIME type and enter that and it works but i'm going to want to enter timer values from a HMI and a data block seemed like a reasonable storage method for the data - if its feasible??

Thanks,

Lee
 
It is certainly possible.
The message that it does not fit because it is an INT may be because you have not saved the DB after changing the STEP_TIME, or the code block was opened before you started to edit the DB.
Try to close the code block, open again and try to do the same thing again.
 
If you are programming an FB, you gave the additional option of letting the timers be embedded in the FB's own instance DB. This is also called "multiple instance". It is more simple than it sounds.
In the STAT declaration part, you can add any element including SFB's. Select the SFB(?) entry and specify SFB4.
In the code part or the FB, you then specify the address of the timer by the "#" + the symbolic name from the declaration, i.e. #MyTimer.
Then, when you call the FB from another block, an instance DB for the FB will have to be assigned. The instances of the timers will be included in this instance DB.


Hi Jesper, thanks for your previous pointers!

I've now tried the philosophy above. I've declared a variable under stat and made it a TON data type but the SFB block in my code will not accept the address and the text remains highlighted in red with the error:

3: Compiler Information: type conflict.

The address has the # and it was selectable from the drop down address list? can you point me in the direction of what i'm doing wrong? o_O

Best Regards,

Lee
 
You should NOT add a SFB4 in the code part. That would require you assign a non-multi-instance IDB to the SFB4 call.

To add the multi-instance SFB4 calls to your code, the trick is to add an "empty" code block in a rung. Then specify the symbolic name for what the code block must be.
You do this by hitting ALT+F9 after you have placed the cursor in an empty rung. An empty block will appear where you can select blocks from the code libray. In this dialog type in a "#" followed by the symbolic name of the IEC timer, i.e. "#MyTimer1". The block will then convert to the SFB4 call, but with no IDB attached to it.

It is not well described in the STEP7 help.
 
You should NOT add a SFB4 in the code part. That would require you assign a non-multi-instance IDB to the SFB4 call.

To add the multi-instance SFB4 calls to your code, the trick is to add an "empty" code block in a rung. Then specify the symbolic name for what the code block must be.
You do this by hitting ALT+F9 after you have placed the cursor in an empty rung. An empty block will appear where you can select blocks from the code libray. In this dialog type in a "#" followed by the symbolic name of the IEC timer, i.e. "#MyTimer1". The block will then convert to the SFB4 call, but with no IDB attached to it.

It is not well described in the STEP7 help.


Hey Jesper, that cracked it!

Boy o' boy this S7 stuff seems hard to master I think i've had too much of the easy life with other platforms....:geek:

Thanks again,

Lee
 

Similar Topics

My project uses a MicroLogix 1400. First time I’ve used the 1400; used the 1500 for a few projects. I have 1.5 years’ experience programming...
Replies
11
Views
6,802
Dear all colleagues and members I have worked for a company and I created a program for them for small automation but they dont want to give my...
Replies
12
Views
4,705
I have my reads configured to pick up the groups of timers. I have one point configured T4:0.pre Now, I can display it in a "LCD display"...
Replies
6
Views
2,211
Is there anyone who can help me regarding this HMI is missing the choices when I make a new Device in TIA. Only 7" Display above are the choices...
Replies
2
Views
9
I'm using a SLC typed write from the ControlLogix5572 to the MicroLogix 1400, with path: 2, (MicroLogix IP). The ControlLogix equipment has a...
Replies
0
Views
86
Back
Top Bottom