10-2-16 Changing A Cam Data Variable And Saving The Cam Table - Omron NY532-1500 User Manual

Ny-series ipc machine controller industrial panel pc / industrial box pc
Hide thumbs Also See for NY532-1500:
Table of Contents

Advertisement

10-2-16 Changing a Cam Data Variable and Saving the Cam Table

This sample uses the user program to change a cam data variable that was created on Cam Editor of
the Sysmac Studio. The displacements for phases of 0° to 180° are multiplied by 2 and the displace-
ments for phases of 181° to 360° are multiplied by 0.5.
If the changes to the cam data are completed, the motion control instruction MC_SaveCamTable is
used to save the cam data variable to non-volatile memory in the Controller. When saving the data is
completed, the MC_CamIn (Start Cam Operation) instruction is executed to start cam motion.
Precautions for Correct Use
Precautions for Correct Use
• If the phases are not in ascending order, an error occurs when the MC_CamIn (Start Cam
Operation) instruction is executed. The order of the phases are not checked in this sample. To
check the order of the phases, execute the MC_SetCamTableProperty (Set Cam Table Prop-
erties) instruction.
• There is a limit to the number of times that you can write non-volatile memory in the Controller.
Save cam table data only when necessary.
• If the power supply to the Industrial PC is turned OFF before the data is saved with the
MC_SaveCamTable instruction, the cam data variable will revert to the contents from before it
was changed by the user program.
Main Variables Used in the Programming Samples
Variable name
MC_Axis000
MC_Axis001
CamProfile0
Pwr1_Status
Pwr2_Status
StartPg
WriteCamdata
WriteDone
SaveCamtable
_MC_COM.Status.
CamTableBusy
Sv_Cam_Ex
Camin_Ex
* The array elements ARRAY[0..N] are set with the Cam Editor in the Sysmac Studio. The range of the array is 0 to
360 in this sample.
NY-series Industrial Panel PC / Industrial Box PC Motion Control User's Manual (W559)
Data type
Default
_sAXIS_REF
---
_sAXIS_REF
---
ARRAY[0..360] OF
---
_sMC_CAM_REF
BOOL
FALSE
BOOL
FALSE
BOOL
FALSE
BOOL
FALSE
BOOL
FALSE
BOOL
FALSE
BOOL
FALSE
BOOL
FALSE
BOOL
FALSE
10 Sample Programming
Comment
This is the Axis Variable for axis 0.
This is the Axis Variable for axis 1.
This is the cam data variable.*
This variable is assigned to the Status output vari-
able from the PWR1 instance of the MC_Power
instruction. It is TRUE when the Servo is ON.
This variable is assigned to the Status output vari-
able from the PWR2 instance of the MC_Power
instruction. It is TRUE when the Servo is ON.
When StartPg is TRUE, the Servo is turned ON if
EtherCAT process data communications are active
and normal.
This variable is used to start changing the cam
data. It is changed to TRUE to start editing.
This variable is used to indicate that the changes to
the cam data are completed. It is changed to TRUE
when the changes to the cam data are completed.
This variable is used to execution the Save Cam
Table instruction.
This system-defined variable is TRUE while cam
table data is being saved.
This variable is used to execute the MC_SaveCam-
Table instruction.
This variable is used to execute the MC_CamIn
(Start Cam) instruction. It is used in ST program-
ming.
10
10-77

Advertisement

Table of Contents
loading

Table of Contents