LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

DebugPrintf has 259 character limit?

Solved!
Go to solution

Do I have a strange installation of CVI 2012 or is there a 259 character limit to an output string with DebugPrintf? I thought that my code was not working because my incoming data seemed to be truncated and I was monitoring it using DebugPrintf. I finally tried the following code on its own

 

char     string[] = {"insert 260 ascii characters"};

DebugPrintf ("%s",string);

 

When I run this only 259 of the characters are shown in the debug window.

 

If I change DebugPrintf to printf and check the 'copy standard I/O to debug window' in the environment setup then I get all the characters.

 

Just wondering.

 

Andy

0 Kudos
Message 1 of 5
(4,373 Views)

Hello Andrew,

 

While there isn't supposed to be a limit on the length of a DebugPrintf line, it does seem that we run into a limit when displaying that information in the Debug Output Window. I have reproduced the issue in LabWindows/CVI 2013. I filed a report (#466209) so that this can be investigated by a developer. In the meantime, one workaround is splitting the string into multiple lines, which will display correctly.

 

We value customer feedback on NI products, so thank you for sharing this behavior that you noticed.

Taylor B.
National Instruments
0 Kudos
Message 2 of 5
(4,346 Views)

Hello Andy,

 

I have been in touch with some of the developers about this behavior, and we were wondering if the workaround (printing the string to multiple lines) works for your application. Also, is there a reason you need very large strings printed to your Debug Output window? Thanks again for your feedback.

Taylor B.
National Instruments
0 Kudos
Message 3 of 5
(4,327 Views)
Solution
Accepted by topic author Andrew_Quick

Hi,

 

In my case printing with multiple lines might work but as I have other solutions such as writing to a file or even using printf I have not tried the workaround. I have a CVI program that is interfacing to an external software package using .NET and the other program returns a char pointer to a text area. My normal method of debugging something like this is using DebugPrintf so it caused some confusion when the data I was expecting was truncated. Now I know the reason it is not a problem. I would not use DebugPrintf in the final code anyway as I compile it into a released DLL to be called from TestStand.

 

Thank you for the replies.

 

Regards

 

Andy

0 Kudos
Message 4 of 5
(4,302 Views)

fixed in CVI 2020

0 Kudos
Message 5 of 5
(1,655 Views)