Exponential functions

Join Date
Sep 2016
Location
norway
Posts
2
Hi all, this is my first post here and i hope you can help.

I am using a Omron CJ2M CPU31 and i am struggeling with an error in structured text when am working with exponents.

I can do 100,0**2
But not:
test1 =: 100,0;
test2 =: test1**2,0;

This leads to an compile error: KBASE 'constant out of range' error.

Any sugestions on how to avoid this issue?
 
Hey,

Thank you for the reply. I figured out how to do it, but its still a little weird to me that the compiler did not accept it as it was.

I had to store mye "power" in a variable as well
test1 =: 100,0;
test2 =: 2,0;
test3 =: test1**test2;
 

Similar Topics

Given y = 2^x . Find x when y is known. IF x is not a whole number, reject it ( move -1 to result). 1. Given CPT, XPY, LOG available 2. Can...
Replies
16
Views
5,020
Recently I posted about a process that was poorly designed with the PV being upstream from the control, but there is a new hurdle in this process...
Replies
17
Views
5,407
is it possible to change the display of real numbers in codesys 3.5 while online from exponential to decimal values?
Replies
0
Views
1,993
Can anyone explain why the following expression, used in a CPT block, does not work in RSLogix 5000? I am storing the result in a DINT tag...
Replies
5
Views
2,534
Have to perform an operation based on the equation: y = x^0.993 Is it possible for the PLC to compute this ? CPT instruction doesnt seem to cut...
Replies
4
Views
13,447
Back
Top Bottom