Author Topic: 0-10V output range help  (Read 13305 times)

ufoDziner

  • Newbie
  • *
  • Posts: 2
  • I'm a llama!
    • View Profile
0-10V output range help
« on: September 02, 2013, 09:47:24 AM »
Hello,
  I'm setting up a F1616-BA in what is initially a fairly simple machine.  One feature that I have no experience with is the custom functions.  There is a pressure transmitter in my system that has a 0-10V output.  Somewhere in that range is what I need for a usable range.  I'm not sure what the voltage range is yet, as this is my first time using one of these transmitters.  For the sake of discussion, we'll call 4-6V the range that I would like the relay assigned to this unit to be Open.  Anytime the voltage is outside of that range, I'd like the relay to be closed.  Is there sample code that I can look at somewhere that has an example similar to this one?  If not, any help is greatly appreciated.
« Last Edit: September 02, 2013, 09:47:46 AM by ufoDziner »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:0-10V output range help
« Reply #1 on: September 03, 2013, 08:48:16 PM »
You can use a clock pulse to periodically trigger a custom function which will read the ADC and compare it. If it falls in the range to turn ON/OFF a digital outputs you can use the SETIO command or CLRIO command.


E.g.

        Clk:0.2s                checkADC
|------||-----------------------{dCusF}


Inside checkADC function you can put statements such as:

A = ADC(1)

IF A >  ???  and A < ???  THEN
     SETIO Valve
ELSE
     CLRIO Valve
ENDIF

Valve is assumed to be the label name of an output.
« Last Edit: September 03, 2013, 09:09:54 PM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:0-10V output range help
« Reply #2 on: September 03, 2013, 09:11:57 PM »
If you need helps in understanding how to use the custom function, please refer to the following thread:

http://www.triplc.com/yabbse/index.php?board=2;action=display;threadid=1817

You should find that it is really quite easy to use custom function for complex control task compared to pure ladder logic once you see and simulate the sample codes.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

ufoDziner

  • Newbie
  • *
  • Posts: 2
  • I'm a llama!
    • View Profile
Re:0-10V output range help
« Reply #3 on: October 02, 2013, 10:33:19 AM »
Thanks for the help!  I implemented the snippet you provided, and it works perfectly in the simulation.  Once I get my usb-serial converter I'll be able to test using the plc.  I'll read through the custom function examples (I didn't see any immediate examples, but it was a somewhat hasty check).