LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling a Servo Motor Using LabVIEW, Phidget & Mac OS

Can anyone help me with this problem? 

 

I'm attempting to control a servo motor attached to a Phidget, using a VI in LabVIEW on a Mac. The Phidget works fine with the Mac, LabVIEW works fine with the Mac, but there seems to be a problem combining the three. The problem I'm encountering is that the examples on the Phidget website (www.phidgets.com) for LabVIEW use ActiveX. Can anyone suggest a solution for this? Is it possible to use one of the control options in LabVIEW (GPIB, VISA, etc etc.) instead?

 

I'm not great with computers so really have no idea where to start. 

 

Thanks!  

Message 1 of 4
(3,873 Views)

The problem is your mac.  The LabVIEW library supports Windows only.  Your best move from here might be to load the C library and use CINs to call into it.

 

A call to Phidget tech support might be in order as they will undoubtedly have greater knowledge of their API.  They do have really good docs so that bodes well for great customer service


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 4
(3,857 Views)

Thanks for your reply Jeff! So I can insert a CIN to the block diagram, right click and use the 'create .c file' option, insert the example code for controlling the motor from the Phidgets website (after tweaking it to make it specific to my setup) and that should work? How do I load the C library? Or a better question may be, what is the C library? (I wasn't joking when I said I'm totally new to this!)

 

I've been working my way through 'C for Dummies' this week but I have to admit, the bit about header files and libraries lost me. I downloaded a bunch of stuff from the Phidgets website, including the phidget21.h and phidget21.lib files...do I '#include' both of these at the top of the example code?

 

I've been in touch with the Phidget Support team (who are indeed great!) and received a similar reply ("You would have to call into the mac Phidget21 Framework directly").

 

Once the CIN is all set up do you know what degree of control I'll have over the motor? The aim is to have the motor move in steps from -60deg to +60deg around a central point. Would this need to be defined in the code and then linked into LabVIEW or is this something I could control from within LabVIEW? The idea of my project is to use the motor to move a light source around a sensor. The sensor is hooked up to an NI DAQ that will record and display values (after some manipulation) on the front panel. I hope to display the sensor values and the corresponding motor position values.  

 

 

0 Kudos
Message 3 of 4
(3,823 Views)

kat_l wrote:

Thanks for your reply Jeff! So I can insert a CIN to the block diagram, right click and use the 'create .c file' option, insert the example code for controlling the motor from the Phidgets website (after tweaking it to make it specific to my setup) and that should work? How do I load the C library? Or a better question may be, what is the C library? (I wasn't joking when I said I'm totally new to this!)

 

 

 


NO, No no!  Not what I meant at all!  And my appologies for adding to your confusion!  I should have added paths to the CIN examples so you had a referance to look at.

 

You can use Code Interface Nodes (CINs) to access algorithms written in another language or platform-specific features or hardware that LabVIEW does not directly support. The CIN is expandable and shows data types for the wired inputs and outputs, similar to the Bundle function.

 

 

The CIN and Call Library Function are found on the  Conectivity, Libraries & Executables sub-palette

 

C:\Program Files\National Instruments\LabVIEW 2009\examples\dll\sound\playsnd.llb\Play Sound.vi 

is an example of using the Call Lbrary Function

and C:\Program Files\National Instruments\LabVIEW 2009\examples\dll\data passing\Call Native Code.llb\Call DLL.vi

Shows how to convert LV data to C

 

 This book in the LV help"Calling Code Written in Text-Based Programming Languages" is a great place to start.  And Mac does things a bit different so I can really only point you better.... You will need to dig to find a way to beat your issue.

 

 

 

 


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 4
(3,811 Views)