Compare expressions in Classic Ladder?

More
27 Dec 2012 04:26 #28060 by machete
Hello, i'm trying to make two comparisons in one expression:

For example:
(%IF11=205)&(%W10=1)
((%IF11=205)&(%W10=1))
But Classic Ladder says Missing Parenthesis..

%IF11=205&%W10=1 - is not working

What is wrong with my expression?

P.S. Or is it possible to add extra columns in rungs (by default its only 10)?
(now i just cant perform 3 comparisons and 1 assignment in one rung)

Please Log in or Create an account to join the conversation.

More
27 Dec 2012 04:51 - 27 Dec 2012 04:54 #28061 by BigJohnT
If you want to "and" two comparisons just create two on the same line...

--[%W11=205]----[%W10=1]--

Logic words like IF are not part of classicladder.

John
Last edit: 27 Dec 2012 04:54 by BigJohnT.

Please Log in or Create an account to join the conversation.

More
27 Dec 2012 07:15 - 27 Dec 2012 07:15 #28067 by machete

If you want to "and" two comparisons just create two on the same line...

--[%W11=205]----[%W10=1]--

Logic words like IF are not part of classicladder.

John


Sure, but i need 3 of them + 1 assignment in one line:
--[PHASE=1]----[Y-COORD=205]----[SP-SPEED=0]----[PHASE=2]--

But in 10 columns i can set only 3 of them in one line.
Last edit: 27 Dec 2012 07:15 by machete.

Please Log in or Create an account to join the conversation.

More
27 Dec 2012 07:20 - 27 Dec 2012 07:21 #28068 by BigJohnT
Use the vertical connect tool, that should work.

--[stuff]--|
| --- |
| --[more stuff]---

Or break it up over two rungs...

John
Last edit: 27 Dec 2012 07:21 by BigJohnT.

Please Log in or Create an account to join the conversation.

More
28 Dec 2012 22:38 - 28 Dec 2012 22:46 #28122 by machete
OK, i brake it on two rungs.

But now i have to use modulus (to find shortest direction of rotation).


Integrator Manual V2.5
30.6.6 COMPARE

"ˆ (exponent),% (modulus),& (and),| (or),. -"

But how can i use modulus?

I tried, but it's all not working:
%(%IW11-%IW10)<=10 "Unknown term"
(%(%IW11-%IW10))<=10 "Missing Parenthesis"
(%IW11-%IW10)%<=10 "Unknown term"
((%IW11-%IW10)%)<=10 "Unknown term"
Last edit: 28 Dec 2012 22:46 by machete.

Please Log in or Create an account to join the conversation.

More
28 Dec 2012 22:45 - 28 Dec 2012 22:54 #28123 by machete
And another question: why coil %Q21 is marked "true", but contact %Q21 is "false"?

(Watch window is also shows false for %Q21)



UPD: OK, i understand - because %Q21 on the next line is flase :)
(I thought they will act "OR" but it is replace signal
Attachments:
Last edit: 28 Dec 2012 22:54 by machete.

Please Log in or Create an account to join the conversation.

More
28 Dec 2012 23:53 - 29 Dec 2012 00:00 #28125 by BigJohnT
That is a classic example of the "last one wins" rule for PLC's. Read the opening paragraph for Classicladder.

Also the second comparison on the first line will always evaluate to true with the rung wrapped around it.

John
Last edit: 29 Dec 2012 00:00 by BigJohnT.

Please Log in or Create an account to join the conversation.

More
29 Dec 2012 05:34 #28136 by machete
And wat about modulus?

=========

Integrator Manual V2.5
30.6.6 COMPARE

"ˆ (exponent),% (modulus),& (and),| (or),. -"

But how can i use modulus?

I tried, but it's all not working:
%(%IW11-%IW10)<=10 "Unknown term"
(%(%IW11-%IW10))<=10 "Missing Parenthesis"
(%IW11-%IW10)%<=10 "Unknown term"
((%IW11-%IW10)%)<=10 "Unknown term"

======

what is wrong in my expression?

Please Log in or Create an account to join the conversation.

More
29 Dec 2012 06:29 #28139 by BigJohnT
Dunno, I can't get modulus or power to work... if I find out something I'll holler.

John

Please Log in or Create an account to join the conversation.

More
30 Dec 2012 00:40 - 30 Dec 2012 00:41 #28159 by machete

Dunno, I can't get modulus or power to work... if I find out something I'll holler.

John


This is very strange.

Without modulus i have to "scratch my left ear by right heel"...

Maybe this is a bug? (also with "and")?
Last edit: 30 Dec 2012 00:41 by machete.

Please Log in or Create an account to join the conversation.

Time to create page: 0.115 seconds
Powered by Kunena Forum