Update: This feature has been incorporated into the NI LabVIEW 2010 NI SoftMotion Module.
The NI SoftMotion Property and Invoke Nodes allow you to create motion applications using the same properties and methods that the NI SoftMotion function blocks are built from.
The following software is required to use the NI SoftMotion Property and Invoke Nodes:
- NI LabVIEW 2009 SP1
- LabVIEW Real-Time Module 2009 SP1
- LabVIEW FPGA Module 2009 SP1
- NI-RIO 3.3.0 or later
- LabVIEW NI SoftMotion Module 2009 SP1
Refer to ni.com/motion/softmotion for information about the different available NI SoftMotion packages.
- NI-Motion 8.1 or later driver software
- Download the attached zip file & unzip.
- Run setup.exe and follow the instructions. After installing you will have access to the Property & Invoke Node API
- To enable Convert to SubVI on the Function Blocks edit the labview.ini file located in your Program Files\National Instruments\LabVIEW 2009 folder and add the following line "nisoftmotionlabs=true".
The NI SoftMotion Property and Invoke Nodes provide properties and methods you use to create motion applications with axis, coordinate, and table resources you create in the LabVIEW Project. Installing this software adds several items to the NI SoftMotion palette in LabVIEW. The following image shows the additional palette items:
- Axis—Use the Axis resource constant to reference an NI SoftMotion axis created in the LabVIEW Project.
- Coordinate—Use the Coordinate resource constant to reference an NI SoftMotion coordinate created in the LabVIEW Project.
- Table—Use the Table resource constant to reference an NI SoftMotion table created in the LabVIEW Project.
- Create—Use the Create polymorphic VI to create a reference to specific NI SoftMotion interface objects. You can select from the following options:
- Straight-Line Move
- Arc Move
- Contour Move
- Find Reference Move
- Position Capture
- Position Compare
- Stop Move
- Time Sampled Read - See Known Issues
- Property Node—Use the property node to access NI SoftMotion properties for the specified reference.
- Invoke Node—Use the invoke node to access NI SoftMotion methods for the specified reference.
- Destroy—Use the Destroy VI to close the reference.
Note: Property and method descriptions are identical to the NI SoftMotion function block parameters and methods. Refer to the NI SoftMotion Module book of the LabVIEW Help for detailed information about the available properties and methods.
The following methods are available for the Axis class:
- Clear Faults
- Read (Analog Line, Capture Data, Digital Line, Encoder, Data, Status, Faults, Motion I/O, Trajectory Data, Method Status)
- Reset Position
- Write (Analog Line, Digital Line, Setpoint, Velocity Override)
The following methods are available for the Coordinate class.
- Read (Data, Status, Trajectory Data, Method Status)
- Reset Position
- Write Velocity Override
Convert to SubVIs
This software also adds a shortcut menu option to the NI SoftMotion function blocks—Convert to SubVI. This option is similar to selecting Open Front Panel from the shortcut menu of an Express VI in that it replaces the selected function block with a subVI that provides the same functionality and uses the NI SoftMotion properties and methods instead of the NI SoftMotion function blocks. This allows you to use code written using NI SoftMotion function blocks in applications that do not support function blocks.
To enable this feature edit the labview.ini file located in your Program Files\National Instruments\LabVIEW 2009 folder and add the following line "nisoftmotionlabs=true".
Note: When you convert your function blocks to subVIs, any variables associated with that function block are lost.
The following figure demonstrates a simple example of how to set up a coordinate straight-line move using the NI SoftMotion Property and Invoke Nodes.
- In LabVIEW 2009 the Wait Until Done method will block all other SoftMotion property nodes. This issue is resolved if you use LabVIEW 2009 SP1.
- To implement this yourself use the Axis»Read Status method to use Move Complete Status or Blend Complete Status to determine when your command has completed execution.
- Context help is not available for all items.
- The Time Sampled Read option is not currently supported.
- The Controller class is not currently supported.