Jump to content
Sign in to follow this  
kikitron

Analog input to Digital output

Recommended Posts

Hi to all,

I have one question. I made simple program linearization for analog input 4-20mA to read pressure sensor 0-250bar.

I can read pressure from display without a problem.

Now I would like to add if pressure is 180bar or higher it has to activate digital output O 0.

I add this function but its not working.

Did I use wrong function?

Analog_input_test_4-20mA.U90

Share this post


Link to post
Share on other sites

Hi kikitron,

 

You used linearization for display.

The linearized value created in this way is used only for display purposes and cannot be used for ladder operations.

You have to use SI 80 - 85 to set the (x,y) range and energize SB 80 to activate the linearization function in ladder.

 

Or simply leave it as it is and use non-linearized value for the compare function (#794 instead of #180).

Share this post


Link to post
Share on other sites

 

4 hours ago, Kikis said:

You used linearization for display.

I didn't even look at the display - I can't remember the last time I used that feature.  I find it's not very useful for this very reason.

Good catch.

Joe T.

Share this post


Link to post
Share on other sites

Thanke you for your answers.

Yes I used linearization only for display.

#794 is perfect, so I just calculate pressure bettwen 205 and 1023, perfect :D

But I didnt remember to write linearization with program and I will try to write it to.

Share this post


Link to post
Share on other sites

Now I wrote linearization with program and its working perfect :rolleyes:

Now I have second question:

What happens if I use 2 or more analog inputs (sensors) and I can write linearizaion program only for the one.

Because if I use for first sensor SI 80 - 85 to set the (x,y), what  SI xx can I use for secon one or third ... ?

 

 

Analog_input_test_4-20mA_ladder.U90

Share this post


Link to post
Share on other sites

Move the scaled temperature out of the system integers and then repeat your logic for the next input.  

The system integers can be called as often as you like during a scan.  Your application will use them as buffers, not final results.

Joe T.

Share this post


Link to post
Share on other sites

Joe's answer is correct, but I well remember the first time I encountered this quirk of the program.  It is initially confusing that you are using the same things repeatedly for a different result, all in the same scan....but that's the way it works.

cheers,

Aus

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
Sign in to follow this  

×