Sign in to follow this  
Followers 0
simon Ong SK

Floating Point Conversion

2 posts in this topic

Guys: Anybody Know how to display Floating Point Value or conversion using Hostlink Command? Say : D100 has a Value of 1.003 (at PLC). By using Hostlink with VB, Which Command should I use? @00RD01000002FCS?? Then How would I convert in VB to Float? Thanks

Share this post


Link to post
Share on other sites
Firstly, the data would be over D100 and D101... Look in the manual at floating point and it will give you the IEEE format that this data is stored in. IE what part relates to the manisa and the exponent.....You will then see how to extrapolate the correct data to format it it in vb....a bit of work.... Another method, depends on the size of the integer part, would be to multiply by 1000 say you floating point number then convert this to a double bcd and presto D+1 willl contain the integer protion and D will contain the decimal portion.....

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