comuncation between python and labview using connextdss

2 posts / 0 new
Last post
Last seen: 7 months 4 weeks ago
Joined: 09/12/2023
Posts: 1
comuncation between python and labview using connextdss


I'm just starting to learn how DDS works.

I have installed connextdss and downlaoded the python examples for the simple reader and writer. These work fine with the data written by one and read by the other.

Many of our existing project use LabVIEW so i've downloaded the rti Labview Toolkit and run the basic example VIs to read and write - again these work fine.

My question is how do enable the LabVIEW toolkit to read and write to the same data stream being generated by the python example? I'm assuming both python and LabVIEW are using the same install connextdds backend?

I've looked through the python XML file and tried using the two different topic names but LabVEIW doesn't seem to recieve any data. My guess is I need to use the advanced read fucntion but I'm unsure what these fields are asking and where i can find them in the XML?

Do I need to edit the XML to include the LabVIEW toolkit?




<?xml version="1.0"?>
(c) 2005-2015 Copyright, Real-Time Innovations.  All rights reserved.
No duplications, whole or partial, manual or electronic, may be made
without express written permission.  Any such copies, or revisions thereof,
must display this notice unaltered.
This code contains trade secrets of Real-Time Innovations, Inc.
    <!-- Qos Library -->
                    <name>Connector Shape Example</name>
    <!-- types -->
    <!-- Domain Library -->
    <!-- Participant library -->
        <!-- We use separate participants because we run the writer and the reader
            on different applications, and wouldn't want to create the reader
            in, or the writer in -->
        <!-- You can also define the reader and writer inside the same
            connector instance if you plan to use both in the same application.
                <!-- Uncomment this if you don't want the Input to start receiving
                    data before you call Connector.get_input()
        <!-- The script reads Squares and writes Circles -->



Ismael Mendez's picture
Last seen: 4 months 3 weeks ago
Joined: 07/03/2017
Posts: 74

Hi om327,

The RTI DDS Toolkit uses Connext DDS in the backed. But not the one you have installed. It comes with its own Connext DDS libraries. The lates version of the LabVIEW toolkit (3.1.1) is based on Connext DDS 6.0.1.

You are not using the correct vis. You are using a builtin read vi for reading a Shapes DataType. This is not possible. The builtin read vis only works for simple types such as integers or booleans. There is a shipped example of the Shapes Demo in LabVIEW in the LabVIEW window go to Help->Find Examples->RTI DDS Toolkit->Shapes Demo. There you have a reader and a writer that will communicate with your Python application.

I assume at some point you want to use your own custom type instead the Shapes Demo example. For custom types (clusters) you need to generate specific LabVIEW code for that type. That code is generated specifically with a tool called "Complex Type Generator". It is installed with the DDS LabVIEW Toolkit. You have in the LabVIEW top bar Tools->RTI DDS LabVIEW Toolkit->RTI DDS Complex Type Generator. That tool accepts as inputs a ctl file. That ctl file will represent your DataType (same as idl/xml do in C or Pyhthon application). Unfortunately there is no way of translating automatically an xml or idl to a ctl. You have to do it manually.

Once you have your generated vis you can use in your LabVIEW code and communicate with your Python application. I recommend you to check section 4.2 "Lesson 2—Using ComplexType Generator to Publish and Subscribe to Complex Data (Clusters)" of the Getting Started Guide. You can open it by clicking in a labVIEW window in Help->RTI DDS LabVIEW Toolkit. there you have explained the process to sue custom types with the RTI DDS LabVIEW Toolkit.