Editing Mutiple Motion Tasks in a Kollmorgen AKD over Modbus TCP/IP

Eric Nelson

Lifetime Supporting Member + Moderator
Join Date
Apr 2002
Location
Randolph, NJ
Posts
4,346
I have three motion tasks (0, 1, and 2) in a Kollmorgen AKD-P00306 where I edit the 'Position' values with a G304K2 HMI. I have no problem with reading/writing individual parameters over Modbus, but motion tasks work a little different.

To view the current 'Position' value of a specific motion task, you first put the desired motion task number in MT.NUM, then issue a 'load' command by putting a '1' in MT.LOAD. The requested 'Position' value then appears in MT.P. Of course, you have to reset MT.LOAD back to zero each time so it can retrigger the command.

To change the 'Position' value, you again put the desired motion task number in MT.NUM, then put your edited 'Position' value in MT.P. Finally, you put a '1' in MT.SET to actually write the value to the motion task.

I am using complex code in the G304 to accomplish this, but I had to add delays to allow the AKD drive to respond reliably. Without any delays, the HMI often reads the registers before they have the updated values in them.

My editing screen for these motion tasks has all three on one screen. The 'On Select' of this screen uses the following code to read the three individual motion task values from the drive.

Code:
Swingarm.Motion_Task_Number = 0;
Sleep(200);
Swingarm.Motion_Task_Load = 1;
Sleep(200);
[COLOR="Blue"]Swingarm.Release_Position[/COLOR] = Swingarm.Motion_Task_Value;
Swingarm.Motion_Task_Load = 0;
Sleep(200);
Swingarm.Motion_Task_Number = 1;
Sleep(200);
Swingarm.Motion_Task_Load = 1;
Sleep(200);
[COLOR="Blue"]Swingarm.Pickup_Position[/COLOR] = Swingarm.Motion_Task_Value;
Swingarm.Motion_Task_Load = 0;
Sleep(200);
Swingarm.Motion_Task_Number = 2;
Sleep(200);
Swingarm.Motion_Task_Load = 1;
Sleep(200);
[COLOR="Blue"]Swingarm.Home_Offset[/COLOR] = Swingarm.Motion_Task_Value;

(Motion_Task_Number is MT.NUM, Motion_Task_Load is MT.LOAD, and Motion_Task_Value is MT.P. G304 Internal tags are in blue, which are what I use to display/edit the values)

Now, notice all the 'sleep' delays. With them set to 100ms, I would occasionally get an erroneous value, so I doubled it to 200, hoping it would work reliably. I haven't seen any issues since, but I'm not sure if simply delaying is the right approach. :confused:

Writing a new value is a bit simpler. I just run the following code in 'On Entry Complete' for the individual data entry objects:

Code:
Swingarm.Motion_Task_Number = 2;
Swingarm.Motion_Task_Value = [COLOR="Blue"]Swingarm.Home_Offset[/COLOR];
Swingarm.Motion_Task_Set = 1;

While I have used Modbus quite a lot in the past, I have never had to worry about timing like this. Is there some type of acknowledgement that a register has been written successfully? For example, when I write a '2' to the motion task number, is there some way I can know that the value in MT.P has been updated to reflect the actual value of Motion Task #2, or do I just have to 'wait a bit' (like my 200ms), and hope that it is?

Sorry for the somewhat long post, but I also posted this in case someone needs an example on how to edit motion tasks in an AKD.

🍻

-Eric

P.S. for future AKD programmers. The AKD drive does NOT automatically save edited values to NVRAM, and it will reload the previous values after a power cycle. You have to toggle DRV.NVSAVE (Modbus 938) to save the current values.
 

Similar Topics

Hello everyone. Is the PLC CJ1M CPU13 capable of online editing? Or only downloads that will stop the PLC? Thank you.
Replies
3
Views
327
Hi, its been awhile, hope y'all are well. I do not have RSView Studio or whatever the HMI specific programs are for working with .mer files I have...
Replies
2
Views
265
Hi all, Does anyone know if WAGO 750-8100 with e!****pit supports online editing? Thank you.
Replies
0
Views
700
Often I type in the commands in the text bar as I find it much faster than other ways to add or modify instructions. However the text bar is...
Replies
5
Views
1,962
Hello all, I am currently running a program from an S7-1200 and I am using TIA Portal v17. I have created a user-defined web page to eliminate...
Replies
1
Views
1,511
Back
Top Bottom