Author Topic: Switching and connecting 2 analog signals  (Read 7834 times)

Offline Daan

  • PLUS+1 Developer
  • ***
  • Posts: 23
  • Karma: +1/-0
Switching and connecting 2 analog signals
« on: March 20, 2023, 01:32:56 PM »
Hello everyone!

I have a problem and I hope you can help me with it.

I have an analog signal that can vary from 0-12V as well as 0-24V. How can I ensure that depending on whether the supply voltage is 12 or 24V, the correct analog signal is scaled?

Is it possible to connect these 2 analog signals to 1 analog output without this giving an error?

Thanks in advance for all the help!
Junior Mechanical Engineer

Offline G30RG3

  • PLUS+1 Expert
  • ****
  • Posts: 74
  • Karma: +3/-0
Re: Switching and connecting 2 analog signals
« Reply #1 on: March 20, 2023, 05:33:32 PM »
Compare the source voltage to a fixed value, the output from that compare can be used to (binary) switch the right result from your scaling operation.
Or if needed compare the source voltage to a few fixed values to switch between the scaled outputs and in a "in between source voltage" give a fixed voltage that is "out of range" to provoke an error

Offline FluidPowerTom

  • PLUS+1 Guru
  • *****
  • Posts: 363
  • Karma: +33/-0
Re: Switching and connecting 2 analog signals
« Reply #2 on: March 20, 2023, 10:52:13 PM »
As G3 was mentioning you could use a comparison on the source voltage.  For most controllers that'll be C1P2.voltage, and you could just check to see if it's greater than 20V to determine which voltage source you've got.

No, you can't connect the signals as you've done in that image.  You will want to use either a Boolean Switch or a couple of Value Connect components along with that comparison that I mentioned.
Controls Engineer
Hydra-Power Systems

Offline Daan

  • PLUS+1 Developer
  • ***
  • Posts: 23
  • Karma: +1/-0
Re: Switching and connecting 2 analog signals
« Reply #3 on: March 21, 2023, 10:06:37 AM »
Thank you for the information G30RG3 and FLuidPowerTom!

I understand the comparison with the supply voltage, but I don't understand how and with what it is connected to the scaling? You talk about a certain switch but I don't really know what component you mean by this. I have only recently started programming in PLUS+1 GUIDE, so I have not mastered the program very well. Would it be possible to show an example of the components or tell me where to find them?

Thanks in advance for all your time and help!
Junior Mechanical Engineer

Offline Lukey

  • PLUS+1 Expert
  • ****
  • Posts: 68
  • Karma: +6/-0
Re: Switching and connecting 2 analog signals
« Reply #4 on: March 21, 2023, 03:00:21 PM »
Daan as FluidPowerTom said, try Switched 2 component.
Connect you ABS output value/s to each of the switch legs on the left of the Switch 2 component, the output leg of the Switch 2 then goes to the Currentout.
The switch leg on top of the Switch 2component connects to the >20 comparison component output.
You wont need the <20 comparison.
« Last Edit: March 21, 2023, 03:03:18 PM by Lukey »

Offline Daan

  • PLUS+1 Developer
  • ***
  • Posts: 23
  • Karma: +1/-0
Re: Switching and connecting 2 analog signals
« Reply #5 on: March 21, 2023, 03:33:47 PM »
Hello Lukey

My apologies to all of you, I over looked this. But thanks for all the help! The program now works without any problems!  ;D
Junior Mechanical Engineer