Get IDB number as integer in SCL script

Hi all

I use STEP7 V5.6.2.7 and i want to get the number of the IDB in my FB SCL script.
Does anyone know if this is possible?
And if so, how do you do it?

thanks
Jasper
 
Call the following function from your FB and pass it a STAT variable to return the instance data block number.
Code:
FUNCTION fc596 : WORD
TITLE =return any pointer
//

VAR_INPUT
  pAny : ANY ;    //Any STAT variable from the function block
END_VAR
BEGIN
NETWORK
TITLE =

      L     P##pAny; 
      LAR1  ; 
      L     W [AR1,P#4.0]; 
      T     #RET_VAL; 
      SET   ; 
      SAVE  ; 
END_FUNCTION
 

Similar Topics

Can someone tell me what the difference is between Retain and Set in IDB when creating function blocks in portal? Is one preferred over the...
1
Replies
4,713
Views
I am modifying a large STEP7 program with many FBs and FCs. The original programmer is reading STAT bitw of IDB's in other blocks directly using...
3
Replies
3,592
Views
From within a FB i need to know what Instance DB is associated with that particular FB. How do i do that? Best Regards Pethoek
2
Replies
1,925
Views
Is there an easy way to get the serial number from a Compact or Control logix processor without reading the tag printed on the side? IT is...
7
Replies
448
Views
We have a system with a Pair of PLC-5/20 Processors connected to a pair of 1785-BCM (Backup Comm Modules) with a Remote IO Rack, 2711-TC1 HMI and...
2
Replies
254
Views
Top