How can I convert the variant array to a concatenated string? I am trying to format the global variable for output to a text file. The global variable has too many variables to manually add each to an array. The report and ring can be removed from the global variable if needed -- I tried this and had no luck. I would prefer to leave the report and ring in the global variable to avoid having to make more global variables.
VI's made with LabVIEW 2021 SP1. 18 backdated version also included.
Solved! Go to Solution.
I think you will need to use the Data Type Parsing VIs to make a case for every variable type and then convert each one to a string individually. You basically have a modified version of this problem where using those VIs is the solution.
If you put everything in the Global into a giant cluster you could use the MGI write anything function on it.
I did not want to take credit for someone else's work, so I searched up the original post which provided the solution for me.
Using the VIs posted by Paul Cardinale worked perfectly for me.
For your application you should be able to use the Variant Text.vi directly like this.
Thank you kghzvi! This was super easy to adapt for my needs!
Note to future readers -- this VI puts both \r\n and an end of line constant at the end of the string. If you want a clean string without these additional characters you need to modify the end.
Helpful notes to remove line breaks and new line characters: