Industry Online Support
Technical Forum
6/16/2012 1:49 PM | |
Joined: 10/7/2005 Last visit: 10/10/2024 Posts: 3024 Rating: (1054) |
Hello Tonk your calculation is a bit "odd" (e.g. "CentPointer" is multiplied with 0, start Byte address is nominated as 316 instead of 158 for which you then compensate by doing an SLD 2 instead of pointer typical SLD 3), so allow me to propose the following logic to you which shoulddo the job: A "Tag_36" FP "Tag_32" JNB NTrig LAR1 P#DBX 158.0 // point AR1 to start of bit field L "DB108_Hmi_Data".CentPointer // load bit indexvalue +AR1 // add to AR1 OPN "DB108_Hmi_Data" SET // RLO = 1(the above JNB takescare of this too, but this is "neater" S DBX [ AR1 , P#0.0 ] L "DB108_Hmi_Data".CentPointer + 1 // increment bit index value T "DB108_Hmi_Data".CentPointer NTrig: NOP 0 I hope this helps and have a look too at the FAQ below concerning all things indirect addressing related: STEP 7 -- Creating S7 programs -- Indirect Addressing |
Cheers |
|
Follow us on