foxtrot99

help with calculation and roundup from real

3 posts in this topic

I want to do a calculation in the FX3u-48MT ESS and combine it with the input from HMI GOT1020. By the time i put input in the HMI with real number, and i calculate that with some equation just like in the manual as seen in the picture. I was confused when the result in the DINT is too many and in the pulse, it got minus, when it should be plus. Is there any way to fix this ? and how to round up the result correctly ?

I really appreciate your help. Thanks in advance.

 

tanya.jpg

Edited by foxtrot99
wrong picture

Share this post


Link to post
Share on other sites

The result of your DINT instruction is 32-bit, but your PLSY instruction is only 16-bit. So you're seeing the decimal representation of the lower half of a 32-bit word, which is basically useless. You need to use DPLSY, the 32-bit version of the PLSY instruction.

1 person likes this

Share this post


Link to post
Share on other sites
5 hours ago, JRoss said:

The result of your DINT instruction is 32-bit, but your PLSY instruction is only 16-bit. So you're seeing the decimal representation of the lower half of a 32-bit word, which is basically useless. You need to use DPLSY, the 32-bit version of the PLSY instruction.

wow, thank you so much. it solved. i really appreciate your help.

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