How to set the S7-300 address register address

OPN DB100
L 0
LAR1
L 3500
ITD
RLD 3
+ AR1
L DBW [AR1, P # 0.0] // reads the DB100.DBW3500

But when the address is> 4095, due to the value of 3 after the RLD 4096 has been greater than or equal 32768
AR1 caused the wrong value (great value).

So in this case has left three address value can not be obtained correctly.


Here is my Replies: The program can be simplified as in the figure below procedure:
L # 4500 is a two-word constant, so there is no limit of 4095.



 
Address pointer constant P # 4500.0 byte address is 4500-bit byte address within the 0, P # 4500.0 corresponds to the product of 3500 and 8 (in bits integer units). RLD 3 (left 3) is equivalent to multiplying 8.
 

评论

此博客中的热门博文

RVNet-S7300 PPI MPI DP To Ethernet Gateway Protocol Converter Module

Profinet Bus IO Temperature Acquisition Module

Ethernet or WiFi Communication Module for Siemens SMART S7-200