LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String # of Characters Limitations

I am working on a database program right now and am having trouble setting the number of characters I am able to save to the database in a string.  For example, if I want to save the following, abcdefghijklmnopqrstuvwxyz, the program will save only the first 20 characters (inclusive to 't') of the string.  Is there a reason for this?  Or, is there a way to get around this?

For a little insight, there are about 12 database fields being updated/saved together.  The 12 fields are collected using the "format into string" function and then passed to another subvi for updating the database.

Thanks,

David

0 Kudos
Message 1 of 9
(4,096 Views)
did you check the character length specified for that parameter in the database? how much it is?
Anil Punnam
CLD
LV 2012, TestStand 4.2..........
Message 2 of 9
(4,092 Views)

Anil,

The field size is set to 100.

David

0 Kudos
Message 3 of 9
(4,087 Views)
is it possible for you to post your code here?
Anil Punnam
CLD
LV 2012, TestStand 4.2..........
0 Kudos
Message 4 of 9
(4,079 Views)

Here are screenshots of the program.  If you need the .vi, let me know.  I don't think having it will help to much as it is also a subvi.

David

Download All
0 Kudos
Message 5 of 9
(4,066 Views)

Anil,

The field of concern is the assetnumber field.  All the fields will utimately need to be worked on; but, for now, I am just trying to get the one.

David

0 Kudos
Message 6 of 9
(4,051 Views)

Hi David,

 

I had this problem too a while back. A little bit of digging showed that:

1) the problem is OS specific (to an extent, see the next bit)

2) the folder path is part of the filename, the total filename length from the root directory to the folder is a maximum number of chars on each operating system - I forget the numbers now.

 

3) Workaround for windows:

Take the folder you are writing to, Subst a drive letter to it, or just above it (cmdline subst /? should help here)

Write to the [new drive letter]:\[filename] - this is a much shorter path than the full original path and should work.

 

(This is most often a problem when writing to Network drives)

 

Hope this helps

 

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
Message 7 of 9
(4,031 Views)

Everyone,

 

After several hours of digging into someone elses work (this vi and issue), I found that he was limitting the size of the text field through, once again, another subvi.  Thanks for all of your interest.  The jpg below shows were/how he was limiting the text input field, for everyones reference.

 

Thanks,

 

David

Message 8 of 9
(4,014 Views)

Now if that had been an FGV originally to store the data, with a check on the input case every time it was updated (maybe we'll call this one and Action Engine then) You'd have found the solution so much faster!!

 

Well done for finding it!

Kill the Globals if you have time so you have better traceability for next time Smiley Happy (and have words about the use of globals for that sort of thing with the original developer.) Smiley Tongue

 

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 9 of 9
(4,005 Views)