Function
Sets general-purpose output signal data.
Format
Ret = SmcWSetDigitalOut( Id, AxisNo, OutData, OutDataEnable )
Parameters
Id [ C, C++: short ] [ Python: ctypes.c_short ]
Specify the device ID retrieved by SmcWInit function.
AxisNo [ C, C++: short ] [ Python: ctypes.c_short ]
Specify axis number.
OutData [ C, 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 [ C, 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 [ C, C++: long ] [ 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.
C, C++
long Ret;
short OutData ;
short OutDataEnable ;
OutData = 1;
OutDataEnable = 1;
Ret = SmcWSetDigitalOut( 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