Very new to PLC's. Bought the Opta Starter kit as a way to try and learn how to program PLC's.
I know how to do what I want in c++ or python, but trying to learn how things are done in the PLC world.
How do people normally read analog inputs on PLC's? Like with the Opta, if I have a variable mapped to one of the programmable inputs For example:
I8 input_voltage UINT %IW0.7
Can this be read using ladder logic, or is only accessible if you use something other than LD?
Coil and contact don't make sense because those are booleans, so how do you get this value and use it to do something, like toggle an output if the value is > some trigger value?
I'll check that out when I run out of connections.
Figured out how to read the values.
Added an "add" function block and used the input_voltage as one input, '1' as the other input and created a local dummy variable to hold the output. Then I was able to watch the value change from the watch window.
I also came from a text programming background. I had to learn about plc's and I had the same question as you.
With plcs it is all about loop time (not much different than the time it would take for one complete loop() in arduino because a plc is known to be a real time controller. So things have to updated fast enough as to seem like any changes are immediate.
I think the big difference with plc's is that it reads all inputs first , apply the inputs to the ladder logic then apply the outputs to an output table. Where in microcontrollers the variables are updated throughout the program as they change.