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.
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.
03-02-2007 12:09 PM
03-02-2007 12:21 PM
When I run it in 8.2 it gives an error 116 everytime. "Unflatten or byte stream read operation failed due to corrupt, unexpected, or truncated data." The reason is that it doesn't know how long the string is. There's a boolean input "data includes array or string size? (T)." You don't have this wired up, meaning the function is looking for the string size at the beginning of the string. Change this to false and you don't get an error.
One question though, why are you unflattening a string to a string?
03-02-2007 01:46 PM
Marc,
I'm unflattening a string to a string due to other sections of my code where I flatten a double, array of doubles, or array of strings to this cluster. This way I can use a common bucket for any type of data, and it was necessary to handle strings as well. It was for consistency.
The error I receive in Labview 7.1 occurs before the unflatten command. Could the data in this constant be corrupted and cannot be read onto the wire?
Best regards,
Charles
03-05-2007 12:13 PM
Reed,
I ran your program in LV 7.1 and I was able to see the same error you did. Running it in 8.x the problem does not appear becaue the Unflatten to String has been re-written. It has the option to specify if the size of the string is included with the byte string. This is what Marc A was refering to. Marc A's fix is valid for LV 8.x and you can read the byte string. In my case it did not convert it to a ascii characters. It was still showing it in binary. I will have to do some more research to figure the reason for your error message.
By the way, do you have access to LV 8.x?
Best regards,
03-05-2007 12:44 PM
Kalin, his problem is not with the unflatten VI, as I had also originally thought. He's saying that the error is before the unbundle.
Charles, I can't see any errors other than the one I replied about. Do you mean that there is an actual error with the wire causing a red 'X', or is it just a message that pops up when you open the VI? Everything seems to work fine in 8.2, so whatever you've run into might have been fixed. I don't have 7.1, but maybe someone else can use it to open your VI and see if they get any errors.
03-05-2007 02:01 PM
Marc / Kalin,
Originally, the problem occurs before data is written to the wire (in highlight operation mode). I've further reduced the problem where the string constant is removed from the bundle and directly connected into an unflatten. In this case the same error occurs. However, when I connect this string to an indicator instead of the unflatten, no error occur. It may be some relationship in how the data is handled or prepared for an unflatten command.
I don't have access to Labview 8, only 7.1. The error is only a pop-up window that states "Not enough memory to complete this operation"; there are no red "X" denoting a bad wire connection.
This code was upgraded from Labview 6.1 to correct other issues. This problem occurs only in Labview 7.1, and Marc has noticed a patch for 8.2 which appears to handle or ignore this error.
Best regards,
Charles
03-05-2007 03:23 PM
03-05-2007 03:28 PM
Hi Charles,
Your binary string did not contain size information. According to the description of the Unflatten to String VI you have to specify the size of the binary string. Check the attached VI. It works fine now.
Binary string contains header information before each nonscalar component describing its size. The elements of binary string are in machine-independent, big-endian form.
The string constant input to the Unflatten from String VI is in HEX format. 0000 0008 specifies the size of the binary string in HEX.
Note: If you don't specify the exact size of the data, you will get an error.
Hope this helps!
06-02-2008 04:08 PM - edited 06-02-2008 04:10 PM
06-03-2008 04:53 PM