Jump to content

Recommended Posts

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.

image.thumb.png.d3d7f4a0659bc46a531d19467a8111b2.png

 

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Why not simply use a second linearization function?

LinConv.thumb.png.91ee63bd3a4489076cb780a04aa3aa74.png

 

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).

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...