Skip to main content

io-指令

15.4.6 IO commands

15.4.6.1 SetDO

Explanation

It is used to set the value of a digital output signal. If the command is performed after the motion command, it will not interrupt the turning zone and be triggered at the end of the motion command trajectory or at the starting point of the turning zone. See Example 2 for specific usage.

Definition

SetDO(DoName, Value );

DoName, data type: signaldo, to determine the name of the DO signal that needs to change state, which must be a variable that has already been defined in the input/output interface.

Value, data type: bool, the target state of the DO signal, and only true and false are available.

Example

Example 1

SetDO(do2, true);

The digital output point corresponding to do2 is set at a high level.

Example 2

Scenario 1: IO commands between two motion commands with turning zones is adopted

MoveL(p1,v1000, z50, tool0);

SetDO(do2, true);

MoveL(p2,v1000, z50, tool0);

At this point, the SetDO command is triggered at the starting point of the turning zone from p1 to p2.

Scenario 2: There are no longer motion commands after using the IO command with the turn area motion command

MoveL (p1,v1000, z50, tool0);

SetDO (do2, true);

…​…​…​…​…​…​…​…​…​…​.(There are no subsequent motion commands or commands to interrupt the turning zone)

At this point, the SetDO command is triggered to execute after the motion command reaches p1.

Scenario 3: Motion command does not include the turning zone

MoveL (p1,v1000, fine, tool0);

SetDO (do2, true);

…​…​…​…​…​…​…​…​…​…​..(Regardless of subsequent commands)

At this point, the SetDO command is triggered to execute after the motion command reaches p1.

15.4.6.2 SetAllDO

Explanation

It is used to set the value of all digital output signals. If the command is performed after the motion command, it will not interrupt the turning zone and be triggered at the end of the motion command trajectory or at the starting point of the turning zone. See Example 2 of SetDO for specific usage.

Definition

SetAllDO(Value );

Value, data type: bool, the target state of the DO signal, and only true and false are available.

Example

Example 1

SetAllDO (true);

Set all digital output voltages to a high level, except DO bound with system function.

15.4.6.3 SetGO

Explanation

It is used to set the value of a group. If the command is performed after the motion command, it will not interrupt the turning zone and be triggered at the end of the motion command trajectory or at the starting point of the turning zone. See Example 2 of SetDO for specific usage.

Definition

SetGO(GoName, Value );

GoName, data type: signalgo, to determine the name of the go signal that needs to change value, which must be a variable that has already been defined in the input/output interface.

Value, data type: int, the target value of go signal. Note: The maximum supported value is 2, 147, 483, 648 (231).

Example

Example 1

SetGO (go3, 8);

Set the value of a set of physical ports corresponding to go3 as 8.

15.4.6.4 SetAO

Explanation

It is used to set the value of an analog output signal. If the command is performed after the motion command, it will not interrupt the turning zone and be triggered at the end of the motion command trajectory or at the starting point of the turning zone. See Example 2 of SetDO for specific usage.

Definition

SetAO(AoName, Value );

AoName, data type: signalao, to determine the name of the ao signal that needs to change value, which must be a variable that has already been defined in the input/output interface.

Value, data type: double, the target value of the ao signal.

Example

Example 1

SetAO (ao3, 5.123);

Set the value of a set of physical ports corresponding to ao3 as 5.123.

15.4.6.5 SetVDI

Explanation

Set the value of the digital input signal for a virtual IO device.

Definition

SetVDI(VDIName, Value);

VDIName, data type: signaldi, specifying the name of VDI (Virtual Digital Input) whose state should be changed.

Value, data type: bool, the target state of the VDI signal, and only true and false are available.

Example

Example 1:

SetVDI(VDI_0, true);

Set the digital output port of the virtual IO device corresponding to VDI_0 to a high level.

15.4.6.6 PulseDO

Explanation

It is used to generate a pulse of the DO signal. If the command is performed after the motion command, it will not interrupt the turning zone and be triggered at the end of the motion command trajectory or at the starting point of the turning zone. See Example 2 of SetDO for specific usage.

Definition

PulseDO ([\High,] [length,] signal);

[\High], when the command is executed, regardless of the current state, the signal state is always set to high (1).

[length,], to specify pulse length: 0.001-2000s. Default to 0.2s when missing. Data type:double or int

signal, the signal to generate the pulse. Data type:signaldo

Attention

If SetDO/SetGO is executed during PulseDO, PulseDO will be invalid and SetDO/SetGO will be executed.

15.4.6.7 PulseVDI

Explanation

It is used to generate a pulse on the digital input signal of virtual IO devices.

Definition

PulseVDI([\High,] signal_name);

[\High], when th[length,]e command is executed, regardless of the current state, the signal state is always set to high (1).

[length,], to specify pulse length: 0.001−2000s, default to 0.2s when missing, data type: double or int.
signal_name, the signal to generate the pulse, data type: signaldi.

Example

Example 1:

SetVDI(VDI_0, false);

PulseVDI(\High, 2, VDI_0);

The digital output port of the virtual IO device corresponding to VDI_0 will generate a high-level pulse lasting for 2s.

15.4.6.8 PulseReg

Explanation

It is used to specify a register to generate a pulse signal for a specified time and restore the initial value of the register after the end of the time. If this command is performed after the motion command, it will not interrupt the turning zone but will be triggered at the end of the motion instruction trajectory or at the starting point of the turning zone. See Example 2 of SetDO for specific usage.

Definition

PulseReg (Register, Value, Time);

Register, name of the register to generate the pulse signal, data type: Bit/Bool register

Value, to specify the value of the pulse signal, data type: Bool.

Time, the duration of the pulse signal in seconds, with a limit range of [0.001, 10.0]. Data type: double

Attention

If WriteRegByName or register equal assignment is executed during PulseReg, the valid value of the register will take effect depending on the last executed command. But the initial value before executing PulseReg will be restored after the time period specified by PulseReg ends.