Technical FAQs

Ask a Question

Pasting of a function block that was cut from and FBD or LD function block results in the same instance being used.

Goals and Symptoms
Provide a detailed explanation for the cut and paste function in Unity and  to explain why this behavior is normal.

Facts and Change
Unity

Causes and Fixes 

If you paste a function block that was cut from and FBD or LD function block, it results in the same instance being used. 

This behavior is normal and works as designed. 

The following is a description forf the behavior of the Copy, Cut, Paste of a function block instance (FBI). This only applies to the FBD and LD graphical languages.
  • Paste of an FBI after performing a copy of it form the Unity section.
Paste of a copied function block will result in a new function block instance (FBI) being used.  If subsequent multiple paste operations are performed, each paste will result in a new function block instance with the instance name of the function block incremented by a value of 1.. (i.e., Pasting of a copied timer function block named TON_1 will result in the timer function block with the instance name TON_2 getting created.  If you perform another paste, the timer function block with the instance name TON_3 is created.)

 
 
  • Paste of an FBI  after performing a Cut of it from the Unity section.
 
Paste of a function block after performing a cut operation results in the same instance of the function block being used.  If the paste is repeated again, the same instance will also be used.  (i.e., If you cut a timer function block named TON_1 and pasted it to the logic, the pasted function block will have the instance name TON_1.  If you performed additional paste operations, each subsequent pasted function block will still have the same instance name TON_1).



Warning :

Using the same instance of a function block  is not recommended because it can lead to incorrect execution of the function blocks.   This is due to the fact that the FBI uses contextual variables that are owned by each instance usage.  The specifcally owned contextual variables cannot be applied to any other FBI.   

i.e.,

Current value of a timer named TON_1 cannot be shared with another timer named TON_2 because it is specific to that one timer instance (TON_1) and one timer usage.  

 
Was this helpful?
What can we do to improve the information ?