All right guys, I need explanation regarding analog input and output. I'm reading about analog input cards in PLC in a book. Since PLC is digital device, every analog signal needs to be converted to digital first. For example I have tahogenerator that returns voltage in range 0 - 5 V for speeds 0 - 1500 rpm (I'm just making this up really don0t know what could be in practice). I need to control speed of that motor in PLC, so I need analog card. Let's say card is 12 bit, so that means that every value is converted to 12 bit digital word. I calculated something like this:
12 bit = 4096 possible voltage levels which means every level is "wide" 5V/4096 = 1.22 mV. PLC reads input, convert to binary and store somewhere in memory.
1. Where is that value stored and how can I access it? I'm playing with Siemens Step7 nad when I add input analog card (SM 331 2x12bit) to rack (I don't have actual PLC) it gives me addresses
256...259.
2. When working with digital inputs it's easy I0.0 means input 0 byte, 0 bit, but what about analog?
3. Can I treat these values like integers and compare to some preset value using comparator block? I assume I can but need to know how. For example in STL I can compare two integers values with something like this:
I'm comparing two 2-byte integer numbers placed im memory MW1 nad MW2. How to modify this to compare value on MW1 to fro example value read from input?
I post stl code because it's easier to handle in this text box.
I'm very looking forward to your answers
Thanks a lot!
12 bit = 4096 possible voltage levels which means every level is "wide" 5V/4096 = 1.22 mV. PLC reads input, convert to binary and store somewhere in memory.
1. Where is that value stored and how can I access it? I'm playing with Siemens Step7 nad when I add input analog card (SM 331 2x12bit) to rack (I don't have actual PLC) it gives me addresses
256...259.
2. When working with digital inputs it's easy I0.0 means input 0 byte, 0 bit, but what about analog?
3. Can I treat these values like integers and compare to some preset value using comparator block? I assume I can but need to know how. For example in STL I can compare two integers values with something like this:
L MW 1
L MW 2
==I
= "Y"
I'm comparing two 2-byte integer numbers placed im memory MW1 nad MW2. How to modify this to compare value on MW1 to fro example value read from input?
I post stl code because it's easier to handle in this text box.
I'm very looking forward to your answers
Thanks a lot!