Sign in to follow this  
Followers 0
rswolff

Conversion

3 posts in this topic

Siemens S7-300........I can convert from INT to DI.....and from DI to REAL. I don't see any standard method of going backwards from REAL to DI and from DI to INT

My actual application needs to go from REAL to INT (DI to INT is kinda dumb)

Thanks, Bob

Share this post


Link to post
Share on other sites

RND (conversion of a 32-bit IEEE floating-point number to 32-bit integer) interprets the contents of ACCU 1 as a 32-bit IEEE floating-point number (32-bit, IEEE-FP). The instruction converts the 32-bit IEEE floating-point number to a 32-bit integer (double integer) and rounds the result to the nearest whole number. If the fractional part of the converted number is midway between an even and an odd result, the instruction chooses the even result. If the number is out of the permissible range, then the status bits OV and OS are set to 1. The result is stored in accumulator 1.

Conversion is not performed and an overflow indicated in the event of a fault (utilization of a NaN or a floating-point number that cannot be represented as a 32-bit integer number).)

Share this post


Link to post
Share on other sites

thanks.......thats what I needed.:-)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0