LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in reading data from serial port continuously- application hangs after sometimes

Hi billko,

                  I am not waiting for data, what is the meaning for  "you are trying to force timed reads when it cannot be done''

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 11 of 60
(1,199 Views)

@Ranjeet_Singh wrote:

Hi billko,

                  I am not waiting for data, what is the meaning for  "you are trying to force timed reads when it cannot be done''


Of course you are waiting for data.  You are trying to pair up unsynchronized data and the way you are doing it, the loop will not iterate until both of the VISA reads returns something.  Therefore you are trying to enforce synchronous reads.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 12 of 60
(1,185 Views)

How often do the external devices send data? What guarantees that both devices will send data within 600 or 800 ms of each other? You have termination characters disabled. How do you determine that you have complete messages and not part of a previous message and port of the current message?

 

There are several effective ways to synchronize the data without both Reads being in the same loop. But before making any suggestions, we should know more about what is goin on.

 

Lynn

0 Kudos
Message 13 of 60
(1,168 Views)

@billko wrote:

Of course you are waiting for data.  You are trying to pair up unsynchronized data and the way you are doing it, the loop will not iterate until both of the VISA reads returns something.  Therefore you are trying to enforce synchronous reads.


My loop will wait for timeout only. If no data read then it will go for other loop. Once I got valid values then I will store in string. then next time for other I got valid value then I will link and write to database

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 14 of 60
(1,147 Views)

that depends on user. When he scans then data comes and when he keeps weight on machine then weight will come.

 

My data lenght from each port is different is fixed and I am not facing any problem of data missing.

 

I can check with weight and scanned barcode that it is previous data of new data

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 15 of 60
(1,141 Views)

Method by which I am stopping the VI is correct. attached vi for reference...

 

When this VI hangs I forced to stop using task manager

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 16 of 60
(1,107 Views)

This is my actual VI

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 17 of 60
(1,104 Views)

The song remains the same.  Have you tried ANYthing anyone has suggested, instead of stubbornly saying that everything you are doing is correct?  If everything you are doing is correct, then why isn't it working?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 18 of 60
(1,096 Views)

I never said I am correct. I justified everything here asked from me. I never uploaded my actual VI and I found when application hangs then I face problem in stopping my app so I uploaded my actual VI..

 

 

I know some problem with my VI and Its not working thatswhy I am here

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 19 of 60
(1,090 Views)

It doesn't look like it should be the VISA connections.  They have a timeout of 600ms and 800ms.  And I assume your "hangup" is for a lot longer than a couple of seconds.

 

The other potential issue would be the connection to the database.  If that was interrupted in some way, you could have a timeout happening from that, which would look like a hangup.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 20 of 60
(1,080 Views)