northwest_trail
Member
I'm a beginner with STL for the S7-300, and am trying to grasp some concepts with pointers for the first time. I'm trying to learn from Berger's STL book, but it's pretty rough.
Right now I'm attempting to create a pointer to a word within a DB. I'd like to be able to specify which word using an Int. From the reading it seems like I'm looking to use a DB Pointer to accomplish this. The book gives one single example on how to create a DB pointer:
P#DB10.DBX20.5
However, directly underneath this example (p413) it states, "You cannot load this pointer". Unfortunately this is exactly what it seems like I want to do. That is, I'd like to load the value from some word in the data block into the accumulator, for instance:
L P#DB_In.Word_Number
Whre DB_In is the DB and Word_Number is the word in the datablock I'd like to have the pointer to. I know this syntax is wrong, but if someone could give me a hand forming the correct syntax I'd be very greatful.
Thank you,
NWT
Right now I'm attempting to create a pointer to a word within a DB. I'd like to be able to specify which word using an Int. From the reading it seems like I'm looking to use a DB Pointer to accomplish this. The book gives one single example on how to create a DB pointer:
P#DB10.DBX20.5
However, directly underneath this example (p413) it states, "You cannot load this pointer". Unfortunately this is exactly what it seems like I want to do. That is, I'd like to load the value from some word in the data block into the accumulator, for instance:
L P#DB_In.Word_Number
Whre DB_In is the DB and Word_Number is the word in the datablock I'd like to have the pointer to. I know this syntax is wrong, but if someone could give me a hand forming the correct syntax I'd be very greatful.
Thank you,
NWT