curlyandshemp
Lifetime Supporting Member
Sorry if that has been posted before, but I cannot find an answer to my problem.
I am trying to access a Flag Byte MBXX in a Function call. My application passes an INT value as an IN parameter that represents the MB that the function needs to call. Within the called function, certain bits are tested for their current state , MBXX.0 - MBXX.7, then the results of a particular test are passed back as an OUT.
For the life of me, I cannot get this to work. According to the Step7 documentation i should be able to use the following code:
L #dest_ptr // INT value of dest route to access 11 - 19
L 10 // route 11 to 19 status are in MB21 - MB29
+I // create an offset to point to actual MB
T #mb_ptr // transfer to a DWORD that contains MB#
L MB[#mb_ptr] // load the contents of MBXX
T MB1000 // transfer to working MB1000
A MB1000.7 // test for machine OFFLINE bit
= #offline // Bool OUT value macine OFFLINE
BEU // exit
Is the above code valid, or am I missing something?
Thanks
Ian
I am trying to access a Flag Byte MBXX in a Function call. My application passes an INT value as an IN parameter that represents the MB that the function needs to call. Within the called function, certain bits are tested for their current state , MBXX.0 - MBXX.7, then the results of a particular test are passed back as an OUT.
For the life of me, I cannot get this to work. According to the Step7 documentation i should be able to use the following code:
L #dest_ptr // INT value of dest route to access 11 - 19
L 10 // route 11 to 19 status are in MB21 - MB29
+I // create an offset to point to actual MB
T #mb_ptr // transfer to a DWORD that contains MB#
L MB[#mb_ptr] // load the contents of MBXX
T MB1000 // transfer to working MB1000
A MB1000.7 // test for machine OFFLINE bit
= #offline // Bool OUT value macine OFFLINE
BEU // exit
Is the above code valid, or am I missing something?
Thanks
Ian