Ladder Logic for Variable Analog Output (0-10vdc)

Discussion in 'Embedded Systems and Microcontrollers' started by vinniestruck, Oct 30, 2012.

  1. vinniestruck

    Thread Starter New Member

    Oct 30, 2012
    After reading through some of the other threads in this forum, I beleive I am in the right place!

    I am looking for a little assistance in writing a few lines of Ladder to control a very simple Analog Output used to control fluid pressure for a test.

    What I would like to be able to do:

    After I complete the rung of the ladder for "Run", I would like to have my analog output start at 0vdc and ramp up to 10vdc. I would like to include a time variable that can easily be changed to increase and decrease the ramp speed (So that I can control how fast I am ramping up my pressure).

    If I could get a professional point me in the correct direction, I would greatly appreciate your talents and support.

    As this program will not be controller specific, I am assuming that you will not need to know what I am using.

    Thanks again for any support you can provide.
  2. bertus


    Apr 5, 2008
  3. panic mode

    Senior Member

    Oct 10, 2011
    every PLC has advanced functions that allow data manipulation on a higher-than-bit level. most have PID loops and usually they are just ladder instructions too. but to help more first we need to know the brand and model of PLC and used software.
    in general, once the analog card is initialised and analog channel is configured and enabled, you can simply write a value to it using MOV or RAMP instruction or whatever your PLC supports.
  4. panic mode

    Senior Member

    Oct 10, 2011
    one way to accomplish what you ask is shown below on a SCL500 example. in this case, for simplicity (and to let you do the rest), i only show how to ramp up but you can easily change this to whatever you like, for example also ramp down etc. Hint. you may want to drop output on reset, before next ramp is requested.

    btw. in this example it was assumed that DI card is in slot1 and AO card is in slot2. also, i used simplest code (fewest instructions) to make a simple ramp. there is a caveat - if you change preset for T4:0 while ramp is in progress, output will jump. the simplest way is to block changes of T4:0.PRE while T4:0.TT is high. the other way for example (more flexible) is to change the value of an increment (if you are using counter). there are many ways to skin the cat... but i don't want to reveal too much.

    as bertus suggested, basic ladder functions are just about the same on all PLCs (NO, NC, Coil, ...) but - that's about it. even one shots, counters and timers are different. actually when it comes to anything beyond basic instructions, 99.9% of them are brand specific, just like addressing. you will see that first scan flag is different on Control Logix (also AB but another newer line of PLCs) and there is no SCP instruction. Difference is even bigger when you move to other brand such as Omron, Mitsubishi, Siemens, Modicon, Panasonic, AD etc. you will not see the very handy SCP instruction anywhere else. if you like it, you would need to implement it using whatever instruction set is available on that particular platform. sorry to burst your bubble but... PLCs are just not very compatible, at least when it comes to languages and instructions.
    Last edited: Nov 1, 2012
  5. Markus Sparkus

    New Member

    Jul 26, 2012
    I have to disagree. With a digital to analogue module, ladder logic is exactly how you contol your analogue output. The question asks for ladder ideas.
    Because many are Manufacturer specific, the ladder logic examples may not be easy to read.
    However, most now come with FB's (special Function Blocks'), which provide pre-scale (0-10V DC is a pretty industry standard), time lapses, hysterises, etc all in one. You should read the pdf. for a simple PLC like the LOGO, or other similar PLC's as they have the simplest introductions to analogue control.

    Good question though. Decide how simple you PLC can be - and read that model - they all do the same, but are told to do so in machine specific ways.

    NB: I like the example below. Looks nice and simple and includes reset!
  6. Skumar1972

    New Member

    Dec 31, 2012
    I would like to do the ladder logic to generate the Analog output by using the Delta DVP series PLC. I am giving the encoder input to the PLC and by reading the encoder value, the analog output should change 0 to +10V dc. Please help us. Thanks for your supports
  7. panic mode

    Senior Member

    Oct 10, 2011
    i have not used Delta but assuming that your I/O is already configured, just use move instruction to copy value
  8. nlm2008

    New Member

    Jan 5, 2016
    Hi all,

    I also need to do almost the same things here, I would like to generate analog output signal send it to digital regulator.
    i am using sysmac studio, and CJ1W-DA021 Analog Module. I configured the module using chanal 1 and output range 0-10v and set value 2000.
    the pressure signal come from multipy two values from hmi.
    my question is how to scale the pressure value to give me the desire out put .
    I found this formula A= U * 4094/(H-L)
    U : is the engineering unit, H (max range which in my case 100PSI) , L (min=0.7PSI).
    Is this formula works? any suggestions?
    Thanks for your feedback in advance.
  9. BR-549

    AAC Fanatic!

    Sep 22, 2013
    The thread starter only made 1 post, 3 years ago. We don't know if anything was resolved.

    I am not familiar with your equipment, but maybe a fresh thread would be a good start, my friend.