SmcWSetTargetSpeed


Function

Sets target speed for pulse output.

 

Format

Ret = SmcWSetTargetSpeed( Id, AxisNo, TargetSpeed )

 

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.

 

TargetSpeed [ C, C++: double ] [ Python: ctypes.c_double ]

Set target speed. The unit is [PPS].
The default value becomes valid when -1 is specified.
Valid range: -1, Setting range of motion speed

Setting range of motion speed
SMC-2/4/8DL series : 0.29296875-9829800
SMC-4/8DF series : 0.0732421875-6553500

 

Return Value

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

0

Terminated normally

Non-zero

Terminated abnormally

See also: Error code details

 

Remarks

The default value is 1000 [pps].

The value that can be the setting by the default resolution (1pps) it is from 1 to 16383 for SMC-2/4/8DL series.
Please change the speed resolution by the SmcWSetBankResolveSpeed function when you set the speed of 16383[pps] or more.

The value that can be the setting by the default resolution (1pps) it is from 1 to 65535 for SMC-4/8DF series.
Please change the speed resolution by the SmcWSetBankResolveSpeed function when you set the speed of 65535pps or more.

The value is corrected by the resolution set with SmcWSetResolveSpeed.
When the resolution is:15[pps], the value is 1005[pps].

Perform acceleration motion when target speed is bigger than start speed. Perform uniform speed motion in target speed when target speed is lower than start speed.

 

Example

The speed of the pulse output target of axis number 1 is set.

 

C, C++

long Ret;

double TargetSpeed

TargetSpeed = 1000;

Ret = SmcWSetTargetSpeed( Id , 1, TargetSpeed );

 

Python

Ret = ctypes.c_long()

TargetSpeed = ctypes.c_double()

TargetSpeed.value = 1000

Ret.value = csmc.SmcWSetTargetSpeed( Id , 1, TargetSpeed )

 

See Also

SmcWGetTargetSpeed