Jump to content

V700 , Float to Integer , Integer to Float


Recommended Posts

Hi , it's my first post,  sorry if i didn't post at the good place.

I'm working on Visilogics , V700 PLC , and i want to communicate with a VAR to pick up Real Value , i recieve 2 Words of 16 Bits , the first for MSW and second for LSW. this is my parameter's value.

I need to interpret this value , but the function in Visilogics to convert Integer to Real are for FIXED point , not FLOATTING point , it means it doesn't work in my case , so i came here to ask you guys if there is something i can do , to avoid having to dissect my both words into mantisse and exosant , and use a formula.

And if there is no function to do it , can you explain to me how to make it simple with this example:  110,1 parameters give me  17 116 for MSW and 13 107 LSW.

This is my first automatician job (that will make me validate my graduate) and i'm still learning , this is the first time i encounter that case , where i have to do it manually so i really need your help please.

Link to comment
Share on other sites

14 hours ago, Gaylord Williams said:

Hi , it's my first post,  sorry if i didn't post at the good place.

I'm working on Visilogics , V700 PLC , and i want to communicate with a VAR to pick up Real Value , i recieve 2 Words of 16 Bits , the first for MSW and second for LSW. this is my parameter's value.

I need to interpret this value , but the function in Visilogics to convert Integer to Real are for FIXED point , not FLOATTING point , it means it doesn't work in my case , so i came here to ask you guys if there is something i can do , to avoid having to dissect my both words into mantisse and exosant , and use a formula.

And if there is no function to do it , can you explain to me how to make it simple with this example:  110,1 parameters give me  17 116 for MSW and 13 107 LSW.

This is my first automatician job (that will make me validate my graduate) and i'm still learning , this is the first time i encounter that case , where i have to do it manually so i really need your help please.

I answered something like that a couple weegs ago.

https://forum.unitronics.com/topic/9447-conversion-the-value-of-a-ieee-754-floating-point/

If I understood correctly you have 1 32 bit  float stored in 2 16 bit MI, you can use the structure function to "Copy" those 2MI on a 1MF. Being the standar Float type AND assuming byte order is the same it will work, if byte order is different you can use swap bytes before structure

Link to comment
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
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.