RTI DDS Toolkit for LabVIEW Support

cancel
Showing results for 
Search instead for 
Did you mean: 

How to define DataType “module” in LabVIEW?

Hi ,

 

I have a discussion with RTI engineer about the consistance of data type definition. We are confused about the consistency of variable types.Let me briefly describe the variables I want to define.

 

There is one data type named Configuration, and it is described in IDL file.

Attachment 1.

 

I define Configuration by using cluster in ctl. Then I use ComplexType Generator to generate examples. And they can transfer data between WriterExample.vi and ReaderExample.vi. But when I run ReaderExample.vi to try to receive data from my real product, it displays that data variable mismatch in Admin Console.

 

In additional, I found that once we use cluster to define one variable in LabVIEW, it would generate a struct in IDL file. So if we define A_config,B_config and C_config in Configuration ctl file in LabVIEW, it will generate one struct for each corresponding. The same thing happens on control_limits and mech_limits.

Attachment 2.

 

I think I just use more structures to define them among the Configuration variable defined with LabVIEW. However, I think the type and length of the elements contained in the final Configuration are same as in Configuration IDL.idl. Is that right? Or how to understand consistency?

 

How to define data type “module” in LabVIEW? and make it consistent with other application?

 

I have already disabled the setting of TypeCode and TypeObject in data reader QoS configuration. Do I need to disable the setting in the writer too? The writer is our product, I couldn't change its QoS configuration.

<participant_qos>
<participant_name>
<name>LabViewTester</name>
</participant_name>
<transport_builtin>
<mask>UDPv4</mask>
</transport_builtin>
<resource_limits>
<type_code_max_serialized_length> 0 </type_code_max_serialized_length>
<type_object_max_serialized_length> 0 </type_object_max_serialized_length>
</resource_limits>
</participant_qos>

Download All
0 Kudos
Message 1 of 4
(1,689 Views)

Hi 池子

You are right. Structs are equivalent clusters. Every LabVIEW cluster will be a struct in the DataType.

 

I'm assuming that Attachment1 is the idl of you C application and Attachment2 is the one from your LabVIEW type. 

 

After checking both idls I found they are not equivalent. The order of the elements in top level struct is different . The sequence<A_ACCELType,200> a_accel is the third element in one and second in the other. Also the struct DRIVE_CONFIGURATION is different to struct A_configType, B_configType and C_configType. The order of the elements is different. It might be more mistakes.

 

I created a ctl equivalent to your attachment1 file and check if they communicate using the QoS with:

<resource_limits>
<type_code_max_serialized_length> 0 </type_code_max_serialized_length>
<type_object_max_serialized_length> 0 </type_object_max_serialized_length>
</resource_limits>

 

run.png

It worked.

 

I attach the files I used. So you can use them as example. 

 

Keep in mind that the order of the elements of a cluster in LabVIEW depends on the order elements are added to the cluster. You can reorder clusters bit right clicing on the luster adn selecting "Reorder Controls in Cluster":

reorder.png

Hope this helps.

 

Regards

Ismael

 

0 Kudos
Message 2 of 4
(1,664 Views)

Hi Ismael!
It's so nice to receive reply from you! The definition process of ctl in LabVIEW you reminded me is very helpful.

I run this Reader.vi trying to receive data from my product. But there is still no data can be seen in Reader.vi. There is only data can be seen on Admin Console.
So I have two questions:
1. After using the QoS shown below, could we still see the data definition format on DDS Data Type in Admin Console? I can not see it now if I change the QoS.
<resource_limits>
<type_code_max_serialized_length> 0 </type_code_max_serialized_length>
<type_object_max_serialized_length> 0 </type_object_max_serialized_length>
</resource_limits>

_1-1668592378654.png

2.Question 2 is about why I still cann't receive data from product in Reader.vi, even it has already shown data type matched. At the same time, the Admin Console could receive data from product.
As I mentioned earlier, the DDS version of our product is 5.2.3 . Common QoS configurations also seem to match between products and testers. So, are there any other QoS configurations I need to set? or some QoS configurations are still mismatched?

I have one XML file that once used by C++ Tester project,this C++ Tester project can communicate with our product by using this XML file. But the Reader.vi cann't data when using it.

So I create a new XML  file, the attachment is the QoS XML file that I use.

_0-1668592317658.png

Admin Console Qos

_2-1668592415809.png

Reader.vi QoS

_3-1668592461726.png

 

 

 

0 Kudos
Message 3 of 4
(1,641 Views)

Hi

 

Here are some answers:

 

1. After using the QoS shown below, could we still see the data definition format on DDS Data Type in Admin Console? I can not see it now if I change the QoS.

That is normal. The information of the DataType is not sent through the discovery data. So Admin Console s not able to get the DataType. In that case the DataType information is not available in discovery Admin Console can load it from an xml file. You can see in admin Console help how to do it.

 

2.Question 2 is about why I still cann't receive data from product in Reader.vi, even it has already shown data type matched. At the same time, the Admin Console could receive data from product.

I'm a bit confused here. I try to run your the a LabVIEW DataReader and a C++ DataWriter of Configuration type using the QoS you attached and doesn't match. It makes sense. Durability is different in the DataReader and the DataWriter.

nomatch.png

 

In your QoS you only set the Datareader as TRANSIENT_LOCAL_DURABILITY_QOS but not the DataWriter. However in your Admin Console match analysis snapshots looks they match. Can you double check that you are using the QoS you want to use in both places? Also check that you are comparing the right readers and writers in Admin Console.

 

I added to the DataWriter the same QoS you set in the DataReader and worked fine. I increase the value of instance->A_config.speed_limits.max_um_per_sec after sending every sample just to check that the data is being received correctly.

match.png

I attach the QoS xml I used to make it run. Use it as a guidance and adapt it to your use case.

 

0 Kudos
Message 4 of 4
(1,609 Views)