Open Core Interface - MLPI
MLPI-MotionLogicProgrammingInterface(mlpi4LabVIEW)  1.26.2
Creating a new LabVIEW project

Introduction

We recommend using National Instruments LabVIEW 2011 for MLPI application development on Microsoft Windows platform. You can download the trial version under http://www.ni.com/trylabview/.

Learn how to set up a simple National Instruments LabVIEW project which runs on Microsoft Windows and is able to connect to an MLPI device using the mlpi4LabVIEW toolbox. All MLPI function calls are tunneled through TCP/IP over an Ethernet connection to the control. Please keep in mind that hard real-time from your application to the control is not possible with this setup.

Setting up the project

Start National Instruments LabVIEW 2011 and create a new virtual instrument (VI) via "New->Empty VI".

lv_new_VI.png
LabVIEW start screen

First Steps with mlpi4LabVIEW

Since the mlpi4LabVIEW VIs are a part of the functions palette, you have to open it on the "block diagram" via "View->Functions Palette". On it you can also find functions for arithmetic operations, loops and much more which are necessary for the logic in a VI. On the "front panel" you can open the element palette in the same way.

lv_open_Func.png
Open functions palette

Now you have to add the VIs "Connect (mlpiApiConnect.vi)" and "Disconnect (mlpiApiDisconnect.vi)" to your block diagram, because they are essential for all mlpi4LabVIEW projects. To do this please go to "Function->Addons->mlpi4LabVIEW->ApiLib->Connection control->Connect (mlpiApiConnect.vi)". The "Disconnect (mlpiApiDisconnect.vi)" VI for disconnecting is located beside.

Note
You can use more than one connection to your control at once if needed.
lv_add_Api.png
Adding Connect VI and Disconnect VI

In the next step, you have to add one or more VIs from the mlpi4LabVIEW toolbox about a function you are interested in. For now, it's GetMemoryInfo (mlpiSystemGetMemoryInfo.vi) from the SystemLib. The wished VI is part of the polymorphic VI "GetProperty (mlpiSystemGetProperty.vi)".

lv_add_mem.png
Adding GetProperty VI

Because within the polymorphic VIs are also other VIs included, you have to selected the wished functionality by the "Polymorphic VI Selector".

lv_add_poly.png
Polymorphic VI Selector, Before switching VI


lv_add_poly2.png
Polymorphic VI Selector, Switching VI


lv_add_poly3.png
Polymorphic VI Selector, After switching VI

Now you have to wire the "connection" terminals by using "connect wire" from the tools palette which you can find under "View->Tools Palette". Furthermore you have to add a control element or constant to the "address" input terminal of the Connect (mlpiApiConnect.vi) VI because it's also a required input.

lv_add_Requ.png
Application cannot be started because missing required input terminals


lv_add_Requ2.png
Application could be started, but some terminals are not connected yet

Now, add all other recommended or optional elements like output "memoryInfo" and error terminals no matter if it's an input or output. At the end, your "block diagram" should look like that:

lv_add_Elem.png
Application fully completed and ready to go

Switch to the "front panel" and modify the input form if needed. In our case, it looks like that:

lv_Panel.png
Modify IP address if needed

Finally, you should be able to execute the project by clicking the "Run" button.

lv_Start.png
Run application

Most of the fails causes by wrong IP addresses (fixe it on front panel) or missing permission rights (use user and password inputs and/or modify your accounts on the control) please fixe the problem and try again.

lv_error.png
Error because wrong IP


lv_error2.png
Error because missing permissions

After successfully executing the output form should be filled with values.

lv_Panel2.png
Application runs successfully

With this procedure, you should be able to create your own easy LabVIEW project using the mlpi4LabVIEW.