martin3885 Member M Join Date Aug 2005 Location Saarland Posts 144 Sep 19, 2005 #1 How can I declare a UDT with variable of a type POINTER? What value should I place in initial value(Anfangswert in German)(I think in English it is initial value, I work with german version of Step7)
How can I declare a UDT with variable of a type POINTER? What value should I place in initial value(Anfangswert in German)(I think in English it is initial value, I work with german version of Step7)
SimonGoldsworthy Member Join Date Mar 2005 Location England Posts 1,078 Sep 19, 2005 #2 You have to create another UDT to describe the layout of the pointer and then include this UDT in your first UDT For example, I use the following UDT for an any pointer: Code: TYPE UDT190 STRUCT byS7Valid : BYTE ; //0=null pointer, 10Hex=Valid S7 pointer byType : BYTE ; //type, e.g 01=bool, 02=byte, 03=char etc. 0=null pointer iNumberOfItems : INT ; //number of items of the type specified iDataBlockNumber : INT ; //data block number dwAreaPointer : DWORD ; END_STRUCT ; END_TYPE
You have to create another UDT to describe the layout of the pointer and then include this UDT in your first UDT For example, I use the following UDT for an any pointer: Code: TYPE UDT190 STRUCT byS7Valid : BYTE ; //0=null pointer, 10Hex=Valid S7 pointer byType : BYTE ; //type, e.g 01=bool, 02=byte, 03=char etc. 0=null pointer iNumberOfItems : INT ; //number of items of the type specified iDataBlockNumber : INT ; //data block number dwAreaPointer : DWORD ; END_STRUCT ; END_TYPE