Extracting bits out of a double word with Siemens S7

kemppioy

Member
Join Date
Oct 2005
Location
Dallas
Posts
72
Hello,

I have a question about getting individual bit information from a double word using Siemens S7. We use Siemens OP panels and the alarm messages there are reading double words from our PLC and then triggering the OP panel alarms. The OP panel reads the bits from the double word and activates the correct alarm when it is triggered in the PLC. We also want to use Wonderware Intouch on the same network and send the alarms there as well. How do I get the bit information from a double word or word into Intouch using S7 messaging protocol? Is there a certain syntax to be able to read that correctly? I tried in the S7 monitor/modify variables to see if I could even monitor a bit from the word and I typed in the address using DB??.DBW12.8 (bit is number 8) but of course it says syntax error. If I cannot read that information in Intouch, how can I convert it in the PLC so I can read individual bits from the double word?


Thanks ahead of time!

PK
 
The syntax for bits is
DB??.DBX12.0 through to 12.7
DB??.DBX13.0 through to 13.7
etc.
You cannot specify bit number 8
 
A double word is 4 bytes, so if you are after the 8th bit of DBD12, the correct address would be DBx.DBX 14.0


DBx.DBD12 = DBB12, DBB13, DBB14 and DBB15.

Where DBW12 is the higher word and DBW14 the lower.
 
Thanks

Hey,

That double word and word thing still gets me since I am an Allen Bradley programmer mostly. In Allen bradley of course you can address directly to the 16 bit word since one word is 16 bits long and uses the same syntax for the whole 16 bits. Yes you guys are right of course but I found that the eight bit of DBW12 is DBW12.DBX13.0 and not 14.0. My woodhead comm adapter does not like it when I use DBX in Intouch so had to use DB10,X13.0 and then it worked fine. Thanks again for your help! :)

PK
 
I got wrong on DBX 14.0, as that is bit 8 of the double word not the 8th bit ;)

Your original question you asked about double words and your example showed a single word, so that is confusing.

DBX13.0 is not the 8th bit, it is the 1st, but then again maybe the SCADA reads the bits in reverse in each byte, I have seen this before.

DBW12 = DBB12 and DBB13, 12 would be the High Byte and 13 the Lower Byte.

Byte..DBB12...........DBB13
Bit....7 .6 .5 .4 .3 .2 1 0 7 6 5 4 3 2 1 0
WBit..15 14 13 13 11 10 9 8 7 6 5 4 3 2 1 0

The 8th bit would be DBX13.7 or bit 8 (continuing from the lower 8 bits 0-7 then 8-15) would be DBX12.0.

For a double word you would add the next word on the end, which is DBW14, then the double word would be DBB12, 13, 14 and 15.

In this case 12 and 13 would be the higher word (bits 16-31) and 14 and 15 would be as 12 and 13 above.

The 8th bit would be DBX15.7 or bit 8 (continuing from the lower 8 bits 0-7 then 8-15) would be DBX14.0.

That would be the normal interpretation.
 

Similar Topics

Hello, I am new to using Crimson 3 with Modbus TCP/IP Master protocol. I have a register 47101 that is packed with 16 bits for various on/off...
Replies
6
Views
4,346
I am attempting to access HMI tag properties (Description, Minimum, Maximum values) to populate a numeric input. Is there a clean way to do this...
Replies
0
Views
360
Hi all, I have a customer with an FTView SE system running some datalog files. They can see the trends on the client, but they now want to...
Replies
7
Views
2,606
Hi, I'm using the 2080-MOT-HSC High Speed Counter plug-in module with a Micro850 (2080-LC50-24QWB) using the HSCE instruction. The encoder is a...
Replies
2
Views
1,649
Hi, I am having trouble getting the .dmk file extracted so that ControFlash will see the new firmware revision. I hit extract all files and it...
Replies
6
Views
4,675
Back
Top Bottom