发布于 2009-03-17 12:59:08
0楼
仔细看了看帖子,也没弄明白,只好help 一下,果真有此说明.
Notes on Changing the Contents of Registers
If you use the programming options below together with the registers and accumulators listed, you must make sure you restore the contents of the registers or accumulators yourself, otherwise errors may occur.
Using the following higher-language constructions may cause the contents of the DB register and address register AR1 to be modified:
Fully-qualified DB access (for example, DB20.DBW10) as an actual parameter for a function (FC)
Function block (FB) and multiple-instance calls
Structure components of a formal parameter as an address within an FC or FB
Structure components of a formal parameter as an actual parameter for an FC or FB
With FB, FC, and multiple-instance calls, you should not use the RLO or accumulator 1 or 2 as additional (implicit) parameters.
The DI register and address register AR2 are used on the system side for the FB and multiple-instance calls and should not therefore be modified within FBs.
Address register AR1 is used by some of the loadable standard blocks.
The command "L P#parameter_name" loads the address offset of the specified parameter within an FB, relative to address register AR2. In order to determine the absolute offset in the instance data block in multiple-instance type FBs, you must also add the area-internal pointer (address only) of the AR2 register to this value.
o! why? thinking...