LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Change XML <Name> of wire

I have a program which logs an arbitrary amount of separate LabVIEW values to a CSV. I solved this by using variant data types and parsing their XML representation. Now, the header row of the CSV gets built by concatenating the label of the value, two colons, and the data type. For example:

 

timestamp::DBL,voltage::U32

 

I feed the data into my subVI by clustering 1 to n different elements and then making a variant out of the cluster.

The issue arises when someone connects a wire to the cluster which comes out of a LabVIEW operator, for example the Subtract node. The resulting wire doesn't have a label and as far as I can see, it's impossible to give it one. So one solution would be to create an indicator, hide it on the front panel, and renaming that. Then you can create a local variable which has that name and the label gets read correctly. But I want to do this without creating a bunch of indicators.

 

I have tried to take the wire without a label and feeding it into Flatten to XML and then modifying the Name tag. This works, however when you then unflatten that XML string, you have to specify a type. And the <Name> part gets taken from that constant's label instead of what you just set in the XML string itself. How can I do this? Once I know how to set the label, I wouldn't have a problem with making a polymorphic VI to catch all data types, it's just setting the label itself I have issues with.

 

0 Kudos
Message 1 of 11
(1,437 Views)

Hi Mathis,

 


@MathisRH wrote:

The resulting wire doesn't have a label and as far as I can see, it's impossible to give it one.


You can right-click the wire and attach a label (since several LabVIEW versions).

 

Which version do you use?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 11
(1,425 Views)

 

I have an XNode that relabels a wire:

paul_a_cardinale_0-1693427003572.png

Would you like it?

 

Or you can use this trick:

paul_a_cardinale_0-1693427193848.png

 

 

Message 3 of 11
(1,398 Views)

@paul_a_cardinale wrote:

 

I have an XNode that relabels a wire:

paul_a_cardinale_0-1693427003572.png

Would you like it?

 

Or you can use this trick:

paul_a_cardinale_0-1693427193848.png

 

 


#2 - never thought of that!!!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 11
(1,352 Views)

Or you could just use Coerce To Type...


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 11
(1,348 Views)

I seem to have a blind spot for coerce to type.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 11
(1,333 Views)

@crossrulz wrote:

Or you could just use Coerce To Type...


Perhaps it would be good to make an Express VI for that.

0 Kudos
Message 7 of 11
(1,317 Views)

@paul_a_cardinale  a écrit :

 

I have an XNode that relabels a wire:

paul_a_cardinale_0-1693427003572.png

Would you like it?

 

 


Nice! could you share that please?


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 8 of 11
(1,315 Views)

It's one of them (Relabel and Default Value.xnode) in the attachment.

Message 9 of 11
(1,298 Views)

Hi Paul,

 

I really like the idea of that XNode but I am unable to change the label. How do you do this?

0 Kudos
Message 10 of 11
(987 Views)