LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

synchronising output from Serial Read

Hi,

 

I try to make the graph operation to synchronous display. Whenever I tried to do that there will be an error pop-out from my "Scan from string". There are no errors when the operation is not synchorize. 

 

Here is the pop-out error. 

Capture6.PNG

Download All
0 Kudos
Message 1 of 6
(2,727 Views)

Hi fendy,

 

Whenever I tried to do that there will be an error pop-out from my "Scan from string"

The error clearly comes from any of those VISA functions as is stated in the error message. And it tells you to read your serial port "more often" or "earlier"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,712 Views)

Does it work fine with synchronous display turned off?

 

If you read the documentation for synchronous display it says:

"If synchronous display is enabled, the block diagram will not overwrite the data for an indicator with a new value before the first has been displayed. The diagram will stop executing until the User Interface has updated the original value."

 

While I don't know that much about synchronous display - if it does indeed stop executing the block diagram while updating then it might be slowing down your block diagram causing your serial port buffers to overflow.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 3 of 6
(2,689 Views)

It worked fine with synchronous off. But the graph will shows a lagging data or stuck signal. Not smooth as in synchronous mode.

 

Regards,

Effendywoo

0 Kudos
Message 4 of 6
(2,681 Views)

Hi fendy,

 

as usual: use a producer-consumer scheme to avoid blocking important loops…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 6
(2,670 Views)

1. Data is constantly coming in.  So you should not have the Read Serial button.  Just remove the case structure entirely.  I recommend doing the same for your Read Data.

2. Wiring your Baud into the number of bytes to read makes absolutely no sense.  Since you are using the termination character, just set the bytes to read to something larger than the longest message you would ever expect.

3. Reinitializing everything to default when you stop is generally not something that is desired.  I would remove that as well.  At the very least, move it to be after your loop completes.

 

There is no reason to set your charts to be synchronous display.  This just adds a lot of overhead since the front panel will have to redraw every time you write to the chart.  Since you are getting data fairly quickly, this is nothing but a performance bottleneck.


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 6 of 6
(2,659 Views)