need help in classicladder comparison object
- Coordinates
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
20 Dec 2021 17:50 #229566
by Coordinates
need help in classicladder comparison object was created by Coordinates
i need help how to use exponent and modulus in classicladder there is not enough examples in linuxcnc documents i want to use them for tool turret logic Thanks.
For arithmetic comparison. Is variable %XXX = to this number (or evaluated number)The compare block will be true when comparison is true. you can use most math symbols:
For arithmetic comparison. Is variable %XXX = to this number (or evaluated number)The compare block will be true when comparison is true. you can use most math symbols:
- +, - ,* , /, = (standard math symbols)
- < (less than), > (greater than), <= (less or equal), >= (greater or equal), <> (not equal)
- (, ) grouping
- ^ (exponent),% (modulus),& (and),| (or),. -
- ABS (absolute), MOY (French for average) ,AVG (average)
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 4947
- Thank you received: 1364
20 Dec 2021 18:28 #229567
by Todd Zuercher
Replied by Todd Zuercher on topic need help in classicladder comparison object
To do a modulus 12 of the value held in %IW0. You would need to use an Assignment box to set the answer to a variable. To assign the answer to variable %QW0, you would type the following in the assignment field. (Not sure if I ever tried it in a compare field but in theory should work.)
Using the exponent function should be similar. [%QW0=%IW0^3] should cube the %IW0 value.
I don't think I was ever successfull in using the &, | math functions, so I just did two comparisons and built the and/or logic into the ladder.
%QW0=%IW0%12
Using the exponent function should be similar. [%QW0=%IW0^3] should cube the %IW0 value.
I don't think I was ever successfull in using the &, | math functions, so I just did two comparisons and built the and/or logic into the ladder.
The following user(s) said Thank You: Coordinates
Please Log in or Create an account to join the conversation.
Time to create page: 0.075 seconds