Function
Sets the behavior of the soft limit.
Format
Ret = SmcWSetSoftLimit( Id, AxisNo, PLimMode, MLimMode, PLimCount, MLimCount )
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.
PLimMode
[ VB.NET: Short ] [ C, C++: short ] [ 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
[ VB.NET: Short ] [ C, C++: short ] [ 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
[ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long
]
Set the number of [+] Side soft limit.
Range : -34217728 to 134217727
MLimCount
[ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long
]
Set the number of [-] Side soft limit.
Range : -34217728 to 134217727
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
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.
VB.NET
Dim Ret As Integer
Dim PLimMode As Short
Dim MLimMode As Short
Dim PLimCount As Integer
Dim MLimCount As Integer
PLimMode = 1
MLimMode = 1
PLimCount = 1000
MLimCount = -1000
Ret = SmcWSetSoftLimit( Id , 1, PLimMode , MLimMode , PLimCount , MLimCount
)
C, C++
long Ret;
short PLimMode = 1;
short MLimMode = 1;
long PLimCount = 1000;
long MLimCount = -1000;
Ret = SmcWSetSoftLimit( Id , 1, PLimMode , MLimMode , PLimCount , MLimCount
);
C#
int Ret;
short PLimMode = 1;
short MLimMode = 1;
int PLimCount = 1000;
int MLimCount = -1000;
Ret = Smc.WSetSoftLimit( Id , 1, PLimMode , MLimMode , PLimCount , MLimCount
);
Python
Ret = ctypes.c_long()
PLimMode = ctypes.c_short(1)
MLimMode = ctypes.c_short(1)
PLimCount = ctypes.c_long(1000)
MLimCount = ctypes.c_long(-1000)
Ret.value = csmc.SmcWSetSoftLimit( Id , 1, PLimMode , MLimMode , PLimCount
, MLimCount )
See Also