Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remedial latter logic.

Status
Not open for further replies.

itsmoked

Electrical
Feb 18, 2005
19,114
I have twenty identical logic blocks. Each one needs to block all the others from initiating until the active one completes.

I am looking at pages of relay logic to make each 'block'.

Any better suggestions?

Modicon.
Networks limited to 11 by 7 element arrays.

Keith Cress
Flamin Systems, Inc.-
 
Replies continue below

Recommended for you

Does order matter? Or, is it a case that it doesn't matter which one of the 20 goes, as long as another one doesn't go until the first one is finished?

In the case where order doesn't matter, you can sequence the blocks to run in series.

In the case where first come first run, you can use a double check. The first logic block checks to see if the holder is empty. If it is, it places its marker in the holder. On the next pass, it comes back to check to confirm that its marker is in the holder. Then it runs. This can account for sametime access conflict.

"Do not worry about your problems with mathematics, I assure you mine are far greater."
Albert Einstein
Have you read FAQ731-376 to make the best use of Eng-Tips Forums?
 
Is this a token holding app?

The branch that runs holds the token, releases the token when finished, the remainder fight for possession?

Dan
 
Hi Ashereng.

No the order doesn't matter. Basically it is a walk-up-to control system that the user can initiate a cycle(hydraulic)[one of 10 choices] by a switch. Cycles will probably take about 30 seconds. I want to prevent any other cycle from being started before the first selected cycle completes.

I was thinking of using logic like an OR on a data register but I haven't figured out how to get all the bits from the different cycles into the register. Only how to do the operations 'ON' the registers... [reading]

Keith Cress
Flamin Systems, Inc.-
 
Latter logic? Does that happen before of after Former Logic? I'm all confused now.

Sorry, couldn't resist. Turnabout is fair play!
 
In that case Keith, you scan through all the logic blocks in sequence/cycle. The first one with a request to run gets to run. The logic waits there until it is finished. Then, it continues scanning/cycle. Would that work?

"Do not worry about your problems with mathematics, I assure you mine are far greater."
Albert Einstein
Have you read FAQ731-376 to make the best use of Eng-Tips Forums?
 
I'd just assumed it was "Redneck Terminology".


"Do not worry about your problems with mathematics, I assure you mine are far greater."
Albert Einstein
Have you read FAQ731-376 to make the best use of Eng-Tips Forums?
 
Those are the worst, because spell checkers don't know the context is incorrect.

Does your PLC have Jump functions? If so, make up a matrix that jumps the program scan to only one logic block until a flag tells the matrix it is completed. Essentially the matrix is your input selections going to Jump functions corresponding to your desired logic block, and it has a series of NOR command flags in front of it. No flags active, the matrix is read and a Jump is initiated to that selected block, which then sets a NOR flag in front of the matrix so it is no longer scanned again until that flag is gone, which only happens when the logic block is completed. This way your CPU doesn't need to scan all the unused logic blocks every time. Speeds up execution.

Eng-Tips: Help for your job, not for your homework Read faq731-376 [pirate]
 
Ashereng I am not a Redneck!!!
The chickens are not allowed into our mobile home, as all of the coon dogs on the porch block their ingress.

Also... I NEVER let my 14 year old daughter smoke at the dining table in front of her kids.

jraef; I shall investigate that.

Thanks

Keith Cress
Flamin Systems, Inc.-
 
Keith,

Nothing wrong with being a redneck.

An alternative is the sequential function in your PLC. In the Plantscape system, they are called SCM (Sequential Control Module?).

You can use the sequential function blocks to do the scan and initiate which logic to run, and then return control to the SCM after the logic is completed.

I find that using the sequential function blocks is the "easiest" for others to read my progamming.

Most IEC 61131 supported PLCs should have the sequential function blocks.

"Do not worry about your problems with mathematics, I assure you mine are far greater."
Albert Einstein
Have you read FAQ731-376 to make the best use of Eng-Tips Forums?
 
Hiya-

Well, getting back to your original question, I would suggest
that if you have a "hit" from one of the pushbuttons, you
in addition to starting the process that you set a latching
coil that would not be turned off until the process is
finished. Ladder logic a normally closed contact with
the latching coil against all the 10 switches would "lock
out" the others until the one in process is finished.

Note that there will be a one cycle "lag" between the time
that the latched coil is set and it locking out the other
options, but that really shouldn't be a problem.

Hope this helps.

Cheers,

Rich S.
 
richs; I will investigate the latched coils. I thought they just latched thru a power cycle (documentation). you have opened mine eyes.

nbucska; If only I could.[cry] I could have designed a circuit, laid it out, stuffed it, programmed it, installed it and tested it in 2/3's the time it's taken me to get this Modicon software going and waded through its "latter" logic. Not to mention the price of everything.

Ah well.. the customer is king. It is interesting to go at something from a different direction occasionally.

Keith Cress
Flamin Systems, Inc.-
 
As jraef says, try using the jump or stage function if that PLC has such a thing (I'd think it would). Basically, the program is divided into sections, each with it's own jump or stage number. Then, you tell the program which jump or stage to run.

I recently used this with a Automation Direct PLC to communicate with 5 other PLC's over a rs422 network. Each stage had one of the communications blocks and it's last line was the command to jump to the next stage once that particular communications attempt was complete. The whole program had 10 communications stages, 5 for writing to each PLC and 5 for reading from each PLC. I also put other logic outside of the stages so that it runs all the time.

The only issue I'm not sure about is the scan time for all the stages to catch the input. I would think it would cycle through all of the stages very quickly since the stages would normally not be doing anything so you wouldn't see a time delay when providing an input but you may see a time delay between providing an input and getting the output.

 
Hi itsmoked;
It's been so many years since I did latter logic on a Modicom that it seems like earlier logic.
Can you give us a url to the programing instructions for the PLC you are using?
I started to write some suggestions and then realised that without even knowing the scanning protocal your device was using, I better get more information.
respectfully
 
itsmoked-

You mentioned:
"If only I could. I could have designed a circuit, laid it out, stuffed it, programmed it, installed it and tested it in 2/3's the time it's taken me to get this Modicon software going and waded through its "latter" logic. Not to mention the price of everything."

Ah, but think of the knowledge you have gained.

Although forced to use a PLC that is rather "complex" and
"expensive", there are other PLC's out there that may not
have the capasity of the larger PLC's, but are much more
economical. Entertron comes to mind for me. I believe
the president's name is Larry. A nice guy that has posted
here before.

And, although I can sling C with the best of them, ladder
logic programming *EASILY* solves a whole class of
logic replacement and control applications. Bunch of
switches and sensors, a bunch of outputs to motors, lights,
etc. No *REAL* time constrains, there 'ya go!

Soon there will be an open source PLC out there whose
hardware costs will be $2.00. No, not $20.00, or $200.00,
$2.00. I'm targeting for another month or two. We chatted
about this via email earlier. The others on this thread
might be interested.

With a $2.00 plc it opens up even more solutions to a much
wider class of applications. Embedded PLCs (at the board
level) usually isn't done, but it will be soon.

This little $2.00 critter is just a set of the PIC
micros. So, it would be wise to provide some protection
and interface electronics associated with the I/O of the
PIC. Still that's almost an advantage. You can pick and
choose relay, opto-isolator, open-collector, etc, etc.

So, say that you have a little $2.00 pic plc. Might have
6 or 7 inputs and the same number of outputs (as an
example). Well, think how quickly (now that you know
ladder logic programming) you can whip up a control system
sequence! Shoot, it's now the proverbial piece of cake!

Cool! That's why I didn't just brush off ladder logic
programming, just because I know conventional computer
(confuser) programming. It was a tool that I picked up
only a couple of years ago. The other languages were
*MUCH* (too much) earlier. Ladder logic programming can
be a real ace up your sleve!

And using multiple PLC's like LionelHutz has done allows
for a new programming paradigm. In the older days PLCs
were kind of "stand aloneish" or hooked to a bigger
confuser. Now, they are starting to form a multiprocessor
architecture themselves. Much more flexability and most
likely much faster implementation.

My suggestion is to stick with it!

Cheers,

Rich S.


 
waross; I can not give you a link to the instructions...

The only place I can find is a Snider "member site". And it only has one poor document relating.

Last night I figured out 'some' about PLC registers.

Taking for example the OR function:
If a contact closes the OR block ORs a register with the 'output' register then replaces the 'output' register's value with the result. Nowhere does the documentation explain how the registers ever got loaded with a number.

I would like all the coils to just be the values so I can do logic to "discover" if say 'any' coil is active.

Furthermore the OR function has one 'input' and one 'output' but according to the wee bit of information I have the output just exactly follows the input! It doesn't, say, follow the 'OR' like I would expect. (any bit set => output high)


Rich; While your project does sound interesting I am still trying to fathom the PLC project in front of me.

I also don't see how any PLC is going to sell for two bucks. I can't even buy a useful PIC for $2 let alone a board, screw terminals, IP, etc.



Keith Cress
Flamin Systems, Inc.-
 
Hi Keith;
I don't know if my comments are any help but I hope so.
I am sure you are familiar with the basic electro mechanical motor starter with the start stop buttton.
In boolean logic, this is the equivalent of an and module, with the output or'ed with one of the inputs.
That would be:
Stop button, AND overload relay AND (Start button OR Output)
Back in the days of GE static Control Modules and hard wired Boolean, one of the modules available was a "Sealed And" which was an And with one of the inputs Or'ed internally with the output.
A PLC scans the Inputs and the logic and then solves the logic and sets the output.
Some scan a line and then solve the logic and set the outputs. Scan the next line and solve the logic and so on.
Some scan a block and solve the logic and set the outputs. Scan the next block and solve the logic.
I have seen models that would scan all the inputs and all the logic and solve the logic and set the outputs.
Sort of like block scanning with only one block.
The scanning protocal is a feature that may be used to advantage.
On a line scanning PLC, use relays on consecutive lines.
On a block scanning PLC, use relays in consecutive blocks.
Each relay will be wired similar to the three wire motor circuit with the addition of inhibit contacts in series with the start button.
You ladder logic will now have inhibit contacts added in series with the start buttons.
You may have to break your 20 inputs into several groups and add a relay in each group to inhibit all groups.
The resulting circuit will not work with relay logic, but may be demonstrated as valid for a PLC that scans and sets either lines or blocks.
You will have to arrange for your sequence control blocks to release the relays when a control sequence terminates.
If this scheme were implemented with relays or with a PLC which scanned all the inputs and logic before setting the outputs, you would have issues if two buttons were depressed at the time that a control sequence released the inhibit command to the start control circuits.
With a line based scan and solve or a block based scan and solve, it will work well.
Hey Keith, if this is related to your problem in any way, I can suggest a few more tweeks. If I have misunderstood the problem there is no sense in wasting any more of our time in this direction.

Many years ago, I tried to implement a shift register in a Modicom PLC. The documentation said that it had shift register capability, but not how to use it. Technical support basically was trained on the same documentation that was provided with the PLC. It took a while, and, I am ashamed to say, just a few mild, satirical observations, (Not my fault if my satire was interpretted as sarcasm), but I was eventually connected with a very nice person who was able to explain the procedure for addressing a shift register.
Respectfully
 
Hi waross;

The way this Modicon PLC works is that it has piles of SEGMENTS. You can have umpteen of them. It also has NETWORKS. You can have a bunch of NETWORKS in any SEGMENT.

A NETWORK is 11 columns of logic NODES by 7 rows. (77)

The PLC solves all this by starting at SEGMENT 1, NETWORK 1, NODE 1 and then running down the 7 rows of the first column of the this first NETWORK. It then hops to the top of the second column and works down. When it has done all 11 columns it drops down to the first column of then next NETWORK. Etc etc .

SEGMENT 1
NETWORK 1
NETWORK 2
SEGMENT 2
NETWORK 3
SEGMENT 3
NETWORK 4
NETWORK 5
NETWORK 6
SEGMENT 4
NETWORK 7
ad nauseum

I believe some of this 'path of solution' is what causes me headaches in that when I'm 'online' and see the green wave of 'ON-ness' sweeping across the LL from left to right the right stuff never turns green. This has led me to think some left-side logic wasn't needed. So I remove it only to discover I have broken my function. LOL

Keith Cress
Flamin Systems, Inc.-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor