08-30-2023 02:30 PM
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.
08-30-2023 02:42 PM
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?
08-30-2023 03:24 PM - edited 08-30-2023 03:26 PM
I have an XNode that relabels a wire:
Would you like it?
Or you can use this trick:
08-31-2023 11:39 AM
@paul_a_cardinale wrote:
I have an XNode that relabels a wire:
Would you like it?
Or you can use this trick:
#2 - never thought of that!!!
08-31-2023 11:53 AM - edited 08-31-2023 11:53 AM
Or you could just use Coerce To Type...
08-31-2023 01:07 PM
I seem to have a blind spot for coerce to type.
08-31-2023 01:37 PM
@crossrulz wrote:
Or you could just use Coerce To Type...
Perhaps it would be good to make an Express VI for that.
08-31-2023 01:38 PM
@paul_a_cardinale a écrit :
I have an XNode that relabels a wire:
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
08-31-2023 04:29 PM
It's one of them (Relabel and Default Value.xnode) in the attachment.
12-04-2023 03:38 AM
Hi Paul,
I really like the idea of that XNode but I am unable to change the label. How do you do this?