Skip to main content
Skip table of contents

LabVIEW

Library Download

Please see Visual Studio .Net for the latest library download.

Library Setup

Step 1: Click File -> New VI

image-20250625-000801.png

Step 2: All the PMC controls are functions for the VIs block diagram. Open the block diagram by clicking Window -> Show Block Diagram

image-20250625-001439.png

Step 3: Open the functions palette by right clicking blank space in the block diagram or clicking View -> Functions Palette

image-20250625-001847.png

Step 4: In the functions palette, click Connectivity -> .NET -> Constructor Node

image-20250625-002700.png

Step 5: Double click on the empty .NET constructor block to select the .NET class to construct

image-20250625-003638.png

Step 6: In the Select .NET Framework Constructor, click on the Browse button. In the file browser, select the PMCLIB.dll and click OK

image-20250625-003831.png
image-20250625-003840.png

Step 7: In the Objects pane, expand the PMCLIB, select “SystemCommands” and click OK

image-20250625-004051.png
image-20250625-004057.png

Step 8: To call a function from the SystemCommands class, right click it and click Create -> Method for PMCLIB.SystemCommands Class -> function name. You will want to start with AutoSearchAndConnectToPMC or ConnectToSpecificPMC. Connect the top right reference output of the constructor to the reference input of the function invoker block. Then connect the bottom right error output to the error input of the invoker block

image-20250625-004555.png
image-20250625-004607.png

Step 9: After connecting to the PMC, you will need to gain mastership. The GainMastership() function is in the SystemCommands class

image-20250625-004812.png

Step 10: After wiring the GainMastership block, create a constructor block for a XbotCommands class

image-20250625-152245.png

Step 11: Just like with SystemCommands, double click the constructor block, select the PMCLIB -> “XBotCommands” and click OK

image-20250625-152858.png
image-20250625-152927.png
image-20250625-153015.png

Step 12: Connect the error out of the GainMastership invoke block to the error in of the XBotCommands constructor. This will ensure that the XBotCommand function calls will happen after the ConnectToPMC() and GainMastership() function calls

image-20250625-153338.png

Step 13: Call a function from the XbotCommands class by right clicking on the XbotCommands constructor or selecting Create -> Method for PMCLIB.XBotCommands Class -> function name. Connect the reference in/out and the error in/out.

image-20250625-153725.png
image-20250625-153751.png
image-20250625-153811.png

Step 14: Please note that the error out of the invoker block just tells if the function call was invoked from the DLL. It does not tell you if the function call encountered a non-fatal error. To tell if a command is accepted, you will need to look at the output values of the function.

For example, calling the LevitationCommand() function with an xbotID of -10 will not result in a fatal error in the function so the error out says no error. However, an xbotID of -10 is not allowed in the PMC, so the return will show an error code of INVALIDPARAMS.

image-20250625-154435.png

Step 15: To access elements of a structure output from a function call, right click on the right end for the return output and select Create -> Property for <structure name> and choose the element you want

image-20250625-154648.png
image-20250625-154720.png

Step 16: Then wire the property block to the return output of the function block that returns a structure

image-20250625-154842.png

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.