Programming
BC3150
58
Version: 2.1.0
5.4
Remanent data
2000 kbyte of remanent data are available for the BX controller. These data are declared as VAR RETAIN in
PLC Control:
Example
VAR RETAIN
Test :BOOL;
Count :INT;
END_VAR
Retain data are located between VAR RETAIN and END_VAR. These data are stored in a NOVRAM and
are consistent across the whole 2 kbyte range. The RETAIN data are stored in the NOVRAM after each
cycle. For 2 kbyte approx. 2 ms are required (for 1 kbyte approx. 1 ms). The variables can be configured
locally or globally. Allocated variables (%MB, %QB, %IB) cannot be used as remanent data.
Note
Do not use VAR_RETAIN in function blocks
VAR_RETAIN should not be used in function blocks. All FB data are copied into the retain
memory. This leads to an unnecessary increase in cycle time, and the retain memory is
filled with unnecessary data.
Note
Do not use variables with address as remanent data
Variables that have been assigned an address (%MB, %QB, %IB) must not be used as re-
manent data.
Example for remanent data in the function block
This should be avoided, if possible, since all the data of a function block, in which even just a single
remanent bit is found, are stored by default. A program sample can be found below.
Function block test (no program code required - in ST semicolon is sufficient)
FUNCTION_BLOCK Test
VAR_INPUT
END_VAR
VAR_OUTPUT
END_VAR
VAR
END_VAR
VAR_IN_OUT
Counter :INT;
END_VAR
MAIN program
PROGRAM MAIN
VAR
fb_Test:Test;
END_VAR
VAR RETAIN
iCounter1:INT;
END_VAR
fb_Test(Counter:=iCounter1);
Содержание BC3150
Страница 1: ...Documentation BC3150 Bus Terminal Controller for PROFIBUS DP 2 1 0 2017 07 11 Version Date...
Страница 2: ......
Страница 45: ...Parameterization and Commissioning BC3150 45 Version 2 1 0 Fig 41 Sample for entering associated bytes...
Страница 57: ...Programming BC3150 57 Version 2 1 0 Fig 55 Build...
Страница 87: ...PROFIBUS BC3150 87 Version 2 1 0 Fig 78 RS485 topology with 3 segments and 2 repeaters...