Octet to String datatype conversion

4 posts / 0 new
Last post
Offline
Last seen: 3 weeks 6 days ago
Joined: 04/13/2022
Posts: 2
Octet to String datatype conversion

Hi

   Can we create a cluster using advance cluster creator for String based Octet[32] for DDS network? 

Organization:
Ismael Mendez's picture
Offline
Last seen: 3 weeks 4 days ago
Joined: 07/03/2017
Posts: 52

Hi Saarthak,

If by advance cluster creator you Mean Complex Type Generator (the tool used for generating the VIs) it is possible to generate code for a 32 character length string or a 32 octets octet array. To set the size of a string to 32 just put a string into your top-level cluster, write "32" on it (without quotes), and set it as the default value (right click-> Data Operations->Make current value default) and save your ctl.

In the case of an array of octets. Place an array into your top-level cluster and initialize the 31st element (this way all previous ones will be initialized too) and set it as the default value. Same procedure as with the string.

Once you have your ctl ready you can use the Complex Type Generator for generating your VIs.

Have a look at the Getting Started Guide (Help->RTI Connext DDS Toolkit-> Open Getting Started Guide) sections "Preventing 'Type Code Incorrect' Error when Working with Arrays" and "Types with a Specific String Size".

Regards

Ismael

Offline
Last seen: 3 weeks 6 days ago
Joined: 04/13/2022
Posts: 2

Hi

After using array of octets in Labview i am getting this in RTI network

 

 

and i am looking for this so what changes are required in Labview ?  

     

 

Ismael Mendez's picture
Offline
Last seen: 3 weeks 4 days ago
Joined: 07/03/2017
Posts: 52

You have to enable forceArrayMapping option in the Advanced Reader/Writer Configuration. See sections "Configuring Advanced Writer Settings", "Configuring Advanced Reader Settings" "Setting Up Arrays" and "Setting Up Sequences" in the Getting Started Guide.