From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[LV2013SP1] Strange cluster ordering from a database

Hello,

 

I'm not an expert in LabView since I come from the

embedded world (C/C++) yet I found something

quite strange when reading from a database.

 

Here's attached some screen captures of the

database content and structure, then the LabView

diagram with the probe output (yeah, had to stretch

it wide because there is no word wrap option).

 

Finally there is a little Excel snapshot of the result.

 

The database reading is performed with a certain

column ordering, the "casting" cluster do mirror

the same order and datatype, yet 'Variant to Data'

scramble things.

 

And even though I do use dis/assemble cluster

by name to avoid confusion, the resulting cluster

at probe 20 is right. Go figure...

 

Could someone help and explain what's going

on under the hood ? At least with C/C++ you have

a little grasp on how memory is ordered, but

LabView really bogs me...

 

David

0 Kudos
Message 1 of 16
(2,792 Views)

And the remaining two snapshots...

 

David

 

PS : update the LabView's UI to something more up to date, avoid the windows-on-top, avoid messing the task bar with dozens of buttons, share to place and use your own tab bar, do something for the probe and breakpoint windows, etc...

0 Kudos
Message 2 of 16
(2,791 Views)

I am not really sure what you are asking, but the ordering of elements in a cluster is defined by the cluster order (changeable by "right-click...reorder controls in cluster"). It is not defined by the  cosmetic arrangements of elements in the cluster container.

0 Kudos
Message 3 of 16
(2,789 Views)

I do have ordered the clusters, not just moved things inside. BTW the clusters automaticaly display the right order when displayed vertically.

 

The question is : "Why 'Variant to Data' fills probe 19 wrong while probe 16 is right, even though the 'Pdt_D' cluster do mirror the column ordering ?"

 

Simple question calls for simple answer.

 

David

0 Kudos
Message 4 of 16
(2,782 Views)

@Kochise wrote:

 

 

The question is : "Why 'Variant to Data' fills probe 19 wrong while probe 16 is right, even though the 'Pdt_D' cluster do mirror the column ordering ?"

 

Simple question calls for simple answer.

 

 


And how are we suppose to know????

 

You have not posted any of your code as in a VI. A PNG file doesn't count.

 

Frankly I don't give a hoot what your Access database looks like.

 

 

 

0 Kudos
Message 5 of 16
(2,766 Views)

@Kochise wrote:

The question is : "Why 'Variant to Data' fills probe 19 wrong while probe 16 is right, even though the 'Pdt_D' cluster do mirror the column ordering ?"


Until just now, you haven't mentioned probe 19 and that it is "wrong" (whatever that means), just that probe 20 is right.

 

This is impossible to troubleshoot from pictures alone, but did you notice that the wire on probe 20 causes a coercion dot at the next function, indicating a type mismatch?

 

 

0 Kudos
Message 6 of 16
(2,751 Views)

Looks like to me that probe 16 is a variant array.  You pass this into the variant conversion VI with a cluster as the new type.  Maybe this is causing the reordering.  or the ordering of cluster controls in this constant is wrong.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 7 of 16
(2,735 Views)

Ok, I've found the bug in LabView 2013 SP1.

 

The 'Pdt_D' cluster had suffered several modifications and

reordering, but 'Variant to Data' doesn't follow the cluster

virtual ordering but the cluster's memory ordering.

 

In short, if you create a cluster one way, delete members,

add some more, adapted and reorder, the 'Variant to Data'

VI will take the members' order in which they were added

to the cluster, regardless of the hypathetic ordering you

might have specified afterward.

 

Probably a problem of chained list, one listing the members

as they are added, one listing the members in the specified

ordering, perhaps the bug comes from pointing the wrong

list.

 

If you delete the 'Pdt_D' cluster, create a brand new cluster

constant, then add one by one the members of the right

datatype, 'Variant to Data' works like expected and dispatch

the variant's data into the belonging members.

 

There's is no use providing you with a snapshot because

it will all look the same that I have already provided you with,

just that the cluster has been recreated from scratch and

not been reordered. That's a rather annoying spurious bug

you'd better be strong hearthed to deal with.

 

And for the VI, it's a rather complex proprietary application

I cannot disclose, but I'll create an example VI further in

time so that you can witness it by yourself.

 

Sorry for not being specific enough with my problem.

 

David

0 Kudos
Message 8 of 16
(2,691 Views)

If you think you found a real bug, please report it to NI so it can be fixed.

0 Kudos
Message 9 of 16
(2,676 Views)

Will further investigate and create a sample

demonstration beforehand, then if confirmed,

a but report will be issued.

 

Thanks for your attention.

 

David

0 Kudos
Message 10 of 16
(2,674 Views)