Skip to main content

Function Block Diagram Specifications

Function Block Specifications

Function Block Specifications
Function BlockSpecificationNote
ProjectMaximum Registered Function Blocks128User Library
Maximum Used Function BlocksUp to CPU memory
LanguageInstruction List
Ladder Diagram
Function BlockName32 characters
Password16 characters
Password Hint40 characters
Program Capacity512 Steps
Description64 characters
VariableMaximum Number128
Input + I/O: 64
Output + I/O: 64
Local Variable: 896 WORDs
Local Variable: Z data register
Name16 characters
Description16 characters
VersionCICONv6.00 or higher
PLC CPUMultiple Function Blocksv6.00 or higherMultiple Function Blocks used
Single Function BlockAnySingle Function Block used
  • IO Variable Limitation:

    • For non-Multiple Function Blocks, the number of I/O variables is limited to a maximum of 32.
  • Local (Internal) Variable Usage - Z Data Register:

    • For FB Extension, local variables can be assigned to the Z data register.
      • The allowable address range for these local variables is from Z128 ~ Z1023.
    • The addresses Z0 ~ Z127 are reserved by default for controlling function blocks and cannot be assigned as local variables.
      • Using these reserved addresses may lead to improper functioning of the function blocks.

Required CPU

Required CPU for Function Block
PLC SeriesCPUFunction BlockFunction Block Extension
CM1XPnA-
XPnB
CPnA ~ D-
CM2BP-
CM3Plus
Mini Modular
Micro-S
Pro
  • Function Block (FB) Compatibility with CP Series:

    • To utilize Function Blocks (FB) in the CP series, the CPU firmware must be version 4.43 or higher.
  • Support for Multiple Function Blocks:

    • Multiple Function Blocks are supported starting from CPU firmware version 6.00 or higher.
  • Definition of Multiple Function Blocks:

    • Multiple Function Blocks allow the use of more than one Function Block on a single rung in a program.

Function Block Size

Function Block Download Options

When using Function Blocks in a scan program, the size of the project file increases depending on the number of data registers, variables, and descriptions involved. The Function Block is added to the project file during the compilation process, which may result in differences between the project file size and the step count downloaded to the PLC.

To optimize PLC memory usage, the "FB Information - Full Download" option is disabled by default in the CICON options menu. This typically reduces the size of the download by 50%-80%.

  1. Left-click Tools and left-click Options.

  1. Under the General tab, check Download all Function Block info.

  1. Acknowledge the warning and left-click OK.

Full Download Enabled

When the FB Information - Full Download option is enabled, the following data is downloaded to the CPU module:

  • Function Block Information:
    • Name
    • Password
    • Hint
    • Description
  • Function Block Variables:
    • Variable Name
    • IO
    • Type
    • Device
    • Description
  • Scan Program for the Function Block
  • Additional Steps (approximately 2–3 steps)

Full Download Disabled

When FB Information - Full Download is disabled, the following data is downloaded to the CPU module:

  • Function Block Information:
    • Password
  • Function Block Variables:
    • IO
    • Type
    • Device
  • Scan Program for the Function Block
  • Additional Steps (approximately 2–3 steps)

Function Block Upload

When uploading a program from the PLC to CICON, the opened project file in CICON must match the uploaded Function Blocks to ensure consistency. If the Function Blocks in the project file and the uploaded program differ, the variable names and descriptions in the uploaded Function Blocks may differ.

  • When the project file contains the same Function Blocks as the uploaded program:

    • If the timestamp is identical, the same Function Blocks are uploaded.
    • If the timestamp differs, choose to overwrite the uploaded Function Blocks into the project file.
    • Upon selecting Yes, a list of available Function Blocks will appear:

    • Replace FB:
      • The uploaded Function Block will replace the existing one in the project file.

Recovering Overwritten Function Blocks

Even if incorrect Function Blocks are overwritten, recovery is still possible.

  1. Right-click the Function Block.
  2. Choose Recovery FB (R) from the context menu.
  3. Select the desired Function Block to recover.

Function Block L Data Register

When a Function Block is created, 16 WORDs (256 bits) are automatically assigned to an L data register address. As a result, these specific L addresses cannot be utilized in other scan programs.

L Data Register Allocation
PLC SeriesCPUInput
(64 Bit)
Output
(64 Bit)
Monitoring
CM1XP1AL984.0 ~ L987.FL988.0 ~ L991.FL992.0 ~ L999.F
XP2A
XP3AL112.0 ~ L115.FL116.0 ~ L119.FL120.0 ~ L127.F
CP3
CP4
XP1BL984.0 ~ L987.FL988.0 ~ L991.FL992.0 ~ L999.F
XP2B
XP3B
CM2BPL48.0 ~ L51.FL52.0 ~ L55.FL56.0 ~ L63.F
CM3PlusL240.0 ~ L243.FL244.0 ~ L247.FL248.0 ~ L255.F
Mini Modular
Micro-S
Pro

Limitation of Function Block Diagram

Positive/Negative Transition-Sensing Contacts

When positive and negative transition-sensing (one-shot) contacts are repeatedly used within a Function Block, the Function Block may fail to recognize them. To avoid this issue, replace these transition contacts with a normally open contact:

Array Type Instruction

In a Function Block, input and output variables utilize data register addresses sequentially.

For example, if the BMOV instruction is used with the intention of transferring D10, D11, and D12 to D100, D101, and D102 in sequence, the output may not appear as expected. Instead, it could result in a mismatch due to the sequential addressing within the Function Block.

D10 moves to D100, M100 moves to D101, and X30 moves to D102.

Use Index register as below:

Write an offset value 10 to IN1 (D data register) and make it index register (R0) to have value in sequence.

Timer & Counter

To use a timer or counter in a Function Block, the index register, offset R data register, must be used. Timer and counter instructions can only use the timer and counter data registers.

The index register, R, can be used with the below CPU types:

R Data Register Compatibility
CPU TypeMinimum Firmware Version
XPnBVersion 6.10
XPnEAny
CPnEAny
PlusVersion 6.10
Mini ModularVersion 6.10
Micro-SVersion 6.10
ProVersion 6.10

Timer: TON (On Delay Timer)

Variable Configuration

TON
Variable NameI/OTypeDevice
FLAGInputBOOLOperating bit for ON delay timer
OFFSETInputWORDWrite index register number (0 ~ 15)
SETTINGInputWORDWrite timer set value (TS)
(According to PLC parameter, 100ms / 10ms)
OUTPUTOutputBOOLON if the FLAG bit remains ON during setting time
  • SETTING : If it is 100 milliseconds and 30 is written, it will be 3 seconds.

Function Block Scan Program

  • Before using the index register (R), save the OFFSET value into the register.
    • Assign the OFFSET variable value to R0.
    • When the ON delay timer is turned ON, the timer begins counting.
    • If the timer remains ON for the specified duration set in the SETTING parameter, the OUTPUT will be turned ON.

Timer in Scan Program

When using a timer in a Function Block, it is recommended to utilize the F1.0 internal relay flag to handle ON delay or OFF delay functionality.
For example:

  • If M0.0 remains ON for 3 seconds (using a 100ms timer), the output M1.0 will be turned ON.

Monitoring

Once a Function Block is downloaded to the CPU and the CPU enters RUN mode, the Function Block appears in monitoring mode.

If M0.0 is OFF, the timer will not function even if the Function Block is running.

When M0.0 is turned ON and remains ON for 3 seconds (using a 100ms timer), the OUTPUT (M1.0) will turn ON.

The Timer data register is shown below:

Counter: CTU (Up Counter)

Variable Configuration

CTU
Variable NameI/OTypeDevice
FLAGInputBOOLOperating bit for up counter
OFFSETInputWORDWrite index register number (0 ~ 15)
SETTINGInputWORDWrite counter set value (CS)
RESETInputBOOLCounter reset bit
OUTPUTOutputBOOLON if the FLAG bit is turned ON or OFF as a setting counter

-RESET: COUNTER is not cleared automatically. It must be cleared by the RESET bit.

Function Block Scan Program

  • Before using the index register (R), ensure the OFFSET value is saved in the register.
    • Assign the OFFSET variable value to R0.
    • When the up counter is turned ON, the counter value increases.
      • If the RESET bit is ON, the counter value is cleared.
    • Once the counter reaches the assigned value in the SETTING parameter and the condition is met, the OUTPUT will turn ON.

Counter in Scan Program

For Counter operations in a Function Block, the F1.0 internal relay flag is recommended for ON delay or OFF delay functionality.
For example:

  • If M0.0 is turned ON and OFF five times (with the OUTPUT activating on the 5th ON event), the output M1.0 will turn ON.

Monitoring

After downloading a Function Block to the CPU and switching it to RUN mode, the Function Block enters monitoring mode.

If M0.0 is OFF, the counter will not function even if the Function Block is active.

On the 5th ON event of M0.0, the OUTPUT (M1.0) will turn ON.

The Counter data register is shown below:

If the RESET bit (M0.5) is turned ON, the counter value is cleared.

After being cleared, the counter data register is shown below: