‎03-24-2014 07:29 AM
Ranjeet_Singh,
As a test add some code to your application to monitor the size of the incoming buffer for both COM ports. Make sure that you are reading all data from the buffer. Since you are reading a set number of bytes each time there is a chance the buffer is filling up over time.
‎03-24-2014 10:07 AM
Hey, I just had an idea from reading another post. Are you using a real serial port, or is this a serial to USB adapter?
‎03-24-2014 10:12 PM
Yes, this hangup is longer than seconds. I am not sure that database connection is interruped. After hangup when I press stop button then scan serial number than my application stops.
If I dont press stop and first scan serial number than my data appears automatically and it writes data to database.
‎03-24-2014 10:14 PM
@Wayne.C wrote:
As a test add some code to your application to monitor the size of the incoming buffer for both COM ports. Make sure that you are reading all data from the buffer. Since you are reading a set number of bytes each time there is a chance the buffer is filling up over time.
Ok Will do that. But even if buffer is filling up but when next time I read it should clear the data....
‎03-24-2014 10:16 PM
Real....I have COM port in my PC. I am not sure about scanner. Although my scaneer have USB port and I am connecting it to USB then also it support serial interface and sending data serially.
‎03-24-2014 10:17 PM
Hey friends, the way I am stopping my VI is OK or some other way I can better stop it
‎03-24-2014 10:38 PM - edited ‎03-24-2014 10:41 PM
Stopping your VI looks just fine. Why do you think you have a problem with that?
I am wondering why you have a ring control which puts out a numeric value wired to the selector of a True/False case structure. There is nothing logical about that.
@Ranjeet_Singh wrote:
Ok Will do that. But even if buffer is filling up but when next time I read it should clear the data....
That doesn't make any sense. If the port is filling up, the next time you read it WILL NOT clear out the data. It will only clear out the 14 or 8 bytes you've read. All of the remaining bytes that will remain in the buffer. If 14 or 8 bytes is always the correct amount to read, then the port would not fill up.
‎03-24-2014 11:47 PM
Ok.
But my ring control is not connected to any case selecter. Can you please name it.
I have plenty of models and user can select any of it. thats why ring control
‎03-25-2014 06:31 AM
Inside while loop user can select any of the models and there other data need to also needs to appear in the front panel.
‎03-25-2014 07:49 AM
You have a race condition on your "range" indicator. You set in a case structure that runs parallel to your "database write" case structure. Therefore, you're probably writing the data for the following iteration of the while loop, and thus I expect you're hitting a rare case when the serial read data fails the string length tests, but you're still attempting to write it to the database.
To solve this, ensure you have syncronicity between the data qualification code and the database access code.
You also ought to properly follow all error wires through to capture error scenarios. This will help you understand why you're experiencing issues. To assist with this, use shift registers on your while loop to properly contain error and reference data, and exit on error (or handle as required).