[?]: PL7 PRO Schneider overlapping

другие контроллеры
razlog
Posts: 2
Joined: Fri Jun 19, 2009 7:14 am
Location: Europe

[?]: PL7 PRO Schneider overlapping

Post by razlog »

Hello
I can not find anything about overlapping of variables in PL7PRO. Overlapped variables are marked red in "Variables editor".
Are the overlapping variables defined somewhere, or is that made automatically?
So if you use any variable of

Code: Select all

%MB, %MW, %MD, %MF, %KB,... 
for example

Code: Select all

%MD10
, i can not use any variables like

Code: Select all

%MB10, %MB11, %MW10,...
?!
In help file I just find following:
Overlapping is possible on the following variables:

Code: Select all

%MB,	%MW,	%MD,	%MF,	%KB,	%KW,	%KD,	%MF.
Example:If %MW1 is used in the application, the overlapping is effective for:

Code: Select all

%MD1,	%MF1,	%MB2,	%MB3.
The overlapping is represented by displaying the variables in red characters and it is managed providing that:
the variables are used in the application program (Sections, subroutines, events),
the Options\Variables editor\Overlapping command has been selected before opening the variables editor. :roll: :roll:
cmos
Posts: 34
Joined: Thu May 21, 2009 4:52 pm
Location: Europe

Post by cmos »

I'm gonna give you an example regarding how the overlapping works.
Let's say that you are using the double %MD330. This mean that this variable utilize 32bit. So, to do that, it store the most significant word in %MW331 and the least significant word in %MW330. This mean that the byte, word, double word and real memory area is the same or shareable let's say.
In point of byte, the stuff are a little bit more complicate. For example the byte %MB660 is the least significant byte of %MW330 and byte %MB661 is the most significant byte of %MW330. That's why the byte address increased by 2.
This is very useful when you send data through modbus protocol. In the modbus protocol you read/write holding register. So if you combine two holding register you have a double value.
You can test all these if you create an animation table and put all the previous variables addresses and display the data in hexadecimal format.