siemens analog inputs

GTX

Member
Join Date
Dec 2003
Posts
36
How do you read the data comming in from the analog input and make sense of what is comming in so that you can use FC105? I am using a Siemens S14. Do you have to use a PIW, could someone please clarify for me.
 
Yes, you have to read PIW's to read the analog inputs. One strange thing to notice about the analog inputs is that the values are shifted 4 bits left (e.g. multiplied by 16d or 10h). This means the values you read changes in steps of 10h. The resolution is +/- 11 bits, giving a range of +32752/-32768, divided by 16 this gives +2047/-2048 e.g. +/-11 bits! You may not be reading any negative values if you configure the input as 0-10V or 4-20mA and never goes belove range. Note that the resolution stated includes some overrange, meaning that 20mA will give a reading of somewhat less than 32752.

I don't remember the PIW adresses, you have to look them up in the documentation.

Anders
 
Yes, you need to use the peripheral input area to get at this.
If you don't already know your addresses:
Open you project and open the appropriate plc (if you have more than one). Open up the hardware editor. In the bottom pane of the window you should see a list of all the modules you have configured. In the row contaning your analog input you should see an I address field. That will tell you the peripheral address range where the inputs will be located.
The data will come in as a 2s-compliment number across two bytes. Reference the data as PIW???, with ??? being the appropriate lower byte of the input word. It's been a while since I used an S7 analog input but I believe the data is left justified, meaning the lowest 4 bits of the input value are meaningless with a standard 12-bit analog input. If you have a high resolution input all the bits are used.

I hope this helps.
Keith
 
Ok, I am in the same boat as GTX. I am reading in PIW752, and i am using a 4-20mA current loop. At 4mA PIW752 = 5552 and at 20mA = 27664. First of all how do I setup the analog input card to use 4-20 mA and second of all, would I have to perform a calculation (eg. divide by 16) on this PIW before I feed it into FC105 which i will eventually use to display motor RPM on the HMI. Your help would be greatly appreciated - Thank-you.
 
Since you can tell us that different and what look to be reasonable numbers are showing up in PIW752 I would say you are set up correctly already. The two things you need to do te set the module are to make sure the range module plugged into the side of the analog input card is set correctly and that the hardware configuration in the Hardware section from Step7 is set correctly.
I don't think you need to do any pre-conditioning of ther value before you use FC105. The value of 27664 is only one resolution bit higher than the FC105 maximum of 27648. FC105 will report an error and limit the value to the max limit but it will still work right. And that's what you would get out as a max amyway.

I hope this helps.
Keith
 
Hello, it has been a while for me too. I hope i don't mix things up with the analog output modules. I don't have a Step 7 program with me, but I remember something of chosing the right type of analog input. That means, you can choose between 0-20 mA, 4-20 mA or 0 - 10V or something like this. You can choose this in the hardware configuration but you also have to make the right adjustments on the Analog input card itself. You have to turn a small "dice" in the right position. The position is given in the HW editor through A, B, C or D. On the dice there are also these letters. When this is all correct you can see the value at the PIW address as configured in the HW editor.

Good luck!
 
Also, for the 16-bit analog input cards, you have to install a jumper wire between 2 terminals (per channel) to use a current input, otherwise it is just voltage.
 
Ok well thank you folks for all your help, I am at the point now where i am sucessfully reading PIW752 into FC105. The addresses for my analog inputs start at 752 and i am using AI0 so i am pretty sure i am reading the correct word. The problem that iam having is converting this data into something i can use. I think that I have to divide by 16 because when i look at 752 in binary i can see the first 4 zeros do not change as i move from 4-20 MA but the remaining numbers do change. Also when i view the word in integer, it flickers from 0,16,32 when i am hovering around the 4mA range. So what i have done - please correct me if i am on the wrong track is i first divide the number by 16 then feed it into FC105. Now here is my problem, on SCP in allen bradley, you have 2 high/low limits, one for the incomming range and one for the outgoing range. How do i scale the values i have comming in, for example in FC105 i set my LOW = zero and HI = 100 then i get a number at the output( i used MD80) of FC105 that is 0 to something like 101.23543, if i refer to this memory address (MD80) in my HMI i get wierd numbers that do not reflect the value at all ex.343218895. I think this is due to the data type but i do not know how to convert it or manipulate it. Once again your help is greatly appreciated.
 
Hello KA24DE;
we have already made sure that the input you are reading (PIW752) seems correctly set-up. Analog input value ranges in Siemens PLCs are range limited, either (in decimal values) 0 to 27648 (unipolar) or ±27648 (bipolar), so there is no need to set input limits or to mainpulate the value. On a 4-20 mA signal, 34 mA will always give you a (decimal) reading of 5552, 20 mA will give you 27648; any other reading will be linearly calculated on those values. Simply place PIW752 as the IN signal of FC105 (it is a INT type, so it reads as a decimal; value).
what you need to do is setup the limits for the output signal. if you want to read 0-100%, put 0.0 in the low limit, 100.0 in the high limit (note that these are REAL values, so write the value with a decimal point or setup the variables as REAL). If you want to read minus 10 to 40 degrees, write -10.0 to the low limit, and 40.0 to the high limit. Just choose your engeneering units and arrange the output accordingly. By the way the output is also a REAL value, so read it as a floating point value, or what you read will make no sense.

There is documentation in a PDF file that is included in the documentation section of Simatic installation (Start --> Simatic--> Documentation-->English) called "STEP 7 - System and Standard Functions for TI-S7-Converter"; FC105 is very well described in the Convert funstions chapter.

Hope this helps,
Daniel Chartier
 
It looks to me like you are in good shape through the plc. I think you may now have an HMI data type issue, as you seem to already suspect.
It looks to me like you might have the data type in the HMI defined as a double integer. What are you using for an HMI? Does it support a REAL or FLOAT adta type? That is what you would need to correctly view MD80. If you can only use integers in the HMI you can convert MD80 to a double, but you would loose everything to the right of the decimal point. To maintain some precision you can multiply MD80 by some factor of 10 (depending on how many decimal places you want to keep) and then make it a double. Then on your HMI you would use a fixed decimal location.

I hope this helps.
Keith
 
Well Folks, I am using a Siemens TP170B Touch screen for my HMI and today I got everything working just fine. I had a problem with my data types just like you suggested (I am now using REAL in the HMI application). Finally I am reading in RPM values and outputting setpoints just like downtown. I think a round of belly button shooters is in order for everyone who helped me out. I have just taken the duct tape and cardboard off of my basement windows and I am ready for society once again. Thank you once again for all of your help on this matter.
 

Similar Topics

Does anyone know how to get ISO 13849 PLe safety from analog I/O with Siemens? I am thinking of something akin to an AB CompactGuardLogix with a...
Replies
1
Views
1,678
Hi, How can I read state of a analog Input/Output card if I use //Parameters/Inputs/Group Diagnostics . Thx
Replies
1
Views
2,062
Can anyone tell me entirely about the working principle of analog inputs or outputs and data blocks in siemens plc.
Replies
5
Views
8,920
Hi ! I am new to Siemens S7300 (313C CPU) PLC and I cannot find the documentation related to analog inputs connecting diagrams. I have a couple...
Replies
2
Views
8,781
Hello Folks, I am trying to figure out how to make use of analog inputs and outputs in Siemens S7. I am familiar with Allen Bradley and for them I...
Replies
5
Views
6,274
Back
Top Bottom