Function
Sets the type of control input signal.
(General-purpose input/ALM,INP,SD,LTC,PCS,CLR)
Format
Ret = SmcWSetCtrlTypeIn( Id, AxisNo, CtrlIn )
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 the axis number.
CtrlIn [ C, C++: short ] [ Python: ctypes.c_short ]
Set the type of control input signal.
[ 0 | 0 | IN6/CLR | IN5/PCS | IN4/LTC | IN3/SD | IN2/INP | IN1/ALM ] Setting range:0 to 3F (Hex)
IN1/ALM |
0 : Used as IN1 (General-purpose input) 1 : Used as the input of alarm (ALM) signal |
IN2/INP |
0 : Used as IN2 (General-purpose input) 1 : Used as the input of servo-driver positioning completion (INP) signal |
IN3/SD |
0 : Used as IN3 (General-purpose input) 1 : Used as the input of deceleration (deceleration stop) (SD) signal |
IN4/LTC |
0 : Used as IN4 (General-purpose input) 1 : Used as Used as the input of LTC signal Latche the value of COUNTER1 to COUNTER2 (COUNTER1 to COUNTER4 for SMC-4/8DF) |
IN5/PCS |
0 : Used as IN5 (General-purpose input) 1 : Used as the input of PCS signal The motion to determine the position begins when this signal comes in. (Used for override 2 of target position) |
IN6/CLR |
0 : Used as IN6 (General-purpose input) 1 : Used as the input of CLR signal Reset the specified counters among COUNTER1 to COUNTER4 (For SMC-2/4/8DL, IN6 is fixed. CLR signal cannot be set) |
Return Value
Ret [ C, C++: long ] [ Python: ctypes.c_long ]
0 |
Terminated normally |
Non-zero |
Terminated abnormally |
See also: Error code details
Initial Value
Used as the input of alarm (ALM) signal
Remarks
When LtcMode = 1H is being
set by the SmcWSetCounterMode function, if the bit4(LTC) is not ON, because
it is not recognized as LTC signal, it can not be latched.
It is same when ClearCntLtc = 1 to 3H.
If bit 5(PCS) of CtrlIn
has been turned on, PCS signal is changed to be the input waiting state.
Until PCS signal is input (or, until PCS input agency commands occur),
motion is changed to be JOG operation unconditionally.
Operating from the timing of the PCS signal is input to the position of
specified pulses.
This function cannot be executed when the device is in operation.
After "Initial Setting function" is executed, it is necessary to execute SmcWSetInitParam.
Refer to "About Initial Setting function".
Example
The control input signal
form of axis number 1 is set.
It uses it as servo driver's positioning completion (INP) signal input.
Other input is used as a general-purpose input.
C, C++
long Ret;
short CtrlIn ;
CtrlIn = 2 ;
Ret = SmcWSetCtrlTypeIn( Id , 1, CtrlIn );
Python
Ret = ctypes.c_long()
CtrlIn = ctypes.c_short()
CtrlIn.value = 2
Ret.value = csmc.SmcWSetCtrlTypeIn( Id , 1, CtrlIn )
See Also