SmcWGetCountPulse


Function

Retrieves encoder count value.

Format

Ret = SmcWGetCountPulse( Id, AxisNo, CountPulse )

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.

CountPulse [ VB.NET: Integer ] [ C, C++: long * ] [ C#: out int ] [ Python: ctypes.POINTER(ctypes.c_long) ]
Specify the address of the variable that stores the encoder count value.
The count value is displayed with absolute coordinate.

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

Retrieves the preset value of encoder.

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

Example

The count value of the encoder of axis number 1 is acquired.

VB.NET
Dim Ret As Integer
Dim CountPulse As Integer
Ret = SmcWGetCountPulse( Id , 1, CountPulse )

C, C++
long Ret;
long CountPulse;
Ret = SmcWGetCountPulse( Id , 1, &CountPulse );

C#
int Ret;
int CountPulse;
Ret = Smc.WGetCountPulse( Id , 1, out CountPulse );

Python
Ret = ctypes.c_long()
CountPulse = ctypes.c_long()
Ret.value = csmc.SmcWGetCountPulse( Id , 1, ctypes.byref(CountPulse) )

See Also

SmcWGetOutPulse