LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a maximum string length?

Hi,

I'm writing a program that accumulates reaction times for four users in an array and then converts them to strings and concatinates them to save as a tab delimited text file to be opened in Excel.

Everything seems to be working ok at the moment but I'm just wondering if there is a maximum string size that I may at some point exceed with lots of results.

So, is there a maximum number of characters in a string? Is it determined by the amount of RAM allocated to LabView?

Thanks,
Dave.
0 Kudos
Message 1 of 4
(4,790 Views)
Hi Dave,

I think you'll find the answer here: http://forums.ni.com/ni/board/message?board.id=170&message.id=63620&requireLogin=False . It says "LabVIEW stores strings as a pointer to a structure containing a 4-byte length value followed by a 1D arrays of byte integers (8-bit characters)."
J.R. Allen
0 Kudos
Message 2 of 4
(4,785 Views)
hi,

excel has a limit of 64k x 256 cells, that gives a maximum medium size of 256 characters for each string in a cell using a maximum size of 2^32 characters (4 GB!). i think the problem would rather be on the excels side.

best regards
chris
Best regards
chris

CL(A)Dly bending G-Force with LabVIEW

famous last words: "oh my god, it is full of stars!"
0 Kudos
Message 3 of 4
(4,771 Views)


@chrisger wrote:
hi,

excel has a limit of 64k x 256 cells, that gives a maximum medium size of 256 characters for each string in a cell using a maximum size of 2^32 characters (4 GB!). i think the problem would rather be on the excels side.

best regards
chris




Well Excel will most probably throw up long before. But LabVIEW's string has also a limit which is fast getting into the realms of real hardware. The first 32bit integer indicating the size of the string actually is a signed integer in LabVIEW, limiting a single string to 2^31 or 2GB characters. There is no real need to use a singed integer for this parameter but it has been so since the beginning and to change it now might actually cause all kinds of problems in completely unrelated areas. Of course if you are starting to handle your data in such a way using a single string for this, you are probably going to have a lot of other problems long before you reach the 2GB limit for a single string in LabVIEW.

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
Message 4 of 4
(4,745 Views)