LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DMATRIX Barcode String Truncation Issue in LabVIEW TSPL Printer Application

 

Description of the Problem:

I am working on a LabVIEW 2022 Q3-based barcode label printing application that generates commands and sends them to a barcode printer TSC TTP 244 PRO. The application collects several input parameters such as Customer Part Name, Project Name, Serial Number, Vendor Code, DBA Level, Speed, and Date, and concatenates them into a DMATRIX barcode string in the following format:

DMATRIX 10,30,100,140,"A1B1@ABC00124@02@29EA@A@032767@111251@71@16@1141"
Issue observed:-

When the combined length of all input fields is short (for example, Serial Number = 12345, DBA = 114), the DMATRIX command is generated correctly with the closing double-quote intact (as attached image1 of prn file) and the barcode prints successfully.

However, when the input values are longer (for example, Serial Number = 327677, DBA = 1141), the concatenated DMATRIX string gets truncated. As a result, the closing double-quote character is lost, the TSPL command becomes syntactically invalid, and the barcode either does not print due to missing full length string.

 

Root Cause Suspected:

The string buffer or field width allocated during string concatenation in the LabVIEW block diagram appears to have a fixed maximum length. When the total character count of all combined input fields exceeds this limit, the string is cut off before the closing quote can be appended, resulting in a malformed printer command.

What I Need Help With:

  1. How to identify and increase the string buffer size in the LabVIEW concatenation or Format Into String node responsible for building the DMATRIX command line
  2. How to ensure the closing double-quote is always appended safely, regardless of input length
  3. Best practices for validating string length before sending commands to the printer to prevent silent failures

Environment:

  • Software: LabVIEW
  • Printer Command Language: TSPL
  • Printer: Barcode Label Printer
  • OS: Windows

I have attached code as well as screenshots of the showing both the case.

Any guidance would be greatly appreciated. Thank you.

 


 

0 Kudos
Message 1 of 6
(298 Views)

This is complete code of  project 

0 Kudos
Message 2 of 6
(269 Views)

I could not reproduce the problem. Although, there were 2 sub vi missing, and I did take the liberty of cleaning up your code quite a bit. I also skipped generating the file output.

 

Frozen_0-1780503264955.png

 

Here is the output.

Frozen_1-1780503365640.png

As you can see, the trailing quote is present. What are you using to look at the output? IE, are you looking at the generated file? If so, you might want to look into how you are writing the file.

Good luck.

 

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
0 Kudos
Message 3 of 6
(185 Views)

Hi,

Thank you for looking into this.

To clarify the issue: the complete Data Matrix barcode string is being generated correctly within LabVIEW at runtime, however when the TSPL command is written to the file, the barcode string is getting truncated and the full string is not appearing in the output file.

Could you please investigate why the string is not being written completely to the file, even though LabVIEW is showing the correct complete string?

Looking forward to your response.

Regards

0 Kudos
Message 4 of 6
(166 Views)

@aditya117 wrote:

 

To clarify the issue: the complete Data Matrix barcode string is being generated correctly within LabVIEW at runtime...

 


But that is *not* what your original post said 😒

 


@aditya117 wrote:

Could you please investigate why the string is not being written completely to the file, even though LabVIEW is showing the correct complete string?

 


 

Looking closer, your code is *not* writing to a file either 🙄

 

Frozen_0-1780585676189.png

 

First thing I would try is updating to the new version of "Create Easy Text Report"

After that... maybe an alternative method to print?

Or open a support ticket with NI Support.

 

Good luck

 

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
Message 5 of 6
(148 Views)

The function you are calling MIGHT be trying to format the text based on your font size and paper orientation

 

I would experiment with changing the orientation to landscape. This would allow for a longer line length (char count)

 

You could also try a smaller font size...

0 Kudos
Message 6 of 6
(126 Views)