11-30-2023 08:17 AM
Hi,
I receive data from a database as a 1D array of strings which I'd like to convert to a cluster which only has string type elements. The umber of entries from the DB is always the same.
What is the reason that I can't even connect 1D strings and Cluster of strings to the typecast node and is there a way to convert the array to the cluster without getting the indexes of the array and bundle it to the cluster?
Thanks!
Solved! Go to Solution.
11-30-2023 08:28 AM
Why would you want to use a typecasting?
Isn't Array to Cluster enough?
11-30-2023 08:35 AM
@ZYOng wrote:Isn't Array to Cluster enough?
No, its not. If I just use the array to cluster then I can't unbundle by name.
11-30-2023 08:37 AM - edited 11-30-2023 08:38 AM
If you want to keep the names of the cluster elements you could use 'Coerce to Type' in numeric -> conversion palette instead of 'Type Cast'.
See https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/functions/coerce-to-type.html
I don't know in which LabVIEW version this function came into the palette.
11-30-2023 09:41 AM
@1984 wrote:
If you use Variant to Data or Coerce to type instead of type case it'll work.