Jelmer Posted November 9, 2017 Report Share Posted November 9, 2017 Hello, I'm have some problems with the conversion of two integers to a floating point value. I have a modbus energy meter (SDM120) who works with 32bit IEEE745 floats values. In visilogic I receive two 16bit integers (MI); MI0 : 15643 MI1: -23069 I converted these integers to bits by the 'num to bit' function block. These are the converted value's : MI0 : 15643 --> 0011 1101 0001 1011 MI1: -23069 --> 1010 0101 1110 0011 If I put the two value's behind eachother I get the following binary code: 0011 1101 0001 1011 1010 0101 1110 0011 (MI0,MI1) When I fill in these binary code on a online binary to IEEE745 converter I get the following result: 0,038 This matches with the amps showing on the energy meter's display. The question is; How can can I make from MI0(15643) and MI1(-23069) a float in Visilogic So, MI0(15643) and MI1(-23069) -------------- some kind of formula -----------> MF0 = 0,038 Annyone who can help? Best regards, Jelmer Link to comment Share on other sites More sharing options...
Isakovic Posted November 10, 2017 Report Share Posted November 10, 2017 Looks like this is always the case with energy meters. You use "Struct" block under Vector -> Struct for merging those two registers into a float. There is an explanation for struct block in help file. After that use math function blocks for floats to extract the values if you need them converted to int. 1 Link to comment Share on other sites More sharing options...
vken Posted October 2, 2020 Report Share Posted October 2, 2020 Hi, I have exact the same problem but I'm using unistream US5-B10-TR22 and I really can find a solution. is there anyone to give a hand Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted October 2, 2020 MVP 2023 Report Share Posted October 2, 2020 1 hour ago, vken said: I have exact the same problem but I'm using unistream US5-B10-TR22 and I really can find a solution. is there anyone to give a hand I recommend posting your question in the UniLogic forum rather than the VisiLogic forum to get help. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now