Jump to content

Bug: Read Key(Variant)__ogtk.vi [Variant Configuration File] looses variant name


Recommended Posts

Hi I signaled this issue about 2 years ago:

http://forums.openg....?showtopic=1088

Basically, for some data types, the variant name from the input is propagated from the variant input, and for some other data types it is not propagated.

The use of the LV node "To Variant" creates a variant with a standard name (the name of the input wire, ie no name or sometimes "value").

example: Integers I8..I32

post-9285-0-38015500-1318928200.png

The same is true for [u8..U32], [sGL..EXT], [CSG..CXT], [boolean], [string, DAQ], [Path]

The other data types: [Enum U8..Enum U32], [sGL PQ..EXT PQ], [CSG PQ..CXT PQ], [Array] and [Cluster] seem to propagate the variant name. I have not tested the vis, but by looking at the code it looks like it.

example:

post-9285-0-70642600-1318928506.png

I see 2 possible fixes:

1: using the OG SetDataName function:

post-9285-0-17731600-1318929733.png

2: using the NI FlattenedStringToVariant primitive and the TD of the input variant. This is the same that is used fo the PQ data types ([sGL PQ..EXT PQ] and [CSG PQ..CXT PQ]).

post-9285-0-32229100-1318929839.png

Solution 2 might be faster because the proper variant is created in one operation. In solution 1, the variant is first created and then modified. Anyone has an opinion on this?

How can this fix be integrated in a future release of the package? Can I help?

And by the way thanks again for these great tools!

BaB

-------------------------------------------------------------------------------------------

(I wanted to write the following as separate post but using reply just merges the reply with the original post... strange....)

As a side effect of the fix above, the Cluster case could be modified:

post-9285-0-76845900-1318931472_thumb.pn

When the vi propagates the data names for all data types, there is no need to explicitly set the name again after the recursive call.

A second note is that the Cluster Name can be set directly with the optional input to the "Array of VData to Cluster" function, and the last SetDataName function to the right could be removed too.

Edited by Bab
Link to comment

Hi Bab

Thanks for (re)posting.

I am actually in the process of trying to organize a large review on the OpenG Variant Configuration Library in the near future because there are a few outstanding issues and new features that it would great to integrate - stay tuned for this!

How can this fix be integrated in a future release of the package? Can I help?

Sure! There are a few ways you can help:

  • Detailed reports (like you have done)
  • Posting your code (in LabVIEW 2009)
  • Becoming an OpenG Developer (if interested please PM me)

Each involves different degrees of time commitment, but it is totally up to you :)

Cheers

-JG

Link to comment
  • 2 weeks later...

Thanks for the reply, somehow I missed it. I thought I should get an email since I am following this topic - is there something extra to activate?

JG: did you create a bug id in the bug tracking system? It would help ensure the issue is not forgotten again.

Link to comment
  • 4 weeks later...

Hi bab,

Let's see if I understand the issue correctly.

As I understand it, when you use the Read Key(Variant)__ogtk.vi the name of the input typing cluster does not propagate. By this I mean the name of the cluster control/constant that envelopes the sub-keys. It is not the names of the sub-keys themselves you are talking about but of the collective entity.

Just wanting to make sure I trap the stated issue with my test.

Thanks

Jason

Link to comment
  • 3 weeks later...

Hi Jason,

somehow I never get any notification even though the thread is marks as being followed by me - I should ask in another thread...

To be honest I am not sure I understand your question. The input variant wire "type" contains the "names" of the elements embedded (number, string, cluster, etc...). It is used to read the proper keys - and this works perfectly now. The problem is that the output variant (labeled "key-value") is not of the same type as the input variant: the names are missing or wrong.

post-9285-0-59294300-1324465964.png

I am posting the screen-shots from the original post from openg.org, since the picture are not displayed unless one is logged in openg. It does not point to the root cause but shows an example of undesired effect.

post-9285-0-26614300-1324464467_thumb.pn

Here the Section Formatted Cluster contains a cluster with 2 elements: a string named "value" and a number with no name.

It is expected that the string would have the name "Name" and the number the name "Age".

When trying to get the "Age" element, nothing is found!

-> the workaround I have been using:

post-9285-0-43379400-1324465143_thumb.pn

! This is not the final fix that I suggest. Fixing the root cause "Read Key(Variant)__ogtk.vi is the proper way (as discussed in the original post with Jim Kring)

The expected result look like this:

post-9285-0-64597600-1324465172_thumb.pn

Now the elements of the VCluster have the right names and Getting the "Age" element out of the VCluster is working!

I hope I am not confusing you here.

I understand you are writing tests vis for Read Key(Variant)__ogtk.vi. Should I send a vi with my suggested fixes?

Can I see these tests, are they in the openg repository?

Cheers,

BaB

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.