SmcWGetLatchCountPulse


Function

Retrieves count value of the encoder that the latch is done by the LTC signal input is acquired.

 

Format

Ret = SmcWGetLatchCountPulse( Id , AxisNo , CountPulse )

 

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.

 

CountPulse [ C, C++: int * ] [ Python: ctypes.POINTER(ctypes.c_int) ]

Specify the address of the variable that stores the encoder count value.
The count value is displayed with absolute coordinate.

 

Return Value

Ret [ C, C++: long ] [ Python: ctypes.c_long ]

0

Terminated normally

Non-zero

Terminated abnormally

See also: Error code details

 

Remarks

It is necessary to set IN4 to LTC with SmcWSetCtrlTypeIn.
It is necessary to select the counter to which the latch is done with SmcWSetCounterMode.

This function can be executed even if the device is in operation.

 

Example

Axis number 1 acquires the count value of the encoder that the latch is done.

 

C, C++

long Ret;

int CountPulse ;

Ret = SmcWGetLatchCountPulse( Id , 1, &CountPulse );

 

Python

Ret = ctypes.c_long()

CountPulse = ctypes.c_int()

Ret.value = csmc.SmcWGetLatchCountPulse( Id , 1, ctypes.byref(CountPulse) )

 

See Also

SmcWSetCtrlTypeIn SmcWSetCounterMode