STOP CYCLIC INTERRUPT during excitation of some function

naturephoenix

Member
Join Date
Jan 2015
Location
Vienn
Posts
181
Is there any kind of system function or something that stops cyclic interrupt during excitation of some other function.

So for example inside fc3 i got some code, and i dont want that interrupt happens while program is going through fc3 function.

I'm talking about siemens S7-300, STEP 7
 
See internal block SFC39

Hey ty!
In OB35 is called every 20ms (CYCLIC interrupt). Inside OB35 I am using some fucntions, but I dont want that they interrupt my FC3 function.
So inside my FC3 fnction I should have something like this:


BEGIN // Beginisng of the code in the function FC3

CALL "DIS_IRT"
MODE :=B#16#0
OB_NR :=35
RET_VAL:=MW40

// Here goes the code for FC3 function
...
...
//And on the end I have to enable interrupts again

CALL "EN_IRT"
MODE :=B#16#0
OB_NR :=35
RET_VAL:=MW40

IS this good?
 
It is very uncommon to disable interrupts in user programs.
If you use global variables for intermediate storing, you should rather reconsider your coding.

Kalle

Edit:
You can check your code ala this:
Set a value to an MB first in the FC3 code.
Set a different value to the same MB in OB35.
In the end of FC3, check if the MB value is unchanged, if not increase a counter or set a flag.
 
Last edited:
It is very uncommon to disable interrupts in user programs.
If you use global variables for intermediate storing, you should rather reconsider your coding.

Kalle

Edit:
You can check your code ala this:
Set a value to an MB first in the FC3 code.
Set a different value to the same MB in OB35.
In the end of FC3, check if the MB value is unchanged, if not increase a counter or set a flag.

Yes I know what u mean, I know I can avoid this by using another variables in my program but was wondering is there a such function.
In my case I am getting a measuring data from device in W(wats). Then I divide data with 1000.0 to get kW. In my OB35 I have to use this values in kW...
Inside OB35 is PID which takes kW as reference, but cuz of interrupt sometimes its reference is in W.
YES I can avoid this on other ways and thats how i did that. As i said i was wondering are there out some System fucntion as well.
 
after dividing by 1000 are you storing new value (kW) to same variable than were you have watts before?

This is not good programming and you should consider something else than scan order or disabling interrupts so that code would work.
 
after dividing by 1000 are you storing new value (kW) to same variable than were you have watts before?

This is not good programming and you should consider something else than scan order or disabling interrupts so that code would work.

Yes that was the case until I noticed problem in PID...then I stored to another variable(that another variable later i use inside PID) and thats fixed problem ofc. Just explaining what was a trigger to make this post.
 

Similar Topics

Hi need help why this “failure 5 emergency stop “ appears at every startup in the morning ? Have to shut off main switch at least 10 times on...
Replies
19
Views
300
I'm looking to get some spare keys for this PLC. Does anyone know a source or have a part number? My searches are turning up nothing at the moment.
Replies
1
Views
76
Hey all, I am currently working on a depalletizer for a customer and we are doing a hoist upgrade. This is a SLC500 processor and the drives are...
Replies
6
Views
297
Hi everyone, I've got some trouble lately with a client and his communication with the server. I'm a beginner, and the project was not orginally...
Replies
0
Views
87
Hi First post here! I admit I am not too used to handle interrupt OBs in Siemens. I have a customer who has been buying a standardized solution...
Replies
4
Views
250
Back
Top Bottom