SmcWSetReady


Function

Set beginning preparation and motor operation type/direction where basic operation begins operation.

 

Format

Ret = SmcWSetReady( Id, AxisNo, MotionType, StartDir )

 

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.

 

MotionType [ C, C++: short ] [ Python: ctypes.c_short ]

Set motor motion type.

0

No motion

1

PTP motion

2

JOG motion

3

Origin return motion

6

Z-phase count motion

7

PTP motion (Correction at the target speed, Corrected without changing the acceleration and deceleration)

 

StartDir [ C, C++: short ] [ Python: ctypes.c_short ]

Set start direction of motor motion. This parameter is invalid when performing PTP motion.
(Please specify either CW direction: Positive value or CCW direction: Negative value by the StopPosition parameter of the SmcWSetStopPosition function.

0

Positive direction

1

Negative direction

 

Return Value

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

0

Terminated normally

Non-zero

Terminated abnormally

See also: Error code details

 

Remarks

The operation setting is fixed by this function execution.

After executing this function, please do not execute the functions of setting basic motion parameters(SmcWSetTargetSpeed etc.) till executing the SmcWMotionStart function.

If the device is in operation, the function cannot be performed. 

When you select "6 Z-phase count motion":

- It is not possible to select it by the SMC-2/4/8DL series.
- Operating by the StartSpeed set by the SmcWSetStartSpeed.

The number of Z-phase counts operates up to the number of Z-phase counts set with ZMoveCount of the SmcWSetZCountMotion.

- When Z-phase cannot be detected, it keeps operating because Z-phase cannot be counted, and it doesn't stop automatically. Please confirm Z-phase is counted by the SmcWGetZCount.
- The event function such as the stop events can be used.

 

[Attention]:

In DL series and DF series, the used pulse control LSI are different.
Therefore, some of the register set width (configurable number of bits) of the corresponding LSI of each parameter in basic motion setting functions are different.
As result, when perfroming a parameter correction in this function, the actual setting values of DL series and DF series may be different.
You can confirm the actual setting values by Get functions (function SmcWGet~) in basic motion setting functions.

 

Example

The motor operation type and the direction where basic operation of axis number 1 begins operation are set.
It sets it in the JOG operation and the direction of positive.

 

C, C++

long Ret;

short MotionType ;

short StartDir ;

MotionType = 2;

StartDir = 0;

Ret = SmcWSetReady( Id , 1, MotionType , StartDir );

 

Python

Ret = ctypes.c_long()

MotionType = ctypes.c_short()

StartDir = ctypes.c_short()

MotionType.value = 2

StartDir.value = 0

Ret.value = csmc.SmcWSetReady( Id , 1, MotionType , StartDir )

 

See Also

SmcWGetReady