From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
I have an array of strings that needs to be written to a binary file. However, I have to keep the format of the file. That being 81 bytes per string to an amount of 40 strings in total. If the string array is smaller they need to be filled with unsigned bytes. Any ideas? Thank you very much in advance for the answer.
Start with a string constant of 81 bytes containing the "fill" you need. Then use "Replace Substring" to insert your text into the string overwriting the first part and there you go!
Pad your strings prior to the binary write. You could combine your padding with limiting (to a maximum of 40) the amount of elements taken from the array.
Second thought. Format Into String is a poor choice, go for Replace Substring as Ben suggested, it gives you flexibility to define your padding character.