Hoffelhass
Member
Hey everybody,
I've been trying to write a function in STL that takes an indexnumber and a UDT type to calculate a pointer to specific UDT in a DB.
I do this by multiplying the indexnumber with the UDT size and using that as the offset in the DB.
L #IndexNumber
L "DB_Constants_Typicals".DigIn.Size
*I
SLD 3
T #Offset
OPN "SETTINGS_DigIn"
L DBW [#Offset]
T #ControlPointer
Where #ControlPointer is the pointer I want as the output of my function.
I based this largely on a previous post here by S7guy.
This code however gives me the error: "Make sure your global DB is set correctly". However just a line above it I state that I open DB "SETTINGS_DigIn". Am I missing something?
Thanks in advance
I've been trying to write a function in STL that takes an indexnumber and a UDT type to calculate a pointer to specific UDT in a DB.
I do this by multiplying the indexnumber with the UDT size and using that as the offset in the DB.
L #IndexNumber
L "DB_Constants_Typicals".DigIn.Size
*I
SLD 3
T #Offset
OPN "SETTINGS_DigIn"
L DBW [#Offset]
T #ControlPointer
Where #ControlPointer is the pointer I want as the output of my function.
I based this largely on a previous post here by S7guy.
This code however gives me the error: "Make sure your global DB is set correctly". However just a line above it I state that I open DB "SETTINGS_DigIn". Am I missing something?
Thanks in advance