SmcWSetStopPosition


Function

Sets stop position of the motor(total number of output pulses).

Format

Ret = SmcWSetStopPosition( Id, AxisNo, Coordinate, StopPosition )

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.

Coordinate [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Specify the address of a variable to store the value of position coordinate.

0: Absolute coordinate
1: Relative coordinate
Valid value : 0, 1

StopPosition [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long ]
Set stop position.
The specified range varies depending on the device.
For details, please refer to "Specifications based on devices section".

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

Because movement distance is "0" when you specify absolute coordinate to Coordinate and specify the retrieved value by SmcWGetOutPulse to StopPosition, the return value is error completion.

If Coordinate is specified to absolute coordinate, the position of [0] is as a datum point.
The coordinate is the value retrieved by SmcWGetOutPulse. And, it can be preset by SmcWSetOutPulse.
For example, if the current position is as a datum point, preset to [0] by SmcWSetOutPulse.

Specifications based on devices

Model No.

LSI chip for Pulse Control chip
() : bit number for encoder input

The valid range for StopPosition

SMC-4DL-PE
SMC-8DL-PE
SMC-4DL-PCI
SMC-8DL-PCI

PCL6145 (32bits)

Absolute coordinate: -2,147,483,648 to +2,147,483,647
Relative coordinate: -2,147,483,648 to +2,147,483,647 (except for 0)

PCL6143 (28bits)

Absolute coordinate: -134,217,728 to +134,217,727
Relative coordinate: -134,217,728 to +134,217,727 (except for 0)

SMC-4DF2-PCI 
SMC-8DF2-PCI

PCL6045BL equivalent (28bits)

Absolute coordinate: -134,217,728 to +134,217,727
Relative coordinate: -134,217,728 to +134,217,727 (except for 0)

You can confirm "LSI chip" on your device with "Diagnostic Report".

Example

The position (number of total output pulses) where the motor of axis number 1 is stopped is set.
1000 pulses are set by relative coordinates.

VB.NET
Dim Ret As Integer
Dim Coordinate As Short
Dim StopPosition As Integer
Coordinate = 1
StopPosition = 1000
Ret = SmcWSetStopPosition( Id , 1, Coordinate , StopPosition )

C, C++
long Ret;
short Coordinate;
long StopPosition;
Coordinate = 1;
StopPosition = 1000;
Ret = SmcWSetStopPosition( Id , 1, Coordinate , StopPosition );

C#
int Ret;
short Coordinate;
int StopPosition;
Coordinate = 1;
StopPosition = 1000;
Ret = Smc.WSetStopPosition( Id , 1, Coordinate , StopPosition );

Python
Ret = ctypes.c_long()
Coordinate = ctypes.c_short()
StopPosition = ctypes.c_long()
Coordinate.value = 1
StopPosition.value = 1000
Ret.value = csmc.SmcWSetStopPosition( Id , 1, Coordinate , StopPosition )

See Also

SmcWGetStopPosition