Utilities

Additional VIs can be found under Utilities.

Check License

The Check License block checks the target system for a valid TF3710 TwinCAT 3 Interface for LabVIEW™ license.

Utilities 1:

Input/output

Meaning

[0] Handle

The handle to the client

[5] Target/Symbol

ADS target as string consisting of AMSNetId or ADS symbol as string consisting of AMSNetId and symbol name

[4] Handle

The handle to the client

[6] Target/Symbol

ADS target as string consisting of AMSNetId or ADS symbol as string consisting of AMSNetId and symbol name

[8] LicenseInfo

LabVIEW™ cluster consisting of three elements:

  • Boolean flag (TRUE if license is valid, FALSE otherwise)
  • AMSNetId of the target system
  • String with message about the license state, e.g. "license is valid" or "trial license denied“

Get Device State

The Device State block is a polymorphic VI and can be operated as Get Device State and Set Device State.

The operation mode Get Device State reads the current state of the target system and the PLC.

The following table describes the ADS port and its meaning:

ADS Port

ADS State

State

TC3 PLC Port > 851

ADS_STATE_RUN

PLC is running.

 

ADS_STATE_STOP

PLC is stopped.

 

ADS_STATE_RESET

PLC is reset.

System Port = 10000

ADS_STATE_RECONFIG

TwinCAT is in Config mode.

 

ADS_STATE_RESET

TwinCAT is in Run mode.

Utilities 2:

Input/output

Meaning

[0] Handle

The handle to the client

[5] Target

ADS target as string consisting of AMSNetId

[4] Handle

The handle to the client

[6] Target

ADS target as string consisting of AMSNetId

[8] Device State

State of the target system (ENUM)

[10] ADS State

State of the PLC (ENUM)

Set Device State

The Set Device State block changes the current state of the target system and the PLC.

With a specific ADS Port and ADS State the PLC or TwinCAT can be set to a corresponding state. The following table describes the ADS port and its usage:

ADS Port

ADS State

State

TC3 PLC Port > 851

ADS_STATE_RUN

Starts the PLC.

 

ADS_STATE_STOP

Stops the PLC.

 

ADS_STATE_RESET

Resets the PLC.

System Port = 10000

ADS_STATE_RECONFIG

Puts TwinCAT in Config mode.

 

ADS_STATE_RESET

Puts TwinCAT in Run mode.

Utilities 3:

Input/output

Meaning

[0] Handle

The handle to the client

[5] Target

ADS target as string consisting of AMSNetId

[7] Device State

New state of the target system (numeric)

[9] ADS State

New state of the PLC (ENUM)

[4] Handle

The handle to the client

[6] Target

ADS target as string consisting of AMSNetId

Get Version Info

The Get Version Info block returns the current version of the TF3710 setup and the installed TF3710 library as a LabVIEW™ string.

Utilities 4:

Output

Meaning

[6] ProductVersion

Setup version as string

[8] FileVersion

Version of the installed TF3710 library as string

Generate Type

The Generate Type block automatically generates the LabVIEW™ data type based on a TypeInfo description from a TwinCAT 3 data type.

The LabVIEW™ type can be inserted as a constant or control on a block diagram or saved as a LabVIEW™ ctl file. The Generate Type block is a wrapper VI and uses low-level class objects from TypeGenerator together with the TypeResolver. There are several ways in which the wrapper block can be parameterized.

  1. The TypeResolver is already initialized externally and LabVIEW™ already has a TypeHandle. The bAutoInit flag has the value "False":
  2. The TypeResolver is not initialized externally and LabVIEW™ does not have a TypeHandle. The bAutoInit flag has the value "True":
    • The TypeResolver has no information regarding the TwinCAT 3 data type.
    • The wrapper block needs the TypeInfo to generate the type.
    • The example Generate Type using TypeInfo file uses this method.
Utilities 5:

Input/output

Meaning

[0] Handle

The handle to the client

[1] bAutoInit

Boolean flag (True = TypeResolver is initialized internally, otherwise False)

[2] Saving Info

LabVIEW™ cluster consisting of three elements:

  • CustomDir: Boolean flag
    TRUE = LabVIEW™ type is saved in a specific folder (Dir Name). If this folder does not exist, the block creates the folder.
    FALSE = LabVIEW™ type is saved in the project folder, subfolder Ctl.
  • Dir Name: LabVIEW™ string (name of the folder)
  • Control FileName: LabVIEW™ string (name of the new Ctl. If empty, the block uses the name from the TypeInfo)

[3] VI Refnum

A static VI Refnum
The block uses the VI Refnum to insert the LabVIEW™ type as a Constant/Control/Indicator on the block diagram.

[5] TypeHdl

The handle to the TypeResolver

[7] Symbol Group

LabVIEW™ Enum:

  • Read symbol: The block generates a control.
  • Write symbol: The block generates a control.

[9] TypeInfo

LabVIEW™ string as XML description of TwinCAT 3 data type

[12] Block Diagram Type Stype

LabVIEW™ Enum:

  • Constant
  • Control/Indicator

[13] Control/Indicator/Constant Name

LabVIEW™ string.

Empty string: Default name of the TypeInfo.

Otherwise: Name of the Control/Indicator/Constant.

[8] Generated Type Name

LabVIEW™ string as the name of the generated type

[10] Loaded Type

LabVIEW™ Enum
Describes which data type was generated.

Utilities 6:

"Symbol Group" parameter

The Symbol Group parameter can be used to select whether a control/display element must be generated. For the control, the TypeGenerator generates the type without name, because the TypeResolver supports the control without name. If the control is a LabVIEW™ cluster, then the cluster members are also generated without names.