Help understanding analog in-/outputs

hyys12
2024-12-11
4 days ago
  • hyys12 - 2024-12-11

    Hello.

    I am currently working on a WAGO PLC, where I am trying to wrap my head around how the analog inputs and outputs work in codesys.
    I have looked far and wide on the internet, for a general introduction to the whole concept, but I have not had any luck with finding anything that helped me understand it better. The whole goal is for me to be able to read an analog input from a temperature sensor, as well as using an analog output, to control a frequency inverter. I know these have nothing to do with each other, but that is all I have on hand right now.

    I am trying to program this using Ladder Diagram. The only thing is, that every video/guide I have seen/read using LD, just adds a whole lot of function blocks, to do all kinds of stuff they don't explain.
    My general question is, how would one go ahead and read the analog input, as well as transmit an analog output? Is there some kind of specific function block I would have to use for this, or some great video I can watch, to understand the inner workings.
    Is it somehow possible to see the values the PLC recieved/sends?

    Regards.

     
  • ben1 - 4 days ago

    Hi there mate

    Most PLC's have a very similar concept with AI/AO - have you used any other software before?

    I have not used a Wago before myself, but I assume the concept would very much be:
    1. Add the analog in & out cards to your hardware config.
    2. Setup the raw input scaling on the hardware (eg. 4 - 20mA = 4000 - 20000)
    3. Use a built in or homemade scaling block to scale your input as needed (eg. 4000 - 20000 = -100 - 2000kPa.
    4. Write code as required
    5. Scale output as needed (eg. 0 - 100% = 0-10000 = 0 - 10V)

    Is this the information you require?

     
  • durallymax - 4 days ago

    WAGO will use 0-32767 as the raw units. Note a value of 3 means over/under range. Map that IO however you please, then scale in your program using any of the available libraries or with your own simple y=mx+b scaling formula to get to the engineering units you desire. Inverse for the AO to get back to 0-32767.

     

Log in to post a comment.