Why won't this calculate

Tom@Pton

Member
Join Date
Dec 2009
Location
Central Nebraska
Posts
159
XIC B3:12/9 BST XIC O:2.0/2 NXB XIC O:2.0/1 BND GRT N7:30 0 GRT N7:40 0 BST CPT N7:79 ( N7:75 | ( N7:40 - N7:30 ) ) * 3600 NXB NEQ N7:29 N7:79 ONS B3:14/7 BST DIV T4:38.ACC T4:38.PRE F8:65 NXB MUL N7:79 F8:65 N7:83 NXB MOV N7:83 T4:38.ACC BND BND

Frustrated and I can't figure out how to post a pdf either.

Have I entered the cpt portion correctly?
 
are you sure that the processor is scanning the rung? ... did you start a new ladder file - and forget to put a JSR in the main file? ...
 
no, I am attempting to drive myself nuts (60|(600-100))*3600 may work on my calculator but doesn't work for didly with integers. Guessing now they should have been F.
 
that's probably the answer - I'll check back after supper - but I think that you're on the right track with the integer/float idea ...
 
Try this

CPT N7:79 3600.0 * ( N7:75 | ( N7:40 - N7:30 ) )

Make the constant a float to force type casting the other elements to a float for the computation. Your result will still be a rounded integer.
 
Try this

CPT N7:79 3600.0 * ( N7:75 | ( N7:40 - N7:30 ) )

Make the constant a float to force type casting the other elements to a float for the computation. Your result will still be a rounded integer.
Doesn't compile on my system. If any of the operands are floats, the destination must be a float.

EDIT: Compiles on a SLC but not on a ML1400... interesting.
 
Last edited:
with a calculator all numerical values are Floating Point.
So YES it must be done in 'F' not 'N'
try using your calculator by deleting any amount after the Decimal point

(60|(600-100))*3600
1. = 600-100 = 500
2. = 60 / 500 = 0.12 {remove the 0.12} = 0
3. = 0 * 3600 = 0
this is the Correct answer if you use integers
STEP 2 is causing the problem
with out the error
2. = 0.12 * 3600 = 432

lets change your formula to ((60 * 36) / (600 - 100))*100

1. = 600-100 = 500
2. = 60 * 36 = 2160
3. = 2160/500 = 4.32 {- 0.32} = 4
4. = 4 * 100 = 400

you can play with that if you still want to use Integers
 

Similar Topics

I have a managed InTouch Application that I deployed changes to through Archestra IDE yesterday. The only changes I made was adding a solenoid...
Replies
3
Views
88
Does anyone have any experience of using an ***** Flexy for remote programming/maintenance of a Codesys based controller? Rather than using the...
Replies
6
Views
223
So I'm pretty green when it comes to troubleshooting in the field so bear with me. We have a Danfoss valve that opens/closes from an analog output...
Replies
23
Views
950
HI i have a delta VFD M-series in the manual, in order to enter the motor rated current you set the parameter P,52 =the motor rated current my...
Replies
7
Views
659
Hello! We are using a ControlLogix 1756-L72 PLC with two identical servo motors running separate conveyor belts. The machine this is on runs...
Replies
4
Views
961
Back
Top Bottom