Step 7 Calling PID with SFC32 in OB1

dahnuguy

Member
Join Date
Mar 2007
Location
SC
Posts
720
I read the other threads that come up with a search for SFC32.

The program in question works. The PID in OB35 works.

But I have had this error on block SFC32 from the beginning.

8090

The help file error list stops at 8x45.

Is this error because the scan time is less than the interupt time of SFC32?

Scan time is between 7 and 26ms and SFC32 is set for 100ms.

Where can I find what this error is?

Any ideas?

callingPIDerror01.jpg
 
Hello dahnuguy;

Maybe the following attachment can help you.
It would be good that you read at least the Contents of the first chapter ("Organization Blocks") of the System and Standard Functions manual. OB 35 is a "Cyclic Inerrupt OB, not a Time-Delay Interrupt OB, which can be launched by SFC32.
The setup of OB35 is done through the HWConfig editor, CPU properties.
Hope this helps,
Daniel Chartier

Edit: you will find the same information on SFC32 on the Online Help of Step 7, when you select SFC32 in the System and Standard Blocks library, and use F1 to get to the help file.
D.C.

SFC32_error.JPG
 
Last edited:
I really did read it..................really.

Thanks,

I also received similar response from Siemens tech support.

I did read everything I could find including the parts you reference, but somehow I missed the significance of the different blocks. One being a timed interupt and the other being cyclic. It just went right by me. The idea is quite different from anything I have used before.

So the OB35 happens every X milliseconds and the SFC32 will call a block after X time delay. Right?

Not sure how I would use that, sort of like putting a whole block after a time on delay.

I am sure there is more to it than that.

What is an example of how you would use SFC32? Just a general example, don't need allot of detail just trying to think of some scenario where this would be useful.

Thanks again.
 
I've never used a time-delay interrupt myself, but I think the key elements are -
- the interrupt block is an OB with a relatively high priority. When it comes time to execute it will have precedence over most other things in the CPU.
- you can schedule the OB for execution after a time delay (up to the maximum value of a TIME variable - some days if need be) but you can also cancel it before it has executed.

Taking these two parts I'd guess you might want to use it where you request a specific action from your machine/equipment/plant and schedule the interrupt at the same time. If the field hasn't responded as wanted within the delay time then the OB takes over and performs whatever recovery or shutdown procedure you have programmed in there. If you do get the feedback, then unschedule the interrupt and life goes on as normal.

I suspect it would only be pretty high-level or major importance issues you'd want to handle this way rather than a simple alarm timer!

Any other better guesses ... ?

Ken
 
.. future puzzle material :)

Yay....:D



@dahnuguy:

In PLC settings activate OB35, select interval time corresponding to the PID update or if many PID loops, set interval time lower. For instance, you got 10 PID's and u want em updated every 100ms, set OB35 time to 10ms and every time OB35 gets scanned you process another PID. First scan PID 1, second scan PID 2, etc etc etc This can be done quite easily. This so OB35 calls doesn't cause too much problems with the rest of the program.

Once OB35 is activated, then whats the use of SFC32?
It has no use. SFC32 has been replaced by internal CPU settings.
So u can just dump SFC32.

Just so u know, it's better to process the PID's in OB35 or similar OB. As they are called/scanned at precise intervals, independant of current cycle time. For a PID having solid update times is quite important. And this is just what OB35 provides.
From what I can see, your PID gets processed every 107 to 126 ms, with OB35 the range was 99 to 101ms. (if configured for 100ms)

Have minimal experience with PID's so above info might have small errors in it. The guru's will point them out for us I'm sure.
 
S7 isssssssssss puzzle material LOL

Yay....:D



@dahnuguy:

In PLC settings activate OB35, select interval time corresponding to the PID update or if many PID loops, set interval time lower.

Makes sense, I thought I needed SFC32 to give OB35 a "call" from OB1. Looks like OB1 and OB35 are independant but both called by the PLC CPU with no need to explicitly "call" OB35 from OB1.


For instance, you got 10 PID's and u want em updated every 100ms, set OB35 time to 10ms and every time OB35 gets scanned you process another PID.

That's a great idea, I was thinking about how all these interupt blocks might affect the rest of the logic.


First scan PID 1, second scan PID 2, etc etc etc This can be done quite easily. This so OB35 calls doesn't cause too much problems with the rest of the program.

This is where my interest is peaked. Just how do you determine which scan your on? Or do you use a series of bits to lock step through each one.........as in First pass does step 1 , step 1 enables step 2 , etc and then step 10 enables step 1............repeat.

That's how I would do it , but some of you come up with more interesting ways to do things.

The PIDs in other PLCs must do this timing in the back ground, I have never had to specify a time interupt or put a PID in a special place.

I am curious to find out what the difference is between SFC32 and a Delay On timer.
 
PID Calls

I agree that PID blocks should be called from a cyclic interupt block. Otherwise it will create havoc with your tuning. But I am lost as to call a specific PID block for each time OB35 is called. I guess you would use a counter that would increment through the PID blocks with each scan. However most PID blocks can be called at 1 second intervals. Perhaps a fast loop may require a half of second. Any decent Siemens should be able to process all of the PID blocks in a 0.5 or 1 sec OB35 call.
 

Similar Topics

I am having a step7 v5.4 program where the blocks are encrypted and locked. And the manufacturer is stopped the support. Is there any ways to...
Replies
2
Views
192
Good Morning, Hoping someone with some Siemens experience can give me a hand with this one. Customer has a S7-200 cpu, which has a 6GK7...
Replies
0
Views
258
HI! HOW COULD I OBTAIN THE NAMES OF THE STEPS OF A ROUTINE IN SFC LANGUAGE IN STUDIO5000? Or is there a system variable that gives me those...
Replies
0
Views
344
I'm just trying to figure out the right method of adding a DO card to an existing rack. It's not the *next* open slot, but I have to move the AO...
Replies
5
Views
560
Hi Siemens Experts, I am hoping someone can shed some light on my issue. I have uploaded the code from a S7-300 (317-2PN/DP) using Step 7...
Replies
9
Views
695
Back
Top Bottom