07-26-2016 12:13 PM - edited 07-26-2016 12:17 PM
I tried the vi you posted and it works for about a minute or so. Than the "VISA_read" gives a a timeout error. See attached screenshot.
07-26-2016 12:42 PM
07-26-2016 12:47 PM
If you know it is always 332 bytes, then set your read to be 332 bytes.
There is no reason for the VI to be crashing.
Are you sure you set the termination character to be hex 03 like Henrik showed in the example VI he attached?
Attach your actual VI so we can look at how it is setup rather than trying to look at partial screenshots of section of code.
07-27-2016 03:51 AM - edited 07-27-2016 03:53 AM
I used Henriks vi without modifications. Therefore I don't post it again. The only thing I did was setting the COM port to COM3 (which is the right one).
I have to admit, I don't know anything about:
1) XON/XOFF (that's why I didn't change the settings for them (x11 and x13 in Henriks vi).
2) the parameter "16" which is set in the "VISA Set I/O buffer size"
There is not really much more to the vi than that apart from the fact that the loop speed in which the write/read operation is done is set to 5ms using "wait until next ms multiple". But since it is waiting for the write/read operation to finish this timing cannot really be an issue.
07-27-2016 05:33 AM
The XON/XOFF is turned off, so don't worry about that.
Because the communications worked for a little bit, I am thinking the device had a buffer overrun. You could try increasing the loop delay so that you are not constantly requesting/reading data.
I simplified the VI (got rid of a bunch of stuff that was not really doing anything). See if this works any better for you.
07-27-2016 06:08 AM - edited 07-27-2016 06:10 AM
Maybe the device connected somehow didn't get up with the commands....
try this version and if you get an error (the vi should stop , not crash 😉 ) hit edit-make current values default , save and post the vi.
I added some debugging help and a delay to read about every second. ...
EDIT: And johnsold had about the same ideas 😄
Next thing: post the manual and explain in detail what you need/want ..
07-28-2016 01:31 AM
Thanks once more for your new vi!
Ich run it without any modifications and it worked ... for about 2-3 minutes. Then I got the same error that I always get: Fehler -1073807339 (Zeitüberschreitung).
I saved the vi with the last values as you requested.
It always reads 332 bytes. No data are "not read".
I also attached the manual of the device.
The device collects data of four pressure sensors. Via a RS-232 interface at the back of the device I am trying to record the pressure data continuously to my PC using LabView. I need the pressure values for a control application that will also run in LabView.
On page 17 of the manual the com port setting are specified.
In appendix G (page 43) there is more information on the data outputted by the device.
Funny enough the company also sells a software with the device that is written in Labview, but unfortunately it's an *.exe file and I can't have a look at the block diagram. This program works fine on my PC.
07-28-2016 01:41 AM
Just for completeness:
I also tested the vi provided by crossrulz. I get the same error but earlier. (After about 80 reads). This might have to do with the fact the the loop runs faster (100ms). The rate of new data being written in the is about 300ms.
I also saved the last values and attached the vi.
07-28-2016 09:36 AM - edited 07-28-2016 09:38 AM
Two things you can try:
1. Sledge Hammer: Catch the timeout error and try to send the request again...
2. Set the device to automaticly send the data at a specific rate and just read the data.
I implemented both ....
PS: The documentation of the unit for the RS232 is quite poor ....
Ask the guys if there are more commands ... (for example turn on/off autologging, set updaterate)
And how the checksum at the end of each line is calculated 😉
Best is the smile in the protocoll 🙂 OMG
At what rate do you need to log the data? Maybe the internal update rate and PC readings need to match??
EDIT: Sorry crossrulz, mixed up the avatars... (new layout?? 😄 :D)
07-28-2016 10:35 AM
Hi Henrik,
once again many thanks for the updated vi.
But it still does not work. It works fine for some time, but then the already known errors occur more frequently at at some point the reading stops.
The buffer looks something like this in the end (see attached screenshot).
The funny thing is that the program recovers after some time on its own, but the errors occur than more frequently when it starts updating again.
I wrote an email to the company requesting further information. But ... they were not especially helpful up to now. In the beginning it seemed really easy to solve this, but it turned out to be really difficult.
A readout frequency of 1/s is fine for my application.
When I run the program the company supplies the device with, I very roughly counted the update rate and it is in the range of 0.4seconds. The program also has a window where the raw output (the one that I also get) is shown. This window updates the values in ca. 0.3-0.4second steps. Every few seconds the lines disappear completely and are updated again. It's difficult to describe, and the interval this occurs varies in the range of 3-11 seconds. ...