FB_HVACNOVRAMDataHandling

FB_HVACNOVRAMDataHandling 1:

PLC variables are written fail-safe to NOVRAM with this function block. Following a power failure or a restart of the controller, the NOVRAM will be read out completely.

The behavior of the function block is as follows if everything was correct when starting:
udiStatus:= 1;
iNovRamReadCount:= 1;
iNovRamWriteCount:= 0;
bDone:= TRUE;

FB_HVACNOVRAMDataHandling 2:

In the case of ARM-based runtime systems, please make sure that the memory addresses of the PLC variables are divisible by 4!

The globally declared variables g_dwHVACVarConfigStart and g_dwHVACVarConfigEnd are located with the start address and end address of the memory area. The user must take care to ensure that there are no memory overlaps. The block size is then determined internally from the two addresses. The entire flag area is written automatically to NOVRAM in the event of changes to the flag variables.

VAR_INPUT

sNETID            : T_AmsNetId; 
TMOUT             : TIME;    
udiDevID          : UDINT;   
usiBlockSize      : USINT; 

sNETID: AmsNetId of the TwinCAT computer on which the function should be executed. If it is to be run on the local computer, an empty string can be entered.

TMOUT: States the length of the timeout that may not be exceeded by execution of the ADS command.

udiDevID: The Device ID specifies the NOVRAM of the CX90xx or CX10xx to be accessed with the function block for reading or writing. The device IDs are specified by the TwinCAT System Manager during hardware configuration.

FB_HVACNOVRAMDataHandling 3:

usiBlockSize: The block size to be accessed per read/write cycle is specified in percent; e.g. 20, i.e. 5 read/write cycles will be required in order to access the entire flag area.

VAR_OUTPUT

udiStatus           : UDINT;
iNovramReadCount    : INT;  
iNovramWriteCount   : INT; 
bDone               : BOOL;
bBusy               : BOOL; 
bError              : BOOL;
udiErrorID          : UDINT;

udiStatus: = 0 , no state

= 1, valid data at last reading of NOVRAM

= 2, invalid data at last reading of NOVRAM. Data were discarded.

iNovramReadCount: Counter that is incremented by 1 when NOVRAM is read from.

iNovramWriteCount: Counter that is incremented by 1 when NOVRAM is written to.

bDone: Will be set to TRUE if the function block is executed.

bBusy: When the function block is activated the output is set, and it remains active until execution of the command has been completed.

bError: This output is switched to TRUE as soon as an error occurs during the execution of a command. The command-specific error code is contained in udiErrorID.

udiErrorID: Contains the command-specific error code (see ADS Return Codes).

Requirements

Development environment

required library

required function

TwinCAT 3.1 build 4022.16 or higher

Tc2_HVAC V3.3.1.0

TF8000 | TC3 HVAC V1.0.0.0