LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While Loop is very slow for serial reading

Solved!
Go to solution

@pincpanter wrote:

When you set a term char, the VISA Read outputs a timeout error if this char is not there.

As I already suggested, require a large number of characters (e.g. 1000), then check for the error output. If there is no error, you are sure that the term char is there.


I got it..! Thanks for your answer - this works now with the termination char outside the loop.

 

0 Kudos
Message 21 of 26
(1,147 Views)

now for 5Hz I get following timestamps:

 

read_new.png

 

so the solution are a few points:

 

- the most impact was the FTDI converter which was set to 16ms. Now I changed it to 1ms. Thanks to @MichaelS78

- use a termination char outside the timestamp loop

- reading more than expected chars and check the error state for the trigger

 

Those points together gave me the right solution I was looking for. Thanks to all your replies..!!

Message 22 of 26
(1,142 Views)

@Norick17 wrote:

@pincpanter wrote:

When you set a term char, the VISA Read outputs a timeout error if this char is not there.

As I already suggested, require a large number of characters (e.g. 1000), then check for the error output. If there is no error, you are sure that the term char is there.


I got it..! Thanks for your answer - this works now with the termination char outside the loop.

 


Could we see the new vi (or at least a picture) because what you described doesn't seem to match what was suggested.

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 23 of 26
(1,131 Views)

@billko wrote:

@Norick17 wrote:

@pincpanter wrote:

When you set a term char, the VISA Read outputs a timeout error if this char is not there.

As I already suggested, require a large number of characters (e.g. 1000), then check for the error output. If there is no error, you are sure that the term char is there.


I got it..! Thanks for your answer - this works now with the termination char outside the loop.

 


Could we see the new vi (or at least a picture) because what you described doesn't seem to match what was suggested.


Here is my last updated vi:

 

last_vi.png

0 Kudos
Message 24 of 26
(1,117 Views)

@Norick17 wrote:

@billko wrote:

@Norick17 wrote:

@pincpanter wrote:

When you set a term char, the VISA Read outputs a timeout error if this char is not there.

As I already suggested, require a large number of characters (e.g. 1000), then check for the error output. If there is no error, you are sure that the term char is there.


I got it..! Thanks for your answer - this works now with the termination char outside the loop.

 


Could we see the new vi (or at least a picture) because what you described doesn't seem to match what was suggested.


Here is my last updated vi:

 

last_vi.png


Yeah, thumbs up.  That should work - at least the comms part of it.  🙂

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 25 of 26
(1,069 Views)

For anyone else looking at this code: to be precise, the first delta t is garbage and will not be considered in the subsequent calculations (that we don't see).

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 26 of 26
(1,053 Views)