Function
Sets the mode of origin return (origin return motion pattern).
Format
Ret = SmcWSetOrgMode( Id, AxisNo, LimitTurn, OrgType, EndDir, ZCount )
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.
LimitTurn
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
Set whether perform +LIM or -LIM limit turning over or not.
In case of sensing +LIM or -LIM, turn the direction. And continue to move
to origin.
0 |
Disable the reversal by LIM signal |
1 |
Enable reversal by LIM signal |
2 |
LIM signal is ON, Origin return motion can start |
3 |
Origin return motion by using the LIM signal |
OrgType
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
Set whether use Z-phase or not.
0 |
Do not use (ORG only used) |
1 |
Use (ORG + phase Z) |
EndDir
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
Set origin rushing direction (End direction to move to origin) when the
origin returned.
0 |
Unspecified |
1 |
Positive direction (CW) |
2 |
Negative direction (CCW) |
ZCount
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
Set the number of Z-phase when the origin returned. (Setting range 1 to
16)
This value is invalid when "0" is set and the result is OrgType
= 0.
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
LimitTurn |
1 : Return the limit over |
OrgType |
0 : Unspecified |
EndDir |
0 : Unspecified |
ZCount |
1 |
Remarks
LimitTurn = 2 :
"Enable reversal by LIM" + "Origin return motion can start
to signal ON direction"
Ex:
-LIM Signal is ON, Return to the origin of the CCW direction, but will
result in an error(20204),
With this setting, start in the CW direction instantly. Then, stop at LIM
signal ON next.
LimitTurn = 3 :
It is the origin return motion using the LIM signal input.
Origin return motion of using the LIM signal instead of the ORG signal
is possible.
In addition, Z phase becomes available in the "OrgType = 1" setting,
set value "ZCount" is enabled.
It is not possible to use it with SMC-2/4/8DL series.
This setting, EndDir setting is invalid.
This function cannot be executed when the device is in operation.
After "Initial Setting function"
is executed, it is necessary to execute SmcWSetInitParam.
Refer to "About Initial
Setting function".
Example
The starting point return form of axis number
1 is set.
The limit reversing is set to reversing of the limit.
The use of Z aspect is set to the ORG+Z aspect.
The direction where it is rushed into that the starting point returns the
starting point is set in a negative direction.
The number of Z aspects when the starting point returns is set to two.
VB.NET
Dim Ret As Integer
Dim LimitTurn As Short
Dim OrgType As Short
Dim EndDir As Short
Dim ZCount As Short
LimitTurn = 1
OrgType = 1
EndDir = 2
ZCount = 2
Ret = SmcWSetOrgMode( Id , 1, LimitTurn , OrgType , EndDir , ZCount )
C, C++
long Ret;
short LimitTurn ;
short OrgType ;
short EndDir ;
short ZCount ;
LimitTurn = 1;
OrgType = 1;
EndDir = 2;
ZCount = 2;
Ret = SmcWSetOrgMode( Id , 1, LimitTurn , OrgType , EndDir , ZCount );
C#
int Ret;
short LimitTurn ;
short OrgType ;
short EndDir ;
short ZCount ;
LimitTurn = 1;
OrgType = 1;
EndDir = 2;
ZCount = 2;
Ret = Smc.WSetOrgMode( Id , 1, LimitTurn , OrgType , EndDir , ZCount );
Python
Ret = ctypes.c_long()
LimitTurn = ctypes.c_short()
OrgType = ctypes.c_short()
EndDir = ctypes.c_short()
ZCount = ctypes.c_short()
LimitTurn.value = 1
OrgType.value = 1
EndDir.value = 2
ZCount.value = 2
Ret.value = csmc.SmcWSetOrgMode( Id , 1, LimitTurn , OrgType , EndDir ,
ZCount )
See Also