Sparse Enum

2 posts / 0 new
Last post
Offline
Last seen: 3 years 6 months ago
Joined: 09/28/2020
Posts: 1
Sparse Enum

Hello,
I am using the RTI DDS Toolkit to have a system using cRIO and Labview 2018 communicate with other systems using a DDS network. One of the messages in a type is a enum data type and has enums set for 0,1,2...10, and then the final enum set is 99. This means that there is no enum set for 11-98 and then the 99th number has an enum.

It appears that Labview cannot use non-sequential or "sparse" enums natively. Is there a work around for this? Does the RTI DDS toolkit support ring data types?

 

Thanks! 

Ismael Mendez's picture
Offline
Last seen: 1 month 3 weeks ago
Joined: 07/03/2017
Posts: 74

Hi KLS12

 

RTI DDS Toolkit actually only supports LabVIEW Enums. Rings are not supported.

As a workaround, If you are communicating with external non LabVIEW applications. You can put the values consecutively in your LabVIEW application and then use Routing Service as an intermediary between your LabVIEW application and the other applications. Routing Service can use transformation plugins to transform data. This way Routing Service can translate input/output samples from the type with non consecutive enum values to the type with the consecutive values and vice versa.

 

If you don't know what Routing Service is. Please have a look here:

https://community.rti.com/static/documentation/connext-dds/6.0.1/doc/manuals/routing_service/introdu...

 

Here is a tutorial about creating Routing Service transformation plugins:

https://community.rti.com/howto/rti-routing-service-how-create-transformation-plugin

 

If you are not communicating with external non LabVIEW based applications and you need the numerical value. Then you can use Enum values consecutively and write manually a mapper that maps the value to the desired one.

 

Hope this is helpful to you. We are working on this to improve enumerations support.

 

Regards

Ismael