Help with a complex bit of math (Step7)

Join Date
Aug 2007
Location
Saint Augustine, FL
Posts
178
Hello. I'm still on my first major project in S7 and have a rather simple problem that I can't quite put into S7 terms.

The problem is simple: Given a set of 12 points (circuit breakers in this case), that the user has divided up into two group (priority 1, priority 2) and then into 12 unique sequences, how can I confirm that there are no duplicates in the sittings. That is to say, there can't be two Sequence-2's in Priority Group 1.

(In my past PLC efforts, I've done this by comparing the sum and products of the series to known results, which worked well. But, the "Priority group" requirement this time wrenches that idea).

So, no arrays, i guess. No looping either. Recursion seems unlikely. Anybody offer to give me a push down the right direction, so I don't have to enter in 154 different rungs to look at each condition explicitly?

- m
 
if (a == pri) and (b == pri) and (a == b) return false
if (a == pri) and (c == pri) and (a == c) return false
if (a == pri) and (d == pri) and (a == d) return false
.
.
if (b == pri) and (c == pri) and (b == c) return false
if (b == pri) and (d == pri) and (b == d) return false
.
.
if (a == sec) and (b == sec) and (a == b) return false
.
.
 
I'm none the wiser I'm afraid. If you can specify an algorithm then I'm sure it can be coded. Maybe it's not worth the effort coding a tricky algorithm so I'd go with the 154 rungs.
 
mainstreetmark,
Do you want to detect more than one bit being active in each of the primary and secondary group?
If yes, it will be much less than 154 rungs.

Or do you need to watch all possible pairs of bits for belonging to the same group and being both active?
(Probably, this is the same task).
Clarify, please.
 
Last edited:
Yeah. Basically, the user can assign a breaker to one of two groups, and give it a priority within that group. I cannot have repeated priorities.

Pri1: 1,2,4,5 Pri2: 1,2,3,12 <-- valid
Pri1: 1,1,4,5 Pri2: 1,4,5,6 <-- invalid (two #1's under Pri1)
 
How do they enter the priority?
instead of entering the breaker number into a group and priorty can you enter the group and priority into the breaker #

breaker 1 = 11 or 12 or 00 then each breaker can only have one entry.
 
No, the order must be controllable. In a loss of utility power, the customer must decide which order the loads would be shed in. So, a fixed priority isn't possible, as customer needs may change (and is indeeed part of the spec).
 

Similar Topics

Hello, I need to write the following program in Ladder language, but I could not integrate the Fibonacci sequence into the ladder. Can you help...
Replies
20
Views
340
this a program to send data to barcode printer I want to integrate a new printer in a new machine and i wanted to adapt the old prgram on it but I...
Replies
4
Views
163
So i've been at this for a long while, i have Citect Scada 2018, i have full access to everything but i can't seem to find any option or...
Replies
0
Views
60
Hi all, hope you are having a great day, I am in need of your help to create a AOI or program that does this kind of job: I have a IO Link...
Replies
26
Views
541
please help me . I have to make this ladder diagram and I can’t figure it out :(
Replies
12
Views
369
Back
Top Bottom