![background image](http://html1.mh-extra.com/html/omron/nj501-1300/nj501-1300_user-manual_742205326.webp)
10 Sample Programming
10-72
NJ-series CPU Unit Motion Control User’s Manual (W507)
This sample changes the absolute values of the command current position and the actual current posi-
tion for an axis in velocity control.
Precautions for Correct Use
Precautions for Correct Use
•
When you use the MC_SetPosition instruction for an axis in motion, the travel distance
between execution of the instruction and changing the actual position will remain as error.
•
Home will become undefined when the MC_Set Position instruction is executed.
10-2-15 Changing the Actual Position during Velocity Control
Axis Parameter Settings
Parameter name
Setting
Description
Count Mode
Rotary Mode
Rotary Mode is set as the count mode for the position.
Modulo Maximum Position
Setting Value
360
The Modulo Maximum Position is set to 360.
Modulo Minimum Position
Setting Value
0
The Modulo Minimum Position is set to 0.
Homing Method
Zero position preset
A zero position preset is performed to define home.
Main Variables Used in the Programming Samples
Variable name
Data type
Default
Comment
MC_Axis000
_sAXIS_REF
---
This is the Axis Variable for axis 0.
MC_Axis000.MFaultLvl.Active
BOOL
FALSE
TRUE when there is a minor fault level error for
axis 0.
Pwr_Status
BOOL
FALSE
This variable is assigned to the
Status
output
variable from the PWR instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
StartSetPos
BOOL
FALSE
This variable gives the status of the external
button that is used to change the actual posi-
tion.
StartPg
BOOL
FALSE
When
StartPg
is TRUE, the Servo is turned
ON if EtherCAT process data communications
are active and normal.
Vel_Ex
BOOL
FALSE
This variable is used to execute the
MC_MoveVelocity (Velocity Control) instruc-
tion. It is used in ST programming.
SetPos_Ex
BOOL
FALSE
This variable is used to execute the
MC_SetPosition instruction. It is used in ST
programming.
Summary of Contents for NJ501-1300
Page 12: ...Sections in this Manual 10 NJ series CPU Unit Motion Control User s Manual W507...
Page 18: ...16 NJ series CPU Unit Motion Control User s Manual W507 CONTENTS...
Page 22: ...Read and Understand this Manual 20 NJ series CPU Unit Motion Control User s Manual W507...
Page 34: ...Revision History 32 NJ series CPU Unit Motion Control User s Manual W507...
Page 86: ...3 Configuring Axes and Axes Groups 3 28 NJ series CPU Unit Motion Control User s Manual W507...
Page 122: ...5 Motion Control Parameters 5 24 NJ series CPU Unit Motion Control User s Manual W507...
Page 158: ...6 Motion Control Programming 6 36 NJ series CPU Unit Motion Control User s Manual W507...
Page 166: ...7 Manual Operation 7 8 NJ series CPU Unit Motion Control User s Manual W507...
Page 182: ...8 Homing 8 16 NJ series CPU Unit Motion Control User s Manual W507...
Page 346: ...10 Sample Programming 10 92 NJ series CPU Unit Motion Control User s Manual W507...
Page 422: ...Appendices A 18 NJ series CPU Unit Motion Control User s Manual W507...
Page 423: ...Index 1 NJ series CPU Unit Motion Control User s Manual W507 I Index...
Page 430: ...Index 8 NJ series CPU Unit Motion Control User s Manual W507 Index...