04-15-2021 06:08 AM
Hi Gregory,
I have tried with Termination Character (0xD). Still code gives read error and stops after few iterations. Also the scanner is in auto-scanning mode.
Please find the enclosed vi snippet.
Regards.
GMatharoo
04-15-2021 11:17 AM
04-15-2021 11:23 AM
Hi Gregory,
As I mentioned the scanner is in auto-scanning mode. Scanning at a constant rate. I need to run the test continuously for two-three days. But it just stops after reading only five scanning cycles. How can I synchronize the Visa Read with the scanner output.
Regards.
GMatharoo
04-15-2021 11:46 AM
Well it is only stopping because you told it to stop on any error. If that specific timeout error occurs, you should ignore it. There is a "Clear Errors" VI for this purpose. You could also increase your timeout value depending on how response you need the loop to be.
I would get rid of "bytes at port" as Crossrulz suggested, and just do the VISA read. Then you can see if number of bytes read is >0. If it is, update your read buffer, if it isn't, then do nothing.
04-16-2021 08:53 AM
Hi Gregory,
As per your recommendation, I am now using Visa Read without property node "bytes at port". I noticed that Visa Read vi only reads scanner output once. After that, it never reads. I tried with property node with Term Character. Also tried without property node, and by changing different "timeout" values. But I didn't find any output(after a single read).
Please find the enclosed snippet vi and screenshots with Highlight Execution ON.
04-16-2021 09:07 AM
Your timeout is set to 3 seconds. Are you sending new barcodes to be read faster than that? If you don't pull the trigger fast enough, you'll get a timeout. Since your error wire has a shift register on it, once you get an error, it will prevent all future runs from reading.
It seems you didn't look at the advice about clearing specific errors.
04-16-2021 09:21 AM
Hi RavensFan,
Could you please suggest to me where should I put the " Clear Error" vi.
If send me a pic of the updated code, I will appreciate it.
Regards.
GMatharoo
04-16-2021 10:17 AM
04-16-2021 12:13 PM
Hi Gregory,
It works fine without error case structure.
I have to count the output from the scanner. I was using the " Bytes at Port " property node.
If I add one more property to input property control. It doesn't count any input from the scanner. What to do?
04-16-2021 12:22 PM
I don't see how the picture you posted relates to the picture Gregory posted.
And your picture is incomplete.
You should not need Bytes at Port 99% of the time.
Have you seen Crossrulz' VI Week presentation ?