Do I need a hardware interrupt in S7?

uptown47

Lifetime Supporting Member
Join Date
Feb 2008
Location
Over there, next to those boxes
Posts
1,146
Hi all,

I'm currently upgrading an S5 system to S7 and I'm trying to recreate the functionality.

The S5 system has a 434 card on it which is basically a card that calls an interrupt OB (OB 2) every time one of the 8 inputs goes high.

The interrupt OB 2 then checks which input went high and either adds 1 to a count or subtracts 1 from a count. It does this for a vertical and a horizontal axis.

The machine has two toothed sprockets and proxy sensors counting the pulses.

I need to recreate this functionality in my S7. I'm using an S7-314C-2DP as this is quite a quick PLC.

I can set up that the pulses from the proxys come into the High Speed Counter that's built into the 314C-2DP.

My question is this..

Do I need to set up an interrupt like they have done in S5? If so, how would I go about it. I've looked into the OB's in S7 and there's OB30 - OB38 which are Cyclic Interrupts. There's also OB40 - OB47 which are "hardware interrupts".

I'm guessing that its the hardware interrupt I need but I've never had any dealings with them whatsoever so I'm a bit stuck.

Can someone tell me how to set up a hardware interrupt or has anyone got any better ideas on how I can achieve the same thing another way??

A really big thank you to anyone who can help me out with this. I must have downloaded and searched through about ten manuals from the Siemens site and I'm getting nowhere!

Cheers

:)
 
To find if you need interrupts compare lenght of pulses with your longest programm scan time (OB1) - if pulses are shorter then you need them for sure.
In case of your CPU you can use HW interrupts with on-board binary inputs. It can be enabled in HW Config when you double click slot 2.2 of your CPU. I believe configuration is straightforward.
Then you add OB40 to your Blocks folder. Every time interrupt comes, OB40 is started. Here you can programm your logic.
(however observe manual what happens if next interrupt emerges while previous one is still being processed).
You can check which input fired the interrupt in OB startup variable: OB40_POINT_ADDR
 
Thanks for the information on the hardware interrupts. I've searched the hardware config and found them as you said. I've also managed to set them up now.

I'm wondering if I need them..

My scan time says it is 11ms (between 10 and 12ms)

I need to count roughly 1000 pulses in 9 seconds.

This is a pulse every 9ms

My questions are...

1) Do you think I'd get away without a hardware interrupt or is the hw interrupt the way to go??

2) Would I really need to implement the built in high speed "counter" if I'm using hardware interrupts. I'm not bothered about the actual count just making sure that I 'see' all the pulses so that I can internally compare the position to a set position and stop the motor in the right place.

Many thanks for your help

:)
 

Similar Topics

Started a new job a few months ago that had really no one with plc experience. They have mostly Allen Bradley hardware. Some slc, micro Logix...
Replies
4
Views
1,049
Hi I am a beginner within the PLC world. But I want to learn as much as possible. So here are som questions based on the product information...
Replies
9
Views
2,167
Hello everyone. I have a a fairly large job ahead of me. I am going to be retrofitting a large baler with new controls. Luckily I have the...
Replies
20
Views
4,706
Hi there, I have a new Simatic S7-400 with CPU connected to a rack of 2x ET 200M (IM 153-1) terminals which supply 4 x I/O boards each. I have...
Replies
3
Views
1,695
Hi, This is a project that i'm currently working on. I have completed the flow chart of the process and now i'm in need of help of the Hardware...
Replies
1
Views
2,644
Back
Top Bottom