SmcWGetCounterMode


Function

The operation set up information of the counter is acquired.

Format

Ret = SmcWGetCounterMode( Id, AxisNo, ClearCntLtc, LtcMode, ClearCntClr, ClrMode )

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 the axis number.

ClearCntLtc [ VB.NET: Short ] [ C, C++: short * ] [ C#: out short ] [ Python: ctypes.POINTER(ctypes.c_short) ]
Specify the address of a variable to store the type of counter you want to clear when the LTC signal changes from OFF to ON.

0

Do not clear the counter

1

Clear the output pulse counter

2

Clear the encoder counter

3

Clear the output pulse counter and encoder counter

LtcMode [ VB.NET: Short ] [ C, C++: short * ] [ C#: out short ] [ Python: ctypes.POINTER(ctypes.c_short) ]
Specify the address of a variable to store the type of counter you want to latch when the LTC signal comes in.

0

Do not use latch function

1

Latch the output pulse counter

2

Latch the encoder counter

3

Latch the output pulse counter and encoder counter

ClearCntClr [ VB.NET: Short ] [ C, C++: short * ] [ C#: out short ] [ Python: ctypes.POINTER(ctypes.c_short) ]
Specify the address of a variable to store the type of counter you want to clear when the CLR signal changes from OFF to ON.

0

Do not clear the counter

1

Clear the output pulse counter

2

Clear the encoder counter

3

Clear the output pulse counter and encoder counter

ClrMode (Reserved) [ VB.NET: Short ] [ C, C++: short * ] [ C#: out short ] [ Python: ctypes.POINTER(ctypes.c_short) ]
0 fixed.

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

Initial Value

ClearCntLtc

0H  : Do not clear

LtcMode

0H  : Do not use

ClearCntClr

0H : Do not clear

ClrMode

0 fixed

Remarks

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

Example

The set up information of the encoder counter of axis number 1 is acquired.

VB.NET
Dim Ret As Integer
Dim ClearCntLtc As Short
Dim LtcMode As Short
Dim ClearCntClr As Short
Dim ClrMode As Short
Ret = SmcWGetCounterMode( Id , 1, ClearCntLtc , LtcMode , ClearCntClr , ClrMode )

C, C++
long Ret;
short ClearCntLtc;
short LtcMode;
short ClearCntClr;
short ClrMode;
Ret = SmcWGetCounterMode( Id , 1, &ClearCntLtc , &LtcMode , &ClearCntClr , &ClrMode );

C#
int Ret;
short ClearCntLtc;
short LtcMode;
short ClearCntClr;
short ClrMode;
Ret = Smc.WGetCounterMode( Id , 1, out ClearCntLtc , out LtcMode , out ClearCntClr , out ClrMode );

Python
Ret = ctypes.c_long()
ClearCntLtc = ctypes.c_short()
LtcMode = ctypes.c_short()
ClearCntClr = ctypes.c_short()
ClrMode = ctypes.c_short()
Ret.value = csmc.SmcWGetCounterMode( Id , 1, ctypes.byref(ClearCntLtc) , ctypes.byref(LtcMode) , ctypes.byref(ClearCntClr) , ctypes.byref(ClrMode) )

See Also

SmcWSetCounterMode