loly

conversion of engineering units to raw value

10 posts in this topic

1. How to convert the engineering to raw values.

2. I need technical support regarding IsaGraf version 3.55. I did one sample program by using a selector block. However, the user-defined block supports only integers. How to get the result as real by using this block.

Share this post


Link to post
Share on other sites

I don't know that software, but...I've seen it done before where the floating point value is multiplied by 100 and stored as an integer. That gets you 2 decimal places. You can then work with it as an integer and then divide by 100 to get it back to a floating point.

Or, if it's just scaling you're doing, the formula isn't complicated. You could just skip the block and use math instructions directly.

Share this post


Link to post
Share on other sites

Will you please elaborate on the steps. I have attached the selector block image for your reference. How is the selection operation is done by using math...kindly guide me as soon as possible. I am waiting for your reply.

Capture.JPG

Share this post


Link to post
Share on other sites

I think I misunderstood your first post, thinking you had one question instead of two.

To scale engineering to raw, you're going to use ratios.

EngSpan = EngMax - EngMin
RawSpan = RawMax - RawMin

Ratio = RawSpan / EngSpan

Raw = Ratio * (Eng - EngMin) + RawMin

Most of the scaling I've done is zero-based, where the EngMin and RawMin are both zero. That simplifies things:
Ratio = RawSpan / EngSpan
Raw = Ratio * Eng

 

On your second question, that block doesn't appear to do much. It just decides which of two numbers to pass on to the third register based on the value of a boolean flag. There isn't any scaling or conversion done there. Does your software have a "Copy" or "Move" instruction that works with floating point values? If so, just use two of those instructions, selecting them based on the value of your boolean flag. Beyond that, I'm afraid I won't be of much help with that since I've never used that software.

Share this post


Link to post
Share on other sites

Actually, I used to get the result by using the given formula,

Out = In * ((EU_Max - EU_Min) ÷ (Raw_Max - Raw_Min)) - (Raw_Max * ((EU_Max - EU_Min) ÷ (Raw_Max - Raw_Min)) - EU_Max)

For eg. In=12mA Eng min=0c Eng max=100c Raw min=4mA Raw max=20mA

Out=50c

It suits to get the above result. But the Raw value min (4mA)=6241 and Raw value max(20mA)=31206 instead of these the formula fails to get the result.

So how to satisfy both the Raw value data by using the formula. Kindly guide me. I am waiting for your reply.

Edited by loly
To give the example

Share this post


Link to post
Share on other sites

I don't know the software or controller you are using either.

Can you see the value "In" from your memory location? What is this value?

 

Share this post


Link to post
Share on other sites

Hai,

I need one standard formula for getting the result. Input = 12mA , Raw min=6241, Raw max=31206, Eng min=0, Eng max=100. If you have any queries let me know.

Share this post


Link to post
Share on other sites

How to replace the selector block by using other operations. Kindly guide me. In that software does not contain move or copy options, then how to achieve the result. We don't know how to do the selection process. If the boolean input true-output selects second input and boolean input false-output selects first input...

Share this post


Link to post
Share on other sites

The formula is a standard scaling formula and will work.

mA is the physical signal. Raw is the converted value in hardware. Engineering Unit is the human readable value.

If you wish to know what the converted value should be for 12mA then do the same formula where 12mA is the Raw and converted value is the EU.

Raw Min = 4mA

Raw Max = 20mA

EU Min = 6241

EU Max = 31206

Share this post


Link to post
Share on other sites

It is very helpful. Thanks for your support.

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