Hardware Interrupt Handling on S7-300 PLC

ahsen001

Member
Join Date
Mar 2010
Location
Dubai
Posts
25
Hi Friends,

I am developing a system which involves the use of Hardware Interrupts application. I am using Digital Input module of siemens "6ES7 321-7BH00-0AB0". This module supports Hardware interrupt application.

But i dont know which SFC's should i use for handling/calling the Hardware Interrupt Organization Block (OB)..............???

Can anyone give me any idea on it..?

Regards to all.
 
Hi Friends,

I am developing a system which involves the use of Hardware Interrupts application. I am using Digital Input module of siemens "6ES7 321-7BH00-0AB0". This module supports Hardware interrupt application.

But i dont know which SFC's should i use for handling/calling the Hardware Interrupt Organization Block (OB)..............???

Can anyone give me any idea on it..?

Regards to all.

I mean to recall that the interrupts triggers OB40 dependant on the rising or falling edges of the inputs that are checked in the properties tab in the HW manager. I shouldn't think you'll need an SFB/C.

And if you assign f.x. IW20 to the card, I mean that you'll have to put this code into OB40 to update the PI area:

L PIW20
T IW20


Here comes a guess how to detect which of the inputs that had a rising edge causing the OB40 to be called. It would be nice if you could test it.

Substitute the 2 code lines above with this:
L IW20 // 'Old' PI status
INVI // Invert all bits
L PIW20 // New input status
T IW20 // Store it to the PI
AW //
T MW20 // Here will the positive edges be ='1' (I hope
icon12.gif
)
L MW22 // Freeze the edge bit on, to be able to read it in monitor/modify
OW
T MW22

I hope I didn't confuse you too much.

Kalle
 
But i dont know which SFC's should i use for handling/calling the Hardware Interrupt Organization Block (OB)..............???
You don't need to call the Hardware Interrupt Organization Block. It is executed automatically every time a hardware interrupt is at hand. If you would have to call the OB, it wouldn't be a hardware interrupt at all. All you have to do is configure which inputs do perform a harware interrupt under what conditions. This is done in the hardware configuration.

Regards,
 
Open up HWConfig of the station.
Find the 321-7BH00 card in your rack.
Double click on it.
Go to Inputs tab in the pop-up.
Here you need to select:
- Enable Hardware interrupt
- At the bottom, which input will need to trigger the interrupt on falling and/or rising edge.

Now you need to add OB40 to the program and write whatever code you need to handle the interrupt.
There are TEMP data available at each call which allows you to figure out which input called the interrupt.
We only use 1 input as interrupt so I have no idea how exactly to use the TEMP data.

OB40 is called each time the interrupt input is rising or falling, depending on the selection you made in the HWConfig.
 
Thanx to all of you for replying.

For KalleOlsen, i am confused with your reply.

For Jeebs, I have made all the changes as instructed by u. I ve enabled hardware interrupt and I have set "I0.0" for trigerring interrupt on RISING EDGE. After adding on "OB40",

I have written my test program in it. But when i simulate it on simulator, and i trigger "I0.0" at rising edge, the OB40 is not called and nothing happened.

So is there anything, which i m missing in handling it..?
 
Use the following coding in OB40

L #OB40_POINT_ADDR interrupt status of the module
T MW100

A M100.0 (which will be your input 0.0)
...
...

It's possible if you use PLCSim that it doesn't jump to OB40
Hope this helps
 
Dear Sir,

i am not able to trigger hardware interrupt OB 40 via PLCSIM.

can any one help me in this matter?

can any one give me the step of that how can i trigger hardware interrupt via PLCSIM?
 
What are you entering in the dialog box to trigger OB40 in PLCSIM?
I just did a quick check and it worked OK for me.

In OB40 you will have to pull the MDL and POINT address that triggered the interrupt from the local data.
 
What are you entering in the dialog box to trigger OB40 in PLCSIM?
I just did a quick check and it worked OK for me.

In OB40 you will have to pull the MDL and POINT address that triggered the interrupt from the local data.

i m entering OB40_MDL_ADDR in module address and W#16#ABCD in point_addr, but it still shows invalid module address
 
As you have discovered, that will not work.
Module Address should be the address of the input module as defined in your Hardware configuration.
Module status (POINT_ADDR) is the bit(s)you wish to simulate an interrupt from.

OB40_MDL_ADDR is the temp data that will contain the base address of the IO module that triggered the interrupt.

Check the online help for OB40, it will give more information.
 
Hi Friends,

I am developing a system which involves the use of Hardware Interrupts application. I am using Digital Input module of siemens "6ES7 321-7BH00-0AB0". This module supports Hardware interrupt application.

But i dont know which SFC's should i use for handling/calling the Hardware Interrupt Organization Block (OB)..............???

Can anyone give me any idea on it..?

Regards to all.

Hi,

use SFC59 to read data record inside OB 8x ( i used it and not remember now). Data record return 16 bytes of data and that will include module error, power fault,channel fault and wire break (by group) etc.
this module can handle wire break detect and you have to install resistor 10 k to 15 k ohm resistor for that.
for details, please refer s7-300 module data. pdf and that will give u good information.
don't forget to enable hardware diagnostics in module in step 7 hardware configuration to call error handling OB in your program.

edit: i used sfc 59 inside OB82 to read module data record. Enter IOID b#16#54 for Input Module and b#16#55 for output module when u call sfc 59 and of course LADDR as Hex code. for example, if your DI or AI module start address is 256 (decimal), then enter it w#16#100. hope you get idea.
 
As you have discovered, that will not work.
Module Address should be the address of the input module as defined in your Hardware configuration.
Module status (POINT_ADDR) is the bit(s)you wish to simulate an interrupt from.

OB40_MDL_ADDR is the temp data that will contain the base address of the IO module that triggered the interrupt.

Check the online help for OB40, it will give more information.

dear sir,

from where i can find the module address?
 
MOez, The OP is using HW interrupts (OB40) not OB8x.

Hiralpatel, the module address is assigned by you (or the default) in the HW Config. The I/Q address.
 

Similar Topics

I'm using CX2030 Beckoff PLC. Twincat 3 runtime. What I'm looking for is option to activated certain PLCTask once I register certain Digital...
Replies
0
Views
1,281
Hi guys; i want to simulate a hardware interrupt in s7-300 with PLCSIM. i configured a CPU300 (not compact) , a DI card with interrupt...
Replies
3
Views
1,877
Hi all, I'm trying to fit a CP343-1 Lean card (v3.0 6GK7 343-1CX10-0XE0) on to an existing rack that has a CPU318-2 (6ES7 318-2AJ00-0AB0) in...
Replies
2
Views
4,689
Hello! I am using: S7-1214C 6ES7 214-1HG31-0XB0 V3.0 SB1221 6ES7 221-3AD30-0XB0 V1.0 and some other modules ... TIA Portal V11 SP2...
Replies
0
Views
4,511
Hi guys, I'm currently working with a siemens PLC 314C-2DP and am using the fast counter input(channel 2) with an incremental encoder...
Replies
6
Views
5,149
Back
Top Bottom