analog input/output - newbie

Pandiani

Lifetime Supporting Member
Join Date
Apr 2005
Location
Tz
Posts
718
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:

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!
 
First channel input will be at PIW256, second channel will be at PIW258.

Read the manual for the wierd analog value encoding scheme Siemens uses, as it's a bit odd for over/under-range, error indications.

And you probably never want to use an equality (==) compare with an analog input, use less-than and greater than comparisons instead.
 
Hello Pandiani;
Read the manual for the wierd analog value encoding scheme Siemens uses, as it's a bit odd for over/under-range, error indications

The "wierd" part of Siemens' encoding of analog values is basically that for any of their current/voltage analog modules there is only one scale, from value 0 to value 27648 (hex 6C00). Just remember that number, its easy one you get used to it. You don't need to take into account the resolution (12 bit, 14 bit...) of the module. For any 0-20 mA signal, 0 mA will read 0, 20 mA will read 27648. Anything above 27648 or below 0 indicates over- or underrange, or errors in the module.
If you use a 4-20 mA signal, 4 mA reads 0, 20 mA reads 27648 (full scale)...
The case is slightly different for RTD and thermocouple inputs.
Hope this helps,
Daniel Chartier
 
Your replies help me a lot. So bit resolution is not actually matter? Does that mean that range 4-20mA (0-20mA) is translated into range (0-27648) no matter what resolution is? Also when voltage signals are used for example 0-10V is also translated to 0-27648?
Sorry it these questions sounds stupid to you, but I'm still a student and don't have any practical experience.

Thanks
 
Hello pandiani;

You seem to have gotten the basic idea.
For more information, you can look for a manual on Siemens' website; search for "S7-300 modules". there is a very complete chapter on analog modules, theory and practice.
Hope this helps,
Daniel Chartier
 
It helps a lot. I'm a complete newbie, learning from PLC book of Hugh Jack, work with logixpro trial and STEP7 trial, (learning a little from AB and a little from Siemens). I've read something about analog cards of PLC (introductionary course) and wondered how that is solved in real world. I'll learn thet with more experience, I'm still learning the basics...
Cheers
 

Similar Topics

Hi, I tried today to get RD3A and WR3A instructions to work on the PLC and it didn't work, but it worked in simulation. I followed the clone...
Replies
18
Views
1,396
Hello, I have a small programming task that I need help solving. I have to: * Create an analog input (4-20v)and a digital output * The analog...
Replies
45
Views
25,082
Hey guys, running into issues trying to get some analog input and output cards for customers needing a few points here and there. with that in...
Replies
15
Views
4,904
Hi; I need to monitor and log the 3phase AC input voltage for which I need a device to convert AC input voltage (say 350 - 440V) to analog (0-10v...
Replies
2
Views
1,370
Greetings, I have been charged with a project to link data from a Beckhoff PLC using Allen Bradley Point IO to a PLC 5. The PLC5 does not have...
Replies
10
Views
4,007
Back
Top Bottom