SmcWSetDigitalOut


Function

Sets general-purpose output signal data.

Format

Ret = SmcWSetDigitalOut( Id, AxisNo, OutData, OutDataEnable )

Parameters

Id [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
SSpecify the Deice ID retrieved by SmcWInit function.

AxisNo [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Specify axis number.

OutData [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Set common output signal data.

[ 0 | 0 | 0 | 0 | 0 | OUT3 | OUT2 | OUT1 ]
value

0

Signal OFF

1

Signal ON

OutDataEnable [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Set the bit you want to change the data in common output signal. Please set 1 to the bit only which is being set to common output signal by initial setting utility.

[ 0 | 0 | 0 | 0 | 0 | OUT3 | OUT2 | OUT1 ]
value

0

Invalid

1

Valid

Return Value

Ret [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long ]

0

Terminated normally

Non-zero

Terminated abnormally

See also: Error code details

Remarks

The signal is output by this function only as for the bit set by the SmcSetCtrlTypeOut function as a general-purpose output.
Please note that the signal is output by this function as for the bit set as holding the off signal.

It can not be executed while motor is already in motion.

Example

The general-purpose output signal data of axis number 1 is set, and output.
One is output to the OUT1 bit.

VB.NET
Dim Ret As Integer
Dim OutData As Short
Dim OutDataEnable As Short
OutData = 1
OutDataEnable = 1
Ret = SmcWSetDigitalOut( Id , 1, OutData , OutDataEnable )

C, C++
long Ret;
short OutData;
short OutDataEnable;
OutData = 1;
OutDataEnable = 1;
Ret = SmcWSetDigitalOut( Id , 1, OutData , OutDataEnable );

C#
int Ret;
short OutData;
short OutDataEnable;
OutData = 1;
OutDataEnable = 1;
Ret = Smc.WSetDigitalOut( Id , 1, OutData , OutDataEnable );

Python
Ret = ctypes.c_long()
OutData = ctypes.c_short()
OutDataEnable = ctypes.c_short()
OutData.value = 1
OutDataEnable.value = 1
Ret.value = csmc.SmcWSetDigitalOut( Id , 1, OutData , OutDataEnable )

See Also

SmcWGetDigitalOut