0% found this document useful (0 votes)
54 views15 pages

1.1 Version Information: Objective

This document provides an overview and instructions for using the Easy Automation Library (EAL) version 1.1.15.0 to operate drives directly from a PC. The EAL allows connecting to drives via IP and includes classes to read/write parameters and control axis motion. The library consists of EAL.dll and SiP.dll, with EAL.dll providing drive features and SiP.dll handling parameter read/write. Sample code is provided to connect, read/write parameters, check axis status, and control motion limits.

Uploaded by

Laith AbuAssi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views15 pages

1.1 Version Information: Objective

This document provides an overview and instructions for using the Easy Automation Library (EAL) version 1.1.15.0 to operate drives directly from a PC. The EAL allows connecting to drives via IP and includes classes to read/write parameters and control axis motion. The library consists of EAL.dll and SiP.dll, with EAL.dll providing drive features and SiP.dll handling parameter read/write. Sample code is provided to connect, read/write parameters, check axis status, and control motion limits.

Uploaded by

Laith AbuAssi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Version: 1.1.15.

0 Easy Automation Library (EAL)

1 Introduction
1.1 Version information
Library : EAL.dll
Version : 1.1.15.0
Note : This version supports read-write parameter for EFC drive.

1.2 General information on the Easy Automation Library


(EAL)
Objective
The Easy Automation Library is a .net 2.0 library file, which contains the defined interfaces and
implemented classes to operate with Drive.
User can use this library and can write program to operate more than one drive. This makes user
to use Pc directly instead of a controller.

1.3 Working of the Easy Automation Library

Fig 1: Drives connected directly to the PC


The drives are being connected to the PC. And the EAL addresses the drives by its IP address.
The EAL is developed over SiP library, which helps in reading and writing parameters of a drive.

Page 1 of 15
Version: 1.1.15.0 Easy Automation Library (EAL)

2 How to use EAL


The below steps need to be carried out to use the library and to create an application.
Create new console application in the Visual studio 2005:

Step 1: Open Visual studio application


Open Visual studio application

Step 2: Create new project


Click on File->New Project as shown in the below image

Fig 2: Creating new project

Step 3: Choose console application


Select the Windows Console application as shown in the below image and click OK

Fig 3: Selecting console application

Step 4: Solution explorer


Make sure that solution explorer is present on the visual studio by clicking on menu option View 
Other Windows –> Solution Explorer

Page 2 of 15
Version: 1.1.15.0 Easy Automation Library (EAL)

Fig 4: Opening Solution explorer

Step 5: add reference


Add libraries to the project.
- Right click on References in the project explorer.
- Click on Add references.

Fig 5: Adding references

Select Browse tab in the Add reference window as shown in the below image, select Easy
Automation Library dlls folder, select the below dlls and click OK:
- EAL.dll
- SiP.dll

Page 3 of 15
Version: 1.1.15.0 Easy Automation Library (EAL)

Fig 6: Selecting libraries from the folder

Page 4 of 15
Version: 1.1.15.0 Easy Automation Library (EAL)

3 EAL architecture

Fig 7: EAL architecture

The EAL contains the two packages:


- SiP ( SiP.dll ) - Responsible for reading and writing parameters
- Easy Automation Library( EAL.dll ) - Provides access to most of the features of a drive.

3.1 SiP library package


This library provides option to read and write parameter values of a drive. This SiP library accepts
values only in the form of array of bytes. SiP meant for Sercos internet protocol.

3.2 Easy Automation Library package

Fig 8: Easy Automation Library package


This library holds classes and interfaces to access the features of an Axis. EAL contains three
parts: Interfaces, Implementations and ParameterReadWrite.
Interfaces: Holds all the required interfaces. Ex: IAxis, IMovement interface
Implementations: Holds all implementation classes Ex: Axis class

Page 5 of 15
Version: 1.1.15.0 Easy Automation Library (EAL)

3.2.1 IEALConnecion interface

EALConnection holds all properties and methods for Parameter, Logic, Motion, System and
Oscilloscope features.

Page 6 of 15
Version: 1.1.15.0 Easy Automation Library (EAL)

4 Sample codes using the EAL.


4.1 Ping to the EALConnection
private static void PingEALConnSample()
{
using (EAL.EALConnection.PingEALConnection ping = new EAL.EALConnection.PingEALConnection())
{
EAL.EALConnection.EALPingReply reply = ping.Send("10.164.125.145", 2000);
Console.WriteLine("Error code:" + reply.CommonErrorCode);
Console.WriteLine("EAL status:" + reply.EALStatus);
if (reply.EALStatus == EAL.EALConnection.EALIPStatus.Success)
{
Console.WriteLine("Supported message type:");
foreach (MessageType messageType in reply.SupportedMessageType)
{
Console.WriteLine(messageType);
}
}
}
}

4.2 How to create a EAL connection object


Creating single axis object:
using (IEALConnection ealConnection = new EALConnection ())
{
ealConnection.Connect("192.168.1.24");
}

Creating more than one EAL connection object:


using (IEALConnection ealConnection1 = new EALConnection ())
{
ealConnection1.Connect("192.168.1.24");
using (IEALConnection ealConnection2 = new EALConnection ())
{
ealConnection2.Connect("192.168.1.24");
}
}

4.3 How to read/write parameter


Sample code to read/write value of the parameters:
Synchronous method:
private static void TestProgram()
{
using (IEALConnection ealConnection1 = new EALConnection ())
{
ealConnection1.Connect("192.168.1.24");
double val1 = (double) ealConnection1.Parameter.ReadData("S-0-
0091.0.0"); // Reading parameter
ealConnection1.Parameter.WriteData((ushort)2, "P-0-4089.0.1"); // Writing parameter
}
}

Page 7 of 15
Version: 1.1.15.0 Easy Automation Library (EAL)

Asynchronous method

private static void TestProgram()


{
using (IEALConnection ealConnection1 = new EALConnection (true))
{
ealConnection1.Connect("192.168.1.24"); // Connect task will be added to queue
ealConnection1.WaitUntilQueueComplete(); // Waits for all task of queue to be executed
double val1 = (double) ealConnection1.Parameter.ReadData("S-0-
0091.0.0"); // Reads parameter
ealConnection1.Parameter.WriteData((ushort)2, "P-0-4089.0.1"); // Write parameter task
will be added to queue
ealConnection1.WaitUntilQueueComplete(); // Waits for all task of queue to be executed
}
}

4.4 How to check the Axis Status


Sample code to read and write the status of the Axis:
using (IEALConnection ealConnection1 = new EALConnection(true))
{
ealConnection1.Connect("192.168.1.24");
IAxis axis1 = ealConnection1.Motion.Axes[0];
ealConnection1.WaitUntilQueueComplete();
AxisCondition axisCondition = axis1.GetCondition();
if (axisCondition == AxisCondition.AXIS_CONDITION_ACTIVE_PARAMETERIZATION)
{
axis1.SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE);
ealConnection1.WaitUntilQueueComplete();
}
}

4.5 Other sample codes


Sample code to read or write motion limit values
Asynchronous method:
private static void TestProgram()
{
using (IEALConnection ealConnection1 = new EALConnection(true))
{
ealConnection1.Connect("192.168.1.24"); // Connects
IAxis axis1 = ealConnection1.Motion.Axes[0];
// Waits until queue completes
ealConnection1.WaitUntilQueueComplete();
// Adds to queue to write bipolar jerk limit limit
double val1 = axis1.GetAccelerationLimitBip();
// Adds to queue to write bipolar acceleration limit
axis1.SetAccelerationLimitBip(100);
// Waits until queue completes
ealConnection1.WaitUntilQueueComplete();
}
}

Page 8 of 15
Version: 1.1.15.0 Easy Automation Library (EAL)

Asynchronous method:
private static void TestProgram()
{
using (IEALConnection ealConnection1 = new EALConnection(true))
{
ealConnection1.Connect("192.168.1.24"); // Adds to queue to write bipolar jerk limit limit
IAxis axis = ealConnection1.Motion.Axes[0];
double val1 = axis.GetAccelerationLimitBip();
// Adds to queue to write bipolar acceleration limit
axis.SetAccelerationLimitBip(100);
}
}

Reading actual velocity:


Synchronous method:

private static void TestProgram()


{
using (IEALConnection ealConnection1 = new EALConnection ())
{
ealConnection1.Connect("192.168.0.1");
IAxis axis1 = ealConnection1.Motion.Axes[0];
// Reading the actual velocity of the motor
double actualValue1 = axis1.GetActualVelocity();
}
}

Asynchronous method:

private static void TestProgram()


{
using (IEALConnection ealConnection1 = new EALConnection (true))
{
ealConnection1.Connect("192.168.0.1"); // Connect task will be added to queue
// Waits until queue completes
ealConnection1 .WaitUntilQueueComplete();
IAxis axis1 = ealConnection1.Motion.Axes[0];
// Reading the actual velocity of the motor
double actualValue1 = axis1.GetActualVelocity();
}
}

Sample to execute MoveAbsolute:

using (IEALConnection ealConnection = new EALConnection())


{
ealConnection.Connect("192.168.0.10", false, 10000, 2000, 500); // Eatablish
es connection
// Gets axis object
IAxis axis = ealConnection.Motion.Axes[0];
axis.Movement.Power(false); // Powers-off
axis.SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE_PARAMETERIZATION);
ealConnection.Initialize();
axis.SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE);
axis.Movement.Power(true); // Powers on
axis.Movement.Home(); // Executes Homing
axis.Movement.MoveAbsolute(0, 400, 100, 100, 0);
axis.Movement.Wait(10000);
axis.Movement.MoveAbsolute(10000, 400, 100, 100, 0);
axis.Movement.Wait(10000);
double actualPosition = axis.GetActualPosition();
}

Page 9 of 15
Version: 1.1.15.0 Easy Automation Library (EAL)

Reading parameter of EFC drive:


private static void ReadActualSpeed()
{
using (IEALConnection ealConnection = new EALConnection(false))
{
ealConnection.Connect("192.168.1.2");
ushort actualSpeed = ealConnection.Parameter.ReadDataUShort("d0.01");
Console.WriteLine(actualSpeed);
}
}

Sample to download firmware:

IEALConnection ealConnection = new EALConnection(false);


ealConnection.Connect("192.168.0.6");
ealConnection.Motion.Axes[0].SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE_PARAMETERIZATION);
ealConnection.System.FirmwareManagement.SetFirmware(@"D:\FWA-INDRV_-MPB-17V08-D5.ibf");
ealConnection.Disconnect();

Oscilloscope sample:

private static void ReadData1FromOscilloscope()


{
IEALConnection ealConnection = new EALConnection(true);
ealConnection.Connect("10.164.125.45");
// Select parameter
ealConnection.Oscilloscope.Channels[0].Signal = "S-0-0040";
// Set trigger type is signal trigger
ealConnection.Oscilloscope.Trigger.Type = TriggerType.SignalTrigger;
// Sets mask to 0
ealConnection.Oscilloscope.Trigger.Mask = 0;
// Sets pre trigger 0
ealConnection.Oscilloscope.Trigger.PreTrigger = 0;
// Sets trigger signal
ealConnection.Oscilloscope.Trigger.Signal = "S-0-0386";
// Sets value to trigger
ealConnection.Oscilloscope.Trigger.Value = 10000;
// Trigger edge type
ealConnection.Oscilloscope.Trigger.EdgeType = TriggerEdgeType.RisingEdge;
// Starts recording
ealConnection.Oscilloscope.Start();

// Waits until internal trigger triggers


ealConnection.Oscilloscope.WaitUntilInternalSignal(100000);
ealConnection.WaitUntilQueueComplete();
Thread.Sleep(10000);
// Fetches the data
Array dataArray = ealConnection.Oscilloscope.Channels[0].Data;
// Print the values
foreach (double dVal in dataArray)
{
Console.WriteLine(dVal);
}
ealConnection.Disconnect();
ealConnection.WaitUntilQueueComplete();
}

Page 10 of 15
Version: 1.1.15.0 Easy Automation Library (EAL)

4.6 Multi axes support


EAL library also support multi axes as show in the below sample code:
To access the motion functionalities:
- ealConnection.Motion.Axes[1].axis.Movement.MoveVelocity(500, 100, 100, 0);
- ealConnection.Motion.Axes[1].Movement.MoveAbsolute(0, 400, 100, 100, 0);
To access the parameter functionalities:
- ealConnection.Parameter.Axes[1].WriteData(200, "S-0-0036");
To access the System functionalities:
- ealConnection.System.Axes[1].SetTargetMode(SystemMode.SYSTEMMODE_P2);

Page 11 of 15
Version: 1.1.15.0 Easy Automation Library (EAL)

5 Asynchronously executing implementation


5.1 Understanding implementation of Queue:

Fig 15: Application with two drives


The individual axis object will be having its own task queue object. This queue holds all the tasks
which need to be executed one by one. And each axis object will be having a thread, which
dequeues task from the queue and executes one by one.
Only writing value will be added into the queue. The reading will always be synchronous.
In the shown image, all the writing values will be added to the queue. And reading value will be read
directly.

Page 12 of 15
Version: 1.1.15.0 Easy Automation Library (EAL)

5.2 Understanding implementation of asynchronous call


There are two EALConnection objects in the above sample code. Each ealConnection
object has one thread and one queue. The queue is responsible for holding the tasks to be
executed and thread monitors, weather any task is added to the list or not. If any task present, then
it dequeues and executes.

Fig 16: EALCOnnection object with the task queue object and the thread.
The advantage of executing different drive tasks in the different threads is, it will execute
the tasks parallel.

01. axis1.SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE_PARAMETERIZATION); // Adds queue1


02. axis2.SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE_PARAMETERIZATION); // Adds queue2
03. axis1.SetPositionLimitPos(20000); // Adds queue1
04. axis2.SetPositionLimitPos(20000); // Adds queue2
05. axis1.SetPositionLimitNeg(20000); // Adds queue1
06. axis2.SetPositionLimitNeg(20000); // Adds queue2
07. axis1.SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE); // Adds queue1
08. axis2.SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE); // Adds queue2

09. axis1.Movement.Power(true); // Adds queue1


10. axis2.Movement.Power(true); // Adds queue2

11. axis1.Movement.MoveVelocity(200, 100, 100, 0); // Adds queue1


12. axis2.Movement.MoveVelocity(100, 100, 100, 0); // Adds queue2

13. ealConnection1.Wait(50000); // Adds queue1


14. ealConnection1.Wait(50000); // Adds queue2

15. axis1.Movement.MoveVelocity(0, 100, 100, 0); // Adds queue1


16. axis2.Movement.MoveVelocity(0, 100, 100, 0); // Adds queue2

After one second:


From axis1: Lines 01, 03, 05, 07, 09,11 will be executed and line 13 will be executing.
From axis2: Lines 02, 04, 06, 08, 10, 12 will be executed and line 14 will be executing.

After two seconds:


From axis1: Line 13 will be executing
From axis2: Line 14 will be executing

After three seconds:


From axis1: Line 13 will be executing
From axis2: Line 14 will be executing

After fifty seconds:


From axis1: Line 15 will be executed completely and program gets completed.
From axis2: Line 16 will be executed completely and program gets completed.

The above sample code execution shoes, that asynchronous execution help in executing tasks
of more one drive parallel.

Page 13 of 15
Version: 1.1.15.0 Easy Automation Library (EAL)

6 Drive Tool
6.1 Purpose of implementation
The intension of developing the Drive tool (PC based software tool) is to prove and check
the EAL performance.
It also guides the end users to implement customized GUI applications based on their
specific requirements.

6.2 Implantation details


Drive Tool is implemented on Visual Studio .Net programming environments

6.3 Launching Dive Tool


Drive tool can be launched by clicking on DriveTool.exe.

6.4 GUI
Drive tool GUI developed with .NET technology is as follows

Fig 17: GUI for .NET Sample application

Page 14 of 15
Version: 1.1.15.0 Easy Automation Library (EAL)

6.5 Supported Operations


Both the applications support the following operations.
1. Browse the available drives
2. Connection/Disconnection with the Drive using IP address over Ethernet.
3. Power Control.
4. Mode selection (Operational mode and Parameter Mode).
5. Rebooting the drive.
6. Homing the drive.
7. Initializing the drive.
8. Clearing Errors.
9. Reading Power status of the drive, State, Firmware details, Mode of operation.
10. Reading Motor Velocity, Position and torque.
11. Selecting the mode of operation.
12. Set the desired velocity, Position and torque.

Page 15 of 15

You might also like