Hello,
It my first post here!
I have been programming on Schneider PLC for the last few years and am now doing some work with RSLogix. RSLogix is testing my patience because it seems to think it knows how to do things better than I do.
I am trying to write some equations in ST that use variables of different data types. I understand that RSLogix handles the casting of these variables behind the scenes, but I want to ensure the casting is done in a specific order. How do most people handle this?
EXAMPLE:
iScn - INT
iTmK - REAL
e - REAL
K - REAL
K := e**(iScn / iTmK);
How do I ensure iScn is cast as a REAL? Alternatively, the PLC could cast iTmK as an INT and then cast the solution as a REAL before computing the exponent?
Cheers
It my first post here!
I have been programming on Schneider PLC for the last few years and am now doing some work with RSLogix. RSLogix is testing my patience because it seems to think it knows how to do things better than I do.
I am trying to write some equations in ST that use variables of different data types. I understand that RSLogix handles the casting of these variables behind the scenes, but I want to ensure the casting is done in a specific order. How do most people handle this?
EXAMPLE:
iScn - INT
iTmK - REAL
e - REAL
K - REAL
K := e**(iScn / iTmK);
How do I ensure iScn is cast as a REAL? Alternatively, the PLC could cast iTmK as an INT and then cast the solution as a REAL before computing the exponent?
Cheers