Step7: Accessing individual bits of a double word (DBD)

MartyW

Member
Join Date
Nov 2009
Location
New Jersey
Posts
23
A scale module the PLC communicates with feeds back a double word (DBD) that contains status information: 32 defined status bits. In this case it dumps it into a data block at DB21.DBD26. I assumed that I could address DB21.DBX 26.0, 26.1, etc. to look at the individual bits. Looking at the binary representation of the DBD, the information is correct. However may attempts at addressing each item aren't giving the proper values. I have tried assuming that 26.0 has the most significant bit and assuming it has the least significant bit. Either way seems to give incorrect results.

Any ideas?
 
DoubleWord is Word1..Word2
Word is Byte1..Byte2
Byte is 7..0

This means it goes:

26.7..26.0, 27.7..27.0, 28.7..28.0, 29.7..29.0
MSB - - - - - - - - - - - - - - - - - - - - LSB


Open the LAD/STL/FBD editor and do a help search on: DWORD Data Type
 
I figured it out

Within the Double Word, the individual bytes are addressed in descending order. The bits within the bytes are addressed in ascending order.

So for a double word with address 0 (0.0-3.7), the least significant bit is at 3.0. The most significant bit is at 0.7. A bit strange to this newbie.
 

Similar Topics

Hey all! I'm trying to write a FB where I need to transfer 32 byte of I/O data to an array in the FBs DI. The code I am using is this...
Replies
8
Views
3,974
is there any free trial version available for step7 professional and wincc comfort v17. i searched and downloaded TRIAL Download STEP 7...
Replies
1
Views
85
Hello. I need your help. I work at STEP7. There are two CPU 317-2 PN/DP controllers (317-2EK14-0AB0), working on PROFIBUS, as Master (CPU_1) and...
Replies
6
Views
194
This is the first time I am working with Simatic Manager Step7 as I started my siemens journey with TIA which is pretty easy and do a lot of stuff...
Replies
3
Views
183
When you download a DB, the values get overwritten by what is in the "actual" column in offline DB. Does this happen at the start of the PLC...
Replies
6
Views
164
Back
Top Bottom