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: 

Taking data quicker

The Bytes at Port would be taken right after the serial write, since you are waiting for data to be returned from the meter.  You can use this as a trigger to then read the data from the serial port, testing for your termination character in the process.  Broken Arrow suggested this to help with the timing at the serial port and data transfer; otherwise, your port will timeout if it doesn't receive the number of bytes you specified.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
Message 11 of 14
(432 Views)

@MoReese wrote:

[...], your port will timeout if it doesn't receive the number of bytes you specified.



and you said your loop is taking 20 seconds -- 5 seconds too long. You timeout is wired for 5000mS. There's your extra 5 seconds.

Richard






0 Kudos
Message 12 of 14
(405 Views)

That makes sense if the device is timing out, however I am not timing out.

0 Kudos
Message 13 of 14
(399 Views)

@Dan Stewart wrote:

That makes sense if the device is timing out, however I am not timing out.


Ok, but have you changed your code, following the suggestions, and it still doesn't work? Try sending the command in Hyperterminal and see how long the unit takes to respond. Also try changing your timeout, to say 8 seconds, and see if the loop takes 23 S rather than 20.

 

In LabVIEW, you might use something like this to read the bytes. This is an easy way to get your own timeout. This will allow ~60mS to get the data. Just change the 5 to a higher number if you're not getting all the data.

read ceeal.png

Richard






0 Kudos
Message 14 of 14
(392 Views)