LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

spreadsheet string to array crash error

I have a tab separated text file /r line terminated log file that I read in and convert to a 2d string array.  One log file crashes and Labview shuts down without the ability to error trap.  The program properly reads in the file and the crash occurs when the string is passed into LV's "spreadsheet string to array" function.  This error occurs only in LV6.1 the same test vi opened in LV8.5 runs fine.  Another puzzling aspect is adding or deleting one line to the input string allows the function to run as normal.
 
Unfortunately we can not switch to LV8.5 as the target hw is a W98SE based embedded PC and LV8.5 requires XP or better.
 
Anyone have any ideas on why this occurs?
 
In attached vi, selecting 'line string' control causes LV to crash in LV6.1 but not LV8.5
0 Kudos
Message 1 of 6
(3,297 Views)
Your VI is missing.
0 Kudos
Message 2 of 6
(3,292 Views)
0 Kudos
Message 3 of 6
(3,288 Views)
I notice that the format string control is set to the default %.3f which is a numeric type, but the data type input is string array. Is it possible that LV 6 crashes on the incompatibility of the types? Try changing the format string to %s in LV 6.

I don't have LV 6.1 so I cannot try it.

Lynn
0 Kudos
Message 4 of 6
(3,284 Views)

Good catch but I did try it w/ %s (which it really should be) - still no change - problem still exists.  Maybe someone with LV7 could try?

Also another interesting part exacte size of 2d array when crash occurs is 2728x3 = 1FF8h, memory allocation rollover error?

0 Kudos
Message 5 of 6
(3,281 Views)
RAMaston,

I verified that LabVIEW 7.0 still crashes when your program is run, but it works in LabVIEW 7.1.

By right-clicking the string control and setting the mode to "'\' Codes Display", I was able to see what affect the different termination codes had.  I found that if the text file ended in just "\r", LabVIEW would crash.  If the "\r" was deleted, it would work fine.  Also, "\n", "\r\n", and "\n\r" all work fine.

For your application, you could consider using the string functions to either append "\n" to the end of the text or to remove the "\r".  This should help avoid the crash you are seeing in LabVIEW 6.1.  I wasn't able to find any information regarding specific changes that may have been made to the function between LabVIEW 7.0 and 7.1 which fixed the behavior.

Regards,
Message 6 of 6
(3,257 Views)