analog input simulation

Anonymous
2009-08-18
2010-01-14
  • Anonymous - 2009-08-18

    Originally created by: DA

    Hi All,

    New to Codesys...

    Does anyone have any sample projects that read in a continuos analog signal into a plc? Or does anyone have sample projects that simulates a continuos signal? I don't have the hardware yet.

    I have done projects inputs/on off/button where I can test/simulate and works fine. But I'm stumped on how I can simulate a signal? Do I loop a series of "numbers" to bypass analog-word conversions?

    I have a pressure sensor to a plc and need to capture data as a test.

    Please, any Ideas will be appreciated.

    I've read all documentation here and on the web.

    There is no codesys training in my country.

    Thanks

    DA

     
  • ndzied1 - 2009-08-18

    I would simulate something like that in a visualization. The simplest way is to use a number input into a box. Then you type in the number.

    So in this way you pretend to be the analog input.

     
  • Anonymous - 2009-08-19

    Originally created by: DA

    Hi,

    Thanks for the reply, but because it's a signal, what would the numbers look like?

    Is that the only way to do it? Does codesys provide a number series range or similar to test input?

    But anyway I can do the input number thing but I would like a continuos number sequence, so I'm guessing a loop with time, as I need to measure pressue in pounds per minute.

    Is this a common thing I'm asking? or should I give up?

    Thanks

    DA

     
  • ndzied1 - 2009-08-19

    What the numbers look like is more hardware dependent than CoDeSys dependent.

    In general if the analog input has 10 bits resolution then the numbers will go from 0 to 1023. If it has 12 bit resolution then they would go from 0 to 4095. The hardware you are using will have to define the bit resolution and whether there is any over-range and/or under-range areas in the signal mapping.

    The attached picture shows a plot from a Moeller XIOC-8AI-U1 analog input card. You can see that the 0V signal will relate to 0 and the 10V signal will relate to FFFx (4095). But I have seen cards where the 0 number relates to -0.5V and the maximum number (4095 in this case) relates to 10.5V. You have to go by the documentation for the hardware you are using.

    I need to measure pressue in pounds per minute.

    that is not a pressure unit. Pressure units would be pounds per square inch. A pressure transducer would read pressure directly. If it is a 0-3000 psi transducer with a 0-10V output then 5V signal would mean 1500 psi, 10V would mean 3000 psi.

    Is this a common thing I'm asking? or should I give up?

    This is a very common thing.

    To simulate the pressure changing over time, I would write a simulation POU. In this POU would likely be a timer which would continuously reset itself This sets up your simulation time step. At each time out, trigger a routine to change the simulated signal. For instance, you may add a fixed increment to it each time step. When you get to the maximum value (4095 in my example above) you could then switch over to decrementing the simulated signal variable until you reach 0 again and then switch back to incrementing.

    Good Luck

    IMG: V to Number.gif

     
  • banzai35 - 2009-12-23

    DA hat geschrieben:
    Hi All,
    New to Codesys...
    Does anyone have any sample projects that read in a continuos analog signal into a plc? Or does anyone have sample projects that simulates a continuos signal? I don't have the hardware yet.
    I have done projects inputs/on off/button where I can test/simulate and works fine. But I'm stumped on how I can simulate a signal? Do I loop a series of "numbers" to bypass analog-word conversions?
    I have a pressure sensor to a plc and need to capture data as a test.
    Please, any Ideas will be appreciated.
    I've read all documentation here and on the web.
    There is no codesys training in my country.
    Thanks
    DA

    you can use Scrollbar tool in visualization screen...I use it and it works quite well

    ps.

    if you want I can send you one example how you can use it

    regards

     
  • spfeif - 2010-01-14

    Add the Ramp function from the util library. Give the ramp function The maximum value when it gets to maximum set it back to minimum or zero. This will create a trapiziodal signal that varies over time so you will see it accel then decel for ever. Why do you need this? Typically testing is done as Norm has stated by entering the value and verifing the result.

     

Log in to post a comment.