I want to write a microcontroller by using LabVIEW 2015. I need to convert a Hex string to a Binary string. In the attached vi, it does the job. However, I have to create a file. After the binary file is read, I have to delete the file. It slows down the process. I am just wondering whether there is a easy and fast way to do that? I am using LabVIEW 2015. An example hex file (Program Memory.bak) is attached. After running the attached vi, a binary file is created automatically.
Any help will be appreciated.
Solved! Go to Solution.
Is it not really different to operate on a string in memory or from a string from a file. Not sure where you have problems.
(Also, none of your local variables are needed and could even give rise to race conditions. You can set the execution option to "clear indicators when called".)
Thank you for the reply. I want to convert Hex string to Binary string directly to write to a microcontroller, instead of to create a binary file, read the binary file and in application program to delete the binary file after the binary file is read. All the other staff in the vi are just for troubleshooting the vi.
Allow the FOR loop to build an array of U8 and then use Byte Array To String to convert to your string. You should also use the "offset" on the Scan From String so you can avoid a lot of string memory allocations.