Technical data
Appendix
27.3 Data Types and Parameter Types
Programming with STEP 7
614 Manual, 05/2010, A5E02789666-01
Int_Value : DWORD ; //Auxiliary variable
END_VAR
BEGIN
NETWORK
TITLE =
//The block intercepts changes that change the area information of the pointer
//or that lead to "negative" pointers automatically.
SET ; //Set RLO to 1 and
R #RET_VAL; //reset overflow
L #Pointer; //Supply value to temporary
T #Pointer1; //interim value pointer
L #Inc_Value; //Supply value of temporary
T #Inc_Value1; //interim value increment
A #Bit_Byte; //If =1, byte address instruction
JC Byte; //Jump to byte address calculation
L 7; //If value of increment > 7,
L #Inc_Value1;
<I ;
S #RET_VAL; //then set RET_VAL and
JC End; //jump to End
L -7; //If value of increment < -7,
<I ;
S #RET_VAL; //then set RET_VAL and
JC End; //jump to End
A L 1.3; //If bit 4 of the value = 1 (Inc_Value negative)
JC neg; //then jump to bit address subtraction
L #Pointer1; //Load pointer address information
L #Inc_Value1; //and add the increment
+D ;
JU test; //Jump to test for negative result
neg: L #Pointer1; //Load pointer address information
L #Inc_Value1; //Load the increment
NEGI ; //Negate the negative value,
-D ; //subtract the value
JU test; //and jump to test
Byte: L 0; //Start of byte address change
L #Inc_Value1; //If increment >=0, then
<I ;
JC pos; //jump to addition, otherwise
L #Pointer1; //Load pointer address information,
L #Inc_Value1; //load the increment,
NEGI ; //negate the negative value,