Add i/o and timer declarations, Code guidelines – Echelon IzoT NodeBuilder User Manual

Page 194

Advertising
background image

};
//
//<Fblock Output NV Declarations>
network output SNVT_lev_percent nvoPercentage;
:
:
//
//}}NodeBuilder Code Wizard End

You can override the code generated by the NodeBuilder Code Wizard by moving the //<Fblock
Output NV Declarations>
command out of the Code Wizard section, as shown below:

//{{NodeBuilder Code Wizard Start
:
//<Fblock Input NV Declarations>
network input SNVT_temp_p nviTempP
nv_properties {

cpTransInMin = 0,

cpTransInMax = 3000L

};
:
:
//
//}}NodeBuilder Code Wizard End
//
//<Fblock Output NV Declarations>
network output SNVT_lev_percent nvoPercentage
nv_properties {

cpTransInMin = 0,

};

Once you take the //<Fblock Input NV Declarations> command out of the Code Wizard managed
section of the code, the Code Wizard will no longer create input network variable declarations. If you
want to add additional input network variables to the functional block, they must be added manually.

Code Guidelines

The following sections provide recommendations for modifying the code generated by the
NodeBuilder Code Wizard. This is not a comprehensive list and the modifications you make will vary
depending on the purpose of your device.

Add I/O and Timer Declarations

Initialize global I/O, timers, variables, and the interrupt system in the when (reset) task within the
main Neuron C file (main.nc). Initialize functional block-specific I/O, timers, and variables in the
relevant functional block’s director function. Upon completion of the initialization for each functional
block, release the lockout bit for each functional block and thus allow it to operate. The following
example demonstrates this:

....

else if ((TFblock_command)iCommand == FBC_WHEN_RESET)

// raised by when ( reset ) task

{

// initialize output lines:

SetLed( 0, DigitalOutput[0]::cpDigitalDefault.state );

SetLed( 1, DigitalOutput[1]::cpDigitalDefault.state );

setLockedOutBit( uFblockIndex, FALSE );

}

180

Developing Device Applications

Advertising