A simple demo iShapes example is provided to demonstrates the basic capabilities of the LabVIEW DDS integration. It displays DDS communication between LabVIEW and pure DDS applications.
The demo_ishapes.vi example (LabVIEW application) can be found using the NI Example Finder in LabVIEW:
The demo_ishapes.exe (DDS application) can be found in the following directory.
OSPL_HOME/bin/demo_ishapes.exe
An explanation of what each example file does is provided below.
DDS_Data Folder
This folder contains the idl file and artifacts generated from idlpp process.
ishape.idl
ishape.idl.xml
ShapeType_CicoTable.vi
ShapeType.ctl
ShapeType_Read.vi
ShapeType_Write.vi
ShapeType_Topic.vi
DDS_PersistentQoS_All.xml
DDS_VolatileQoS_All.xml
demo_ishapes.vi
Steps:
Open command shell and run script to setup environment variables.
Linux
Open a Linux terminal.
Navigate to directory containing release.com file.
/INSTALLDIR/ADLINK/Vortex_v2/Device/VortexOpenSplice/6.9.x/HDE/x86_64.linux
Run release.com. (Type in “. release.com” at command line.)
Windows
Open a command prompt.
Navigate to directory containing release.bat file.
INSTALLDIR/ADLINK/Vortex_v2/Device/VortexOpenSplice/6.9.x/HDE/x86_64.win64
Run release.bat. (Type in “release.bat” at command line.)
Navigate to the directory that contains demo_ishapes.exe DDS application and run the application using the command shell used in Step 1.
Linux
/INSTALLDIR/ADLINK/Vortex_v2/Device/VortexOpenSplice/6.9.x/HDE/x86_64.linux/bin
- Run demo_ishapes.exe (Type in “./demo_ishapes.exe &” at command line)
Windows
INSTALLDIR/ADLINK/Vortex_v2/Device/VortexOpenSplice/6.9.x/HDE/x86_64.win64/bin
- Run demo_ishapes.exe (Type in “demo_ishapes.exe &” at command line)
Start LabVIEW using the SAME command shell used in Step 1. Open the demo_ishapes.vi using the NI Example Finder in LabVIEW.
NOTE: If LabVIEW and the demo_ishapes.exe application are NOT started from a command shell with the correct OSPL environment variables set, the example will not work.
In the LabVIEW demo_ishapes.vi application make the following selections:
Read Shape: Circle Track color: GREEN
Write Shape: Triangle Write color: MAGENTA
In the demo_ishapes.exe DDS application make the following selections:
Shape: Circle Color: Green Click Publish
Shape: Triangle Click Subscribe
Run the LabVIEW demo_ishapes.vi application
To stop the LabVIEW application, click on STOP on the front panel of the demo_ishapes.vi.
LabVIEW application publishes samples to the DDS application. In the demo_ishapes.exe application, the Triangle follows the Circle.