ni.com is currently undergoing scheduled maintenance.
Some services may be unavailable at this time. Please contact us for help or try again later.
05-21-2021 08:16 AM
Why does LabVIEW have dozens of converters? Why can't we have a universal converter that you just wire up and it automagically converts the gozinta to the gozoutta? Well, OK that's asking too much. But I've got a good start on it. This XNode (as it's title implies) will convert a string into practically anything. It adapts to whatever is wired to the output. (Also, depending on what you've hooked up, there can be an optional "Format" and/or a "Delimiter" input. But usually the defaults are fine and you don't need to wire these.)
It even handles units:
05-21-2021 08:55 AM
@paul_cardinale wrote:
Why does LabVIEW have dozens of converters? Why can't we have a universal converter that you just wire up and it automagically converts the gozinta to the gozoutta?:
This old (denied) idea would have dealt with Godzilla instead. 😄
Thanks, I'll have a look at your thing!
05-21-2021 09:21 AM - edited 05-21-2021 09:59 AM
@paul_cardinale wrote:
Why can't we have a universal converter that you just wire up and it automagically converts the gozinta to the gozoutta?
I think "Type Cast" pretty much does that.
But I am sure there are some caveats, so use it with caution.
https://zone.ni.com/reference/en-XX/help/371361R-01/glang/type_cast/
BTW: There are so many converters because there are so many data types and some of us have an "aversion to coercion dots". When I was starting out my mentor called them "loser dots" or "lazy dots".
I forgot about the newer "Coerce To Type Function"
Similar to Type Cast but works better for numbers.
https://zone.ni.com/reference/en-XX/help/371361R-01/glang/coerce_to_type/
05-21-2021 01:16 PM - edited 05-21-2021 01:26 PM
This is my first attempt at using an Xnode(?) vi?
I unzipped everything but opening the top level VI opens it in an empty project and placing it on the block diagram only places an empty vi.
05-21-2021 03:13 PM
@RTSLVU wrote:
This is my first attempt at using an Xnode(?) vi?
Same here. Please include significantly better instructions on how to use all this.
05-21-2021 04:02 PM
@RTSLVU wrote:
This is my first attempt at using an Xnode(?) vi?
I unzipped everything but opening the top level VI opens it in an empty project and placing it on the block diagram only places an empty vi.
Probably a missing dependency. I'll submit a fixed version (in a bit, very busy right now).
05-21-2021 04:52 PM
The previous version actually works with LV 2018 (which is what I built it with). But with later versions, one of LV's enums changed, and since I have an overactive aversion to 'Default' cases, there was a case structure that broke. Here is the fixed version. Works with LV 2018, 2019, 2020 (of course it you're using 2019 or 2020, you'll get a faster load if you first mass compile).
05-24-2021 05:45 AM
Hi Paul,
Could you please post in LV2017 version.
05-24-2021 06:42 AM
@gkrn wrote:
Hi Paul,
Could you please post in LV2017 version.
Here