Back to top

This example shows how to exchange data between a PCMM or AKD PDMM and a PC using UDP.

The attached KAS program works with the target controller and 2 AKD drives. 

The PC-based program is written in C# and receives the axis positions from the controller. It is also possible to send text to the PC.

KVB C# Scripting Examples

 

The AKI panels have the capability of running a C# program in the background.  Each HMI screen in KVB has a tab called “Script”. The C# script will run in the background only for the screen that is currently active, except for the script in the Tag screen, which runs all the time.

Following are some examples of scripts and brief explanations of what they are used for.

Creating a C# script within the AKI HMI Panel

You can create a script that runs a C# program in the background of the HMI screen.  A script in the Tag screen will run in the background all of the time.  A script in one of the HMI screens will run in the background only when that screen is active.

In this example, we need a script that will set MT_NUM = 21 and MT_LOAD = 1 when the Run screen is opened.  And we need a pause between these two commands to allow the AKD drive time to process the Modbus commands.