luis.lmtz Posted August 24, 2018 Report Posted August 24, 2018 Hello, I am using a V570 with V200-18-E2B snap IO. Software version is 9.8.65 I am linearizing a pressure sensor (4-20 ma) to be able to read from 0 to 30.00 inHg. As you can see in the image below I made y2 a value of 3000 to be able to display it with 2 decimals in the HMI. However I still need to get it with 2 decimals into a Float (MF) to be able to convert this value to mbar by multiplying it by 33.86. So basically what I can't figure out is that if I get a value 3000 (30 inHg) I need to be able to put into a float 30.00, If I get 15 should be able to put into a float 00.15 and so on. Is this something that can be done by using Num to Ascii and putting the ascii value into 2 MIs? then using those 2 MIs into a float convert A+b/n? I am hoping somebody point me in the right direction in how to achieve this. Thanks in advance
luis.lmtz Posted August 24, 2018 Author Report Posted August 24, 2018 This is what I did and the result is very close. However I still need to know how to do it the other way described in my previous post.
sgull Posted August 26, 2018 Report Posted August 26, 2018 Hi You could use the formula function to do the calculation. Feed in the MI into the formula and divide by 100 and save as an MF, then multiply as normal.
Bisku Posted August 27, 2018 Report Posted August 27, 2018 Why not simply use a second linearization function? Besides that, be aware that you are demonstrating a precision which is not existing, when you display the inHG-Value with two decimal digits. Your PLC can only read 819 value points (highest value 1023 - lowest value 204), which means every increase of MI0 by 1, will increase MI 1 by 3,663 (3000 inHG / 819).
MVP 2023 Flex727 Posted August 27, 2018 MVP 2023 Report Posted August 27, 2018 I see no reason to use Float for any of this. Just multiply the numbers, use MLs for the result, divide to get the precision you want, and keep track of where the decimal is for displaying.
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