Priority program for S7-300

BNA

Member
Join Date
Sep 2003
Location
Give
Posts
117
Hi'

Is there any of you bright heads that could help me make this simple, I have 5 different programs (Inputs) with different priority that can be set in random order. Now i need a program that can sort out the inputs and set the right program number (Output or INT).

Example:
Input 1 = priority 1
Input 2 = priority 2
.
.
Input 5 = priority 5

If Input 1,3 and 5 is activated, set program 1.

It should be simple I just can set my mind on how to solve it as simple as possible.

Regards Brian
 
Try this1

Prio.JPG


Jesper 🍺
 
Hi lauu

Thank you for your suggestion, but it does not solve my problem it only moves the problem to INT instead of inputs.

If more inputs are active I need the Plc to decide which program has the highest priority, and then set ONLY one output or program number.

Regards

Brian
 
Hej BNA

There will only bee 1 program number active, because I use the same Register for the "ProgramNR". You will only see the selected programnr regarding the highest priority´input in the rest of your program. If you look at the image you can see that all the priority input er "ON", and the selected ProgramNr will bee programNr 1.

Jesper
 
Hi,
What about mapping your inputs to a word, then ==I compare with the desired number,then on a match jump conditionally and set the program active. if Input 1,3,5 are active giving 21, again compare then jump to the same label for Program 1 and force selection.

something like this maybe


 
L #Program_no // int
L 1
==I
JC Pro1

L #Program_no // int
L 2
==I
JC Pro2

etc

Pro1: L #Program_no
T #active_Program_no
BEC

If this ended up with alot of jumps, then a JumpList would be better.


 
lauu said:
Hej BNA

There will only bee 1 program number active, because I use the same Register for the "ProgramNR". You will only see the selected programnr regarding the highest priority´input in the rest of your program. If you look at the image you can see that all the priority input er "ON", and the selected ProgramNr will bee programNr 1.

Jesper

Thanks Lauu

I must confess I didn't know that the move function worked like that, this is just what I need.

Regards
Brian
 
You could also assess them as a byte (IB1) , and use a simple group of compares - I am afraid there is not really and elegant solution to this one , but then , it isn't really an elegant problem !
 
Hej BNA

It has nothing to do with the MOVE instruction, it is the way PLC scan's the program. That is why I started with the lowest priority(5) first. So the last one scanned(active one) is going to set the ProgramNr.

Jesper.
 

Similar Topics

I have to start out by saying I am not a PLC programmer and I have basic programming skills but mainly use software as a troubleshooting tool. I...
Replies
0
Views
127
hello. In Intouch, I want the color of the alarm window in the header menu to change depending on the priority value of the tag. To do this, I...
Replies
0
Views
81
Is there any way to lock a popup to always have the highest priority? i.e. the user cannot click off of the popup until they address the popup. I...
Replies
4
Views
1,081
Most HMI have the ability to sound speaker on alarms. What I'm wondering is does Factorytalk View SE have the ability to use different audio clip...
Replies
2
Views
1,468
I have 10 Hoppers each with 2 level sensors; one is at the 75% full level and the other is at the 25% full level. I need to fill hoppers that...
Replies
56
Views
16,081
Back
Top Bottom