Jump to content

Math function to analog output


Recommended Posts

Hello!

I make a program for a battery charger. For charge the battery i need two voltage level (Floating at 270V and Boost at 276V) :

The piece of programm is in the attached file.

 

I use two set point ( I can increment or decrement the two set point on the screen) :

- MI20 : Floating voltage set point

- MI22 : Boost voltage set point

Then, i use a SUB function to obtain MI4 :  the difference  between MI22 and MI20

Next , i use a ADD function to obtain MI23 : The sum of MI20 and MI4

The MI23 is linearized and send to the analog output MI21

 

This doesnt work because the out of the math function not include the state of the bit MB 31 at the input.

 

In fact, i would send 270V (MI22) to the analog output when the MB31 is off, and send 276V (MI20) to the analog output when the MB31 is ON.

Would anyone have a solution?

And sorry for my english! :)

 

 

 

 

Set up voltage.jpg

Link to comment
Share on other sites

  • MVP 2023

Perhaps I don't understand what you're doing because it seems simple and obvious what to do. Use a buffer MI to store the value you want to go to the analog output. Use two rungs, one with a direct contact of MB 31 to store MI 20 to your buffer MI and a second rung with an inverted contact of MB 31 to store MI 22 to the buffer MI. Use the buffer MI in the Linearization function block.

Link to comment
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
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.