(1)| 5/31/2015 3:23 PM | |
|
Posts: 160 Rating:
|
Question for Mr. Smiffy: I'm using TIA V12 and i'm currently working on S7-300. In help i saw that it's possible to specify the single bit address for creating ANY pointer (i suppose that it's possible using ByteAddrLSB and MSB). I'd like to know what values of ByteAddrMSB and LSB should I put in order to obtain ANY pointer to, let's DB1.DBB4.4 (PLEASE explain)? Beside that i need some suggestions regarding the creation of POINTER type pointer, which is basically the sub-sort of ANY. Does they always has to be an IN or OUT, because i'am unable to define them in Temp section of variable declaration (using AT). I'm gonna need this for implementing a shift reg. Thank you in advance Mr. Janko
---------------------------------------------------------------------------------------------------- |
Last edited by: Min_Moderator at: 6/1/2015 2:43:20 PMNew subject after splitting |
|
| 6/9/2015 4:48 PM | |
|
Joined: 1/17/2007 Last visit: 1/6/2026 Posts: 1561 Rating:
|
The addressing is bit orientated. That being the address goes up in step with the bit number and there are 8 bits in a byte. So address 0 = DBB0.0, address 1 = DBB0.1, address 2 = DBB0.2, ...., address 8 = DBB1.0, address 9 = DBB1.1 etc. The address value consists of 19 bits, with bits 0-2 being the bit address and bits 3-18 being the byte address. Bits 0-15 are the ByteAddrLSB and bits 16-31 are the ByteAddrMSB (obviously with only 3 bis being used - bits 0-2). So to convert the form DBBx.y into an address that would go into the ByteAddrMSB and ByteAddrLSB of the dissasembled ANY pointer you would do this:- Have a DWORD value called (say) BitAddr. BitAddr = (x * 8) + y ByteAddrMSB = (BitAddr AND DW#16#00070000) / 256; ByteAddrLSB = BitAddr AND DW#16#0000FFFF; When it comes to AT types in TIA they have to be in the same section as the variable that they point to and they have to be declared directly below the variable that they point to.
|
Last edited by: smiffy at: 6/10/2015 1:59:49 PMLast edited by: smiffy at: 6/10/2015 3:02:37 PMProgramming today is the race between software engineers building bigger and better idiot proof programs, and the universe producing bigger and better idiots. |
|
This contribution was helpful to
|
|
Follow us on