Hi,
I'm trying to start a 'self made' cam in the PLC.
I've tryed to understand the example given in the PLCopenMultiCam.project.But I have some issue on it.
Could someone give me an exmaple of Codesys program that use a cam calcultated in the PLC itself?
Then I use a virtual axis in velocity used as master
and I start the slave with a MC_CamTableSelect then a MC_CamIn
All is well working as long as I try to start a CamIn... I have a library exception.
There are not a lot of documentation according to the CAM in the system.
Could someone help me understanding what does what and how to make it run?
Thanks
Williams
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here is a Self made cam (sinus) that works!
All is in the delcaration of the MC_CAM_Ref and the way the data will be interpreted from the cam table to the cam movement itself!
I still don't know exactly the way the fxxxSlaveMin and Max works, because you can set 360, 180 or other data without any change on the way ot moves!
Hi,
I'm trying to start a 'self made' cam in the PLC.
I've tryed to understand the example given in the PLCopenMultiCam.project.But I have some issue on it.
Could someone give me an exmaple of Codesys program that use a cam calcultated in the PLC itself?
Here is my actual declaration
CAM_Table: SMC_CAMTable_UINT_128_1 := (fEditorMasterMax := 360, fEditorSlaveMax := 360, fTableMasterMax := 360,fTableSlaveMin:=0 ,fTableSlaveMax := 360);
CAM: MC_CAM_REF := (byType := 0,byVarType:=1,xStart:=0, xEnd := 360, nElements := 128);
and program is like this
IF NOT(x_test) THEN
FOR i:=0 TO 127 DO
END_FOR
x_test := TRUE;
END_IF
Cam.pce := ADR (CAM_Table);
Then I use a virtual axis in velocity used as master
and I start the slave with a MC_CamTableSelect then a MC_CamIn
All is well working as long as I try to start a CamIn... I have a library exception.
There are not a lot of documentation according to the CAM in the system.
Could someone help me understanding what does what and how to make it run?
Thanks
Williams
Here is a Self made cam (sinus) that works!
All is in the delcaration of the MC_CAM_Ref and the way the data will be interpreted from the cam table to the cam movement itself!
I still don't know exactly the way the fxxxSlaveMin and Max works, because you can set 360, 180 or other data without any change on the way ot moves!
CAM_Table: SMC_CAMTable_UINT_128_1 := (fEditorMasterMin := 0 ,fEditorMasterMax := 360,
fEditorSlaveMin := 0 ,fEditorSlaveMax := 180,
fTableMasterMin := 0, fTableMasterMax := 360,
fTableSlaveMin :=0 ,fTableSlaveMax := 180);
The bByVartype gives the way the data from the table will be interpreted:
ByVarType 1: INT
2: UINT
3: DINT
4: UDINT
5: REAL
6: LREAL
Then a program for the definition of the cam
IF NOT(x_test) THEN
FOR i:=0 TO 127 DO
END_FOR
x_test := TRUE;
END_IF
Cam.pce := ADR (CAM_Table);
The amplitude of the Sinus should not be more than 32767 if the data interpreted from the table are in INT (16 bits)
This amplitude of the Table will act directly on the amplitude of the movement.
Then call the program of the cam like describe in the past post.
It works