COM port dropping characters

Label printing integration (NiceWatch middleware and ActiveX programming interface)

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
clowe
Enthusiast
Posts: 9
Joined: Mon May 14, 2018 10:36 pm

COM port dropping characters

Post by clowe » Thu May 24, 2018 10:34 pm

Has anyone successfully created an automation job that will receive data from a handheld scanner (USB that is a virtual COM port), and print the data to a label? This is my flow right now: scan a barcode with alphanumeric data, use a data filter on the scanned data, for each line I execute a SQL statement to populate one variable, I send that variable and the scanned barcode to a label and print it out. This only works one time before I have to reset the Automation Manager; any additional scans after the first one result in the original barcode being stripped of one character each scan. For right now I'm just looking for samples on how to use COM port triggering with a handheld scanner if anyone has a solution they'd care to share. Thank you in advance...

clowe
Enthusiast
Posts: 9
Joined: Mon May 14, 2018 10:36 pm

Re: COM port dropping characters

Post by clowe » Fri May 25, 2018 7:03 pm

Here are the files I am using as samples. Is there anyone else that uses a scanner to automate printing?
-Chris
Attachments
ComData.zip
(9.23 KiB) Downloaded 35 times

User avatar
dado
NiceLabel Development
NiceLabel Development
Posts: 664
Joined: Tue Sep 12, 2006 12:50 pm
Location: Kranj, Slovenia
Contact:

Re: COM port dropping characters

Post by dado » Sat May 26, 2018 9:01 am

Hi

Yes, there are lots of customers that are successfully using Serial Port trigger and I know we will manage get you among one of them too.

First step I would like you to do is to add an action (add it to the top as the first action) Save Data to File and select "Use data received by the trigger" and click show more and select overwrite. Just set any file name which will hold the data that is scanned. Now run this configuration. What I want to determine is what extra character gets added by your device. I am pretty sure that you don't get 8 characters as you set-up in the filter.

Could it be that after the barcode is scanned that you get a (CR/LF) added? And because your trigger executes after 8 characters... this means that the 9th character that could be potentially CR or LF is then transfered to the next trigger execution.

Data that I assume your scanner sends: 12345678<CR>
1 trig: 12345678
2 trig: <CR>1234567
3 trig: 8<CR>123456
4 trig: 78<CR>12345

Let me know what the newly created file holds...

Regards, Damjan

clowe
Enthusiast
Posts: 9
Joined: Mon May 14, 2018 10:36 pm

Re: COM port dropping characters

Post by clowe » Tue May 29, 2018 3:53 pm

Thank you for your reply, I apologize for not responding quicker as I was away from my computer for a couple of days. The included file shows the <CR> just as you suspected which I thought I had cleared up a long time ago but obviously did not. Now the question is, whats the best way to handle it?

Regards,
Chris
Attachments
Scan.zip
Word doc w/ jpegs
(134.5 KiB) Downloaded 34 times

clowe
Enthusiast
Posts: 9
Joined: Mon May 14, 2018 10:36 pm

Re: COM port dropping characters

Post by clowe » Tue May 29, 2018 5:46 pm

Update:
I set the Field length in the Structure to 9 with the Delete non printable chars set, and changed the serial port to read 9. It appears to be working now but I will keep testing.

Regards,
Chris

User avatar
dado
NiceLabel Development
NiceLabel Development
Posts: 664
Joined: Tue Sep 12, 2006 12:50 pm
Location: Kranj, Slovenia
Contact:

Re: COM port dropping characters

Post by dado » Tue May 29, 2018 10:50 pm

I would change the trigger configuration. Instead of setting the length of the data received I would use the <CR> character as the signal for the END of data. This means that I would select the option "on sequence of characters received" and for the value enter <CR>
Now unselect the "Include in trigger data". This will not add the <CR> to the "12345678" data which triggered the Serial Port trigger.

This kind of makes more sense. Because in your scenario if the user would somehow read only 7 characters from a defective barcode. Then all your next 8 digit barcodes would have one character in the previous trigger execution.
Example:
12345678 - User reads normal barcode
Serial port trigger is executed because there are 8 characters
1234567 - User reads a defective barcode
Currently only 7 characters wait on serial port. Trigger is not yet executed.
12345678 - User reads normal barcode
The first number in this barcode is now the eight character that the trigger was waiting for and it gets executed. The remaining 7 characters 2345678 now wait in the serial port....
And because of this using the <CR> is an excelent solution.

Regards, Damjan

clowe
Enthusiast
Posts: 9
Joined: Mon May 14, 2018 10:36 pm

Re: COM port dropping characters

Post by clowe » Thu May 31, 2018 4:09 pm

I made those changes and it does flow a lot better. Thank you for the help.

Regards,
Chris

User avatar
dado
NiceLabel Development
NiceLabel Development
Posts: 664
Joined: Tue Sep 12, 2006 12:50 pm
Location: Kranj, Slovenia
Contact:

Re: COM port dropping characters

Post by dado » Fri Jun 01, 2018 6:00 am

No problem 8)

Regards, Damjan

Post Reply