LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get LabVIEW to use library created in Xcode using a library node?

I have written C++ code in the Xcode IDE on Mac OS X. This code controls a camera driver to tell it to take a picture and save it. I want to call this code in LabVIEW. I am trying to use a library node, but when I tell it the location of the Xcode project it doesn't recognize that anything is there. How can I get LabVIEW to recognize this? (Xcode used to be called Project Builder in earlier versions). In the documentation it says to link against libvlexports.a. I have included this file in my Xcode project, but does "link against" mean something more than that?
0 Kudos
Message 1 of 2
(2,698 Views)
To create a framework in XCode that you can reference in LabVIEW for Mac OS:
  1. Open XCode.
  2. Select File»New Project.
  3. Select Framework»Carbon Framework as the project type.
  4. Name the framework when prompted. Click Finish.
  5. The XCode browser will now appear. Click on main.c to open the file. This is where you will create your functions. For an example open the file main.c in the Call Library Function Node on Mac with XCode zip file.
  6. After adding your functions, compile the framework. The compiler settings should all be left at default.
  7. Access your functions via a Call Library Function Node in LabVIEW.
To access the functions in a framework using the Call Library Function Node in LabVIEW:
  1. Place a Call Library Function Node on the block diagram by going to All Functions»Advanced»Call Library Function Node.
  2. Apple-Click on the Call Library Function Node and select "Configue..."
  3. Click on the Browse button and browse to your .framework file and click Select to select the framework.
  4. Type the name of the function you want to access in the Function Name field.
    NOTE: Unlike LabVIEW 7.x for Windows, once your framework is selected, the Function Name field DOES NOT autopopulate a list of functions in the framework.  You must type in the name of the function you want to access.
  5. Specify the return type of the function.
  6. Add the number of parameters in the function and specify their types.
  7. The function prototype will appear in the Function Prototype field according to how you have specified the function parameters.
  8. Click the OK button.
  9. Your Call Library Function Node will appear with the number of inputs you selected as well as the output. If LabVIEW cannot find the function you specified within the framework, it will show a broken Run arrow.

The "Call Library Function Node on Mac with XCode.zip" file (attached) contains a simple framework created in XCode along with its source code in main.c.  main.c simply contains two functions both of which multiply two numbers. One function accepts integers and the other doubles. The zip file also contains a VI that references this framework using a Call Library Function Node.  This VI was created in LabVIEW 7.1 for Mac OS.

Kind Regards,

Message Edited by AESulzer on 07-08-2005 06:11 PM

E. Sulzer
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,683 Views)