Error 74 at Unflatten From String in LabVIEW

Updated Mar 27, 2024

Reported In

Software

  • LabVIEW

Issue Details

I'm getting Error 74 ocurred at Unflatten From String: Memory or data structure corrupt when I try to run my program.
image.png

Solution

If you're trying to get data from a communication protocol (Modbus for example), and you use Flatten to String and Unflatten from String functions to process this information, make sure that you're always sending data to the Unflatten From String function since it needs data to work correctly. Rarely when the communication occurs for the first time there is no data in the buffer, so these functions interact with nothing, and it is in this case where the error shows up. In the following image, you will see an initialized array, and the program works correctly.
image.png
But using an array that is not initialized, and you try to run the program, the error will appear.
image.png