From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set Decimal Point position from right to left Serial Read Evaluate Number within Range over RS-232

Yeah, you made things way too difficult.

 

Have your read loop run as fast as it wants.  The rate of the data coming in from the VISA Read will limit the loop rate.

Do not have a timeout on the Dequeue.  Let it just get the data whenever it comes in.

Let the consumer loop destroy the queue.  Your producer loop should send the stop command when it completes.  This will ensure you process all of the data.

 

So your code should look something like this...

 

Note: The Destroy Queue is in the STOP case in the producer loop.


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
0 Kudos
Message 21 of 23
(742 Views)

Thank you for your response. I did go back to my original vi and I had changed the termination character. What I did was add a check for 32 bytes before the case structure. I have attached the actual read string from the front panel, the vi and the write to measurement file. I do not believe my output data is correct though.

0 Kudos
Message 22 of 23
(732 Views)

@gprall001 wrote:

Thank you for your response. I did go back to my original vi and I had changed the termination character. What I did was add a check for 32 bytes before the case structure. I have attached the actual read string from the front panel, the vi and the write to measurement file. I do not believe my output data is correct though.


Why not?  What about it do you think is wrong?  The screenshot looks okay. It looks like complete packets of data to operate on.

 

But you still didn't set your VI up properly.  DON"T USE Bytes at Port.  Get rid of it.  Get rid of the case structure.  Just set your VISA Read to read 16 bytes.  (Or more is okay as well).  Right now you are polling your data waiting to see if you have 32 bytes or more, trying to read that and then getting everything up to the termination character.  This actually means you are getting somewhat stale data because you are waiting for the 2nd packet of 16 bytes to come in (to get 32) before you try to read the first 16 bytes.

 

Also, you have a shift register on the error wire.  Don't do that either.

 

See the attached VI for modifications.

 

0 Kudos
Message 23 of 23
(725 Views)