Analog Input Readings via Profibus-Siemens S7

Rott202

Member
Join Date
Jun 2016
Location
Buenos Aires
Posts
4
Hi,

I've been reading the contents of the forum for a while and finally decided to ask a particular question related to a project I'm currently working on:

i) The basic idea is to obtain analog and digital input readings from a DP slave (ET-200) via profibus to a Siemens S7 300 CPU.

ii) I have configured the blocks DP_SEND and DP_RECV according to this :
https://support.industry.siemens.co...-cpu-in-order-to-transfer-data?dti=0&lc=en-WW

After some troubleshooting the communication is up and running. I am sending the information to a DB comprised of BYTE type entries.

iii) The "remote" modules which will be sending their readings via ET-200 are of this type:

http://www.slo.lt/out/media/siemens.356ES7331-1KF02-0AB0.pdf

I have tested the digital inputs and when I send "1's" to them I can see the change in the Byte entry of the DB related to the Address of that particular module (I understand that that's the main principle of Profibus)

iv) After testing the digital inputs I wanted to test the analog inputs. I have to read temperature values so I configured the channels as PT100's (RTD). I understand that the module gives back a reading which is a signed integer. After I "read" this value I should parse it to DINT, then to REAL and finally multiply it by 0.1 (the final value would be the temperature in Cº).

My problem is that I can't seem to obtain anything logical from these readings. The "Byte" entries of the DB change when I simulate a RTD on that particular channel (which means that something is being sent via PROFIBUS from the module) but I am not obtaining anything close to what is required to obtain a temperature in degrees Celsius. For example, if the RTD is measuring 50 degrees, I should be reading an entry close to 500 on the DB. My readings are much more elevated than that. Also I tried simulating a negative temperature (for example -20 ºC) and I could not recognize the sign bit change. My guess is that something is not being done properly when sending the information from the module to the DB, perhaps I need to have a different type of entry for the DB (for example, I have tried WORD) but that also did not work. At this point I do not know how to fix this. I tried to "monitor" the analog input with the Siemens debugging program but it would not work (this would have allowed me to see what the module is "actually sending" without taking into account the Profibus stuff).

I hope someone has some experience with this...or at least can suggest a possible fix or test to perform. Sorry for the long post!

And thanks!!!
Rott202
 
Could you post some examples of what you're expecting, and the actual data you are receiving? Maybe the bits/bytes combine differently than you're expecting.
 
Could you post some examples of what you're expecting, and the actual data you are receiving? Maybe the bits/bytes combine differently than you're expecting.

Hi mk42,

I will take some pictures tomorrow of the online DB so you can take a look, but for example:

I did a DB comprised of WORD entries. I wired a RTD channel on the 1FK02 and did a ramp with a simulator from -40º C to 150ºC. I can't remember the exact values, but ALL the readings I obtained were XX7F (where XX are the changing numbers varying when the simulator changed its simulated temperature). The ADC has a resolution of 12 bits but only 8 were changing in this example (half of the WORD entry). Also I could not distinguish the sign bit (as far as i know this would be the 15th bit and it should be 0 when positive and 1 when negative, but nothing was matching here).

Please take a look to this manual (chapter 5):
https://cache.industry.siemens.com/...4/v1/s7300_module_data_manual_en-US_en-US.pdf

Basically it says: " the analog value is stored left-aligned. The
unused least significant bit positions are padded with zeros ("0".) "

I could not distinguish the left aligned reading on the word entry. Also, I don't have the least significant positions padded with zeros. I do not know what could be wrong, but it is something related to the position of the Bytes and bits, I am almost sure.

Thanks!
 
What processor are you using (catalogue number)
What hardware do you in the remote rack, again catalog numbers are best?
 
What processor are you using (catalogue number)
What hardware do you in the remote rack, again catalog numbers are best?

Hi Mike_RH,

The CPU used in the "local" rack is this one:
https://mall.industry.siemens.com/mall/es/WW/Catalog/Products/10000729
(6ES7313-5BG04-0AB0)

The CP used for PROFIBUS is this one:
https://cache.industry.siemens.com/dl/files/853/2641853/att_67373/v1/CP3425_CP3425FO_01_e.pdf
(CP342-5)

The modules that I need to read from the remote rack are of this type:
https://mall.industry.siemens.com/mall/en/WW/Catalog/Product/6ES7331-1KF02-0AB0
(6ES7331-1KF02-0AB0)

The remote rack communicates via an ET-200 (http://w3.siemens.com/mcms/distributed-io/en/ip20-systems/et200s/pages/default.aspx)

Please let me know if you need further information about anything

Thanks!
 
Well, I finally solved it! I changed the DB entry type from WORD to BYTE. Also, I disabled all the 1FK02 channels but the one that I wanted to test. Afterwards, I ran some tests and I obtained values that were Temp*100. for example, if I was simulating 50° C on that channel, the reading between the two byte addresses belonging to that channel was 5066. Dividing by 100 and adjusting by a factor allowed me to obtain the temperature values. Negative temperatures can also be read, you just have to complement the two bytes (if there's a 1->0 and viceversa) and you obtain the absolute temperature.

Hope it helps someone! Thank you for your suggestions!!
 
SFC14/!5 DPWR_DAT and DPRD_DAT

You must use these System Functions for data lengths of 3 bytes, or 5 bytes and more.
That means that you cannot use then for 16-bit (INT, Word) registers, or 32-bit (Dint, DWord, REAL) values. For these use simple Load/Transfer operations.
Hope this helps,
Daniel Chartier
 

Similar Topics

Hi. OK, i have a pressure transducer for a run tank level (h20 based) that i just checked for accuracy. it's reading 3.999ma at .001in.of h20, so...
Replies
39
Views
13,857
I'm having trouble calming down 2 Tempo Sonics. I'm using Studio 5000 CompactLogix my Raw value is jumping around from 8575.0 to 8755.0 at a...
Replies
11
Views
197
I cannot add SLC500 analog input tag (I: 8.3) to EZSeries Touch Panel Editor (V 5.3). I used all the listed tag datatype but it all says "Invalid...
Replies
8
Views
172
Hi, I have questions. I have Analog Input that need to put into Ignition Designer. But I don't know how to put?
Replies
1
Views
78
Omron AD081-V1 Analog Input Card Offset & Gain Adjustment Entering Adjustment Mode 1. Set the input card in adjustment mode (Turn ON Dip SW No-1)...
Replies
0
Views
56
Back
Top Bottom