SmcWSetSoftLimit


Function

Sets the behavior of the soft limit.

 

Format

Ret = SmcWSetSoftLimit( Id, AxisNo, PLimMode, MLimMode, PLimCount, MLimCount )

 

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

 

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

Set the valid/invalid the soft limit of the [+](CW) Side.

0

Invalidate the [+] Side soft limit

1

Validate the [+] Side soft limit

 

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

Set the valid/invalid the soft limit of the [-](CCW) Side.

0

Invalidate the [-] Side soft limit

1

Validate the [-] Side soft limit

 

PLimCount [ C, C++: int ] [ Python: ctypes.c_int ]

Set the number of [+] Side soft limit.
Range : -134217728 to 134217727

 

MLimCount [ C, C++: int ] [ Python: ctypes.c_int ]

Set the number of [-] Side soft limit.
Range : -134217728 to 134217727

 

Return Value

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

0

Terminated normally

Non-zero

Terminated abnormally

See also: Error code details

 

Initial Value

PLimMode

0 : Invalidate the [+] Side soft limit

MLimMode

0 : Invalidate the [-] Side soft limit

PLimCount

1000[p]

MLimCount

0[p]

 

Remarks

This function cannot be executed when the device is in operation.

It is not possible to use it with SMC-2/4/8DL series.

For the CW, "PLimCount + 1" stops at the value. Can not operate over PLimCount value.
For the CCW, "MLimCount - 1" stops at the value. Can not operate below MLimCount value.

The limitations, count match events, and can be used either one or the soft limit.
If you perform this function as an effective soft limit, it overrides the setting of the event count match.
After running this function if you use the event count match again, in this function, +/- side set to disable the soft limit, run SmcWSetInitParam.

Then enable matching events counted by SmcWCountEvent.
In this case, the software limit is invalid.

After "Initial Setting function" is executed, it is necessary to execute SmcWSetInitParam.

Refer to "About Initial Setting function".

 

Example

Information on the behavior of soft limit of axis number 1 is set.

 

C, C++

long Ret;

short PLimMode = 1;

short MLimMode = 1;

int PLimCount = 1000;

int MLimCount = -1000;

Ret = SmcWSetSoftLimit( Id , 1, PLimMode , MLimMode , PLimCount , MLimCount );

 

Python

Ret = ctypes.c_long()

PLimMode = ctypes.c_short(1)

MLimMode = ctypes.c_short(1)

PLimCount = ctypes.c_int(1000)

MLimCount = ctypes.c_int(-1000)

Ret.value = csmc.SmcWSetSoftLimit( Id , 1, PLimMode , MLimMode , PLimCount , MLimCount )

 

See Also

SmcWGetSoftLimit