05-16-2019 09:14 AM
Dear Sir/Madam, I have tried to use a LabVIEW program to read data from TPI597, Digital Hygrometer/Psychrometer. Please see the attached program and TPI597 manual (page7 about PC communication). l have two problems. 1. The data read by the LabVIEW program is much slower than these shown in the TPI597 screen. For example at 7:59, the humidity value on screen was about 94%. The LabVIEW program shew that data at about 8:03. 2. After about 15 minutes (sometimes 10 minutes) I got an error message as below, Error -1073807252 occurred at VISA Read in read RS232 .vi, Possible reason(s):VISA: (Hex 0xBFFF006C) An overrun error occurred during transfer. A character was not read from the hardware before the next character arrived (see the attached error. I wonder if you can let me know what the problems are and how to solve them. Thank you very much Hongjun Niu
05-16-2019 09:34 AM
Hi Chjn,
when a buffer overrun occurs you need to read the data more often/faster from that buffer!
I cannot open your VI due to its LabVIEW version but I guess you have an additional wait in your loop you use to read from the COM port. Get rid of that wait!
05-16-2019 10:16 AM
Hi GerdW
Thank you very much. I have deleted the wait. It works fine now. If I would like to reduce the data file size, is it possible to record the data every 30 or 60 minutes?
Best regards
CHJN
05-16-2019 01:26 PM
OK, I've looked at your code. Here are some comments:
Bob Schor
05-20-2019 02:01 AM
Hello Bob,
Many thanks for your suggestions. I will try them and let you know the progress.
Best regards
CHJN
06-12-2019 09:00 AM
Hello Bob,
Many thanks. I am back to work on the program.
To save one reading every 30-60 minutes is most important for me. I try to add a case structure in the loop and using Shift Register (see the attached), but it does not work well.
You mentioned to put a timer or counter in the loop and save every Nth value (or every 30-60 minutes "by the clock", a little more complicated computation). I wonder if you can let me know more details.
Best regards
06-12-2019 12:28 PM
You are putting the tick count difference into the shift register. Why?
You should be putting the value back into the shift register when the time has not elapsed, and the new tick count value in when it has elapsed!
Try running your code with highlight execution turned on. Watching the values flow down the wires would have clued you in.
You can also use the Elapsed Time Express VI in the timing palette. We generally try to avoid Express VI's, but this is one of the better ones that I do use when I need to.
06-13-2019 05:33 AM
Hello RavensFan,
Thank you very much. I have put the Elapsed Time Express VI in the loop and it works now.
When I put Set start time to 0 and Time target to 10 seconds. I get 12 or 13 second from tick count difference. But it marches better if I put Set start time to 0 and Time target to 30 seconds.
Best regards