Welcome to i.CanDrawIt® graphical programming
for Building Automation and Facility Management.

Assigning reference designators is a very critical part of creating the drawing. The FBn designation attached to every function block is MUCH MORE than just documentation.

The number "n" included in the FBn designation must be unique throughout the drawing, including all pages of a multi-page drawing, and all parts imported if heiarchial symbols are used (not recommended).

The FBn designation is used in two ways: (a) It is a prefix used in naming local variables unique to the function block; (b) It determines the execution order of the function block. FB1 is alway executed first regardless of where it appears on the drawing.

Because the FBn is used in creating names when source code is generated, you will end up with compiler errors if the "n" is not unique.

Because the FBn is used to determine execution order, you can greatly impact the way the program works by the ordering of the function blocks. You obviously want to read inputs before calculating results based on those inputs. You want to do calculations of output data before writing that data to physical outputs. Making this happen in the right order is done by properly ordering the "n" in all of the function blocks.

You can manually enter all of the function block numbers by editing FB? in the Tool Options dialog that appears when you Left-click on any block on the diagram. There is an easier way to make assignments: Use the reference painter.

When you select Assign Function Block Reference Numbers from the Special menu, the dialog shown below appears. Select Add References. If you are picking up where you left off after adding some new function blocks, enter a "Start at value" higher than 1. Then click the "Use reference painter" button.

While painting reference designators, the mouse cursor will be replaced with a plus symbol and question mark as illustrated below. Left-click on a function block to assign the next number in sequential order to that block. Continue throughout your drawing until all function blocks have been assigned an FBn number.

If you want to insert function blocks in between existing blocks in terms of execution order, you can remove all reference designators by selecting Remove References and clicking OK. Then proceed to re-paint designators starting at 1, and starting with the first block that should be executed.

Execution order is somewhat arbitrary, except that inputs should be processed before outputs, etc. If you ever get results you do not expect, consider whether the order of execution of the functon blocks in question might be causing the undesired result. This is especially true where synchronous latches or timing functions are involved.

Function blocks are executed in order, in round-robin manner, starting at FB1. If there is no FB1, the lowest numbered function block will be executed first. After the highest numbered FB is executed, execution will continue with the lowest numbered FB, and proceed in numerical FB order. This round-robin execution of function blocks will continue indefinitely. Total execution time, or scan time, is dependent on the complexity of the program, and on other system functions and the load they place on the system. Scan time is not tightly deterministic, and this environment should not be used for robotics or motion control. It is more than sufficiently deterministic for HVAC applications.