GenerateCode (XNode Ability)

From LabVIEW Wiki
Jump to: navigation, search
GenerateCode (XNode Ability)
List of XNode Abilities
Public Name:GenerateCode

This ability VI is called when it is time to define the execution behavior of your XNode via LabVIEW's scripting API. This VI is only called when you have previously informed LabVIEW that you need to script through a GenerateCode reply. Diagram is a reference to a diagram of a temporary VI. This diagram contains exactly one front panel terminal for each terminal of your XNode. Terms is an array of pairs of Term IDs and terminal references. LabVIEW will copy code scripted into this diagram into your XNode and connect everything to the correct terminals. The front panel terminals that are on this diagram are special in that they can only be on the top level diagram.

Generate Code? is used to tell LabVIEW whether or not you want to copy the scripted diagram over. If there is an error and you wish not to commit the changes, then the old XNode behavior will be left unchanged. If you set Generate Code? to false, then this VI will be called again next time type propagation is run. Otherwise, it will not be called until you indicate that it should be through the reply on another ability VI.

Because the diagram you are scripting into is separate from the VI containing the XNode instance, type propagation and the data manager will run on the temporary VI after each scripting call.

You should not use the Copy scripting method to move code into the temporary VI. This will adversely affect the user's clipboard. You should use the Move scripting method instead.

Default behavior: None.

This ability does not provide UI and OS messages are not handled.

See also