To create a framework in XCode that you can reference in LabVIEW for Mac OS:
- Open XCode.
- Select File»New Project.
- Select Framework»Carbon Framework as the project type.
- Name the framework when prompted. Click Finish.
- 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.
- After adding your functions, compile the framework. The compiler settings should all be left at default.
- 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:
- Place a Call Library Function Node on the block diagram by going to All Functions»Advanced»Call Library Function Node.
- Apple-Click on the Call Library Function Node and select "Configue..."
- Click on the Browse button and browse to your .framework file and click Select to select the framework.
- 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.
- Specify the return type of the function.
- Add the number of parameters in the function and specify their types.
- The function prototype will appear in the Function Prototype field according to how you have specified the function parameters.
- Click the OK button.
- 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