# Compare expressions in Classic Ladder?

30 Dec 2012 01:07 - 30 Dec 2012 01:17 #28160
by BigJohnT

Replied by

*BigJohnT*on topic*Compare expressions in Classic Ladder?*
And works for me

Edit: and on a gut feeling I just typed in modulus and it worked!

I need to add some examples to the manual now that we have figured out how to use them

John

`%W1and%W2=%W3`

Edit: and on a gut feeling I just typed in modulus and it worked!

I need to add some examples to the manual now that we have figured out how to use them

John

Last edit: 30 Dec 2012 01:17 by BigJohnT.

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

31 Dec 2012 21:12 #28227
by BigJohnT

Replied by

*BigJohnT*on topic*Compare expressions in Classic Ladder?*
Did you get modulus to work?

John

John

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

01 Jan 2013 21:04 - 01 Jan 2013 21:07 #28252
by machete

Replied by

*machete*on topic*Compare expressions in Classic Ladder?*
I'll try it couple of days later (now is holidays in Russia).

P.S. You mean my expression will be: "modulus(%IW11-%IW10)<=10"?

P.P.S. Happy New Year!

P.S. You mean my expression will be: "modulus(%IW11-%IW10)<=10"?

P.P.S. Happy New Year!

Last edit: 01 Jan 2013 21:07 by machete.

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

01 Jan 2013 21:10 - 01 Jan 2013 21:25 #28253
by BigJohnT

Replied by

*BigJohnT*on topic*Compare expressions in Classic Ladder?*
What worked for me was:

Although I'm not sure of the output it passed the syntax check.

Edit: I'm pretty sure the above is incorrect... I got the expected results from the following

John

```
3modulus2>2
%W1modulus%W2>%W3
```

Although I'm not sure of the output it passed the syntax check.

Edit: I'm pretty sure the above is incorrect... I got the expected results from the following

```
(2+3)&(3+2)=5
10%3=1
```

John

Last edit: 01 Jan 2013 21:25 by BigJohnT.

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

01 Jan 2013 21:29 #28254
by machete

Replied by

*machete*on topic*Compare expressions in Classic Ladder?*
Hmmm..

Looks like Google Translate play a joke with me..

In Russian word modul' means:

|3|=3

|-3|=3

But GT translate it like "modulus"...

And "mod" is dividing operation 3mod2=1

So, I just need to know a difference between two variables without sign.

Maybe I just need ABS???

P.S. If so, sorry my stupidness..

Looks like Google Translate play a joke with me..

In Russian word modul' means:

|3|=3

|-3|=3

But GT translate it like "modulus"...

And "mod" is dividing operation 3mod2=1

So, I just need to know a difference between two variables without sign.

Maybe I just need ABS???

P.S. If so, sorry my stupidness..

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

01 Jan 2013 21:45 #28256
by BigJohnT

Replied by

*BigJohnT*on topic*Compare expressions in Classic Ladder?*
Yes modulus is the remainder of a division. 10/3 has a remainder of 1 so the modulus is 1

I have managed to get the absolute to work with the following syntax.

John

I have managed to get the absolute to work with the following syntax.

```
ASSIGNMENT
%W2=-1
COMPARISON
ABS(%W2)=1
```

John

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

Time to create page: 0.332 seconds