06-18-2015 07:11 PM
I am using a vi from the community (http://forums.ni.com/t5/LabVIEW/Driver-for-Omega-UTC-USB/td-p/2360528) to read/write to an Omega USB thermocouple reader. This uses the VISA write, VISA read functions. I have it set up to read a thermocouple once per second and then adjust the output power of a heater based on the reading. It runs for a set period of time as part of a PID loop, then stops, and my experiment carries on. It also logs the temperatuer and output power at each step.
I have had a problem occur several times now that is extremely problematic. The vi above will just freeze at the VISA write function, causing the parent vi to freeze as well. I have to kill Labview in order to fix the problem. I then lose the heating record as well, since this was being written by the parent vi. I could change it so that it writes the file continuously, but this is really just there for error checking. The larger problem is that the PID loop stops running, so I lose control of the temperature, and it does not stop at the end of the allotted time. There is no error and the parents are all frozen, so there is no way to check that this has happened and even stop the heating. If I call the vi as a reference, the caller simply waits as there is no error message and for some reason VISA never times out.
I can open the Omega software for reading these devices and see that the device is working fine, during or after the freeze.
The only similar problems I see in the archives seem to have been solved by a software update years ago (this computer has seen only LV 2012 and 2013), or by replacing the serial hardware. In my case, the only hardware is the USB thermocouple reader, so I have to throw out all this equipment to change anyway. Is my only option to switch to NI thermocouple readers? We use mostly Omega for temperature control, so I would rather not have to do that.
Is there any way that I can at least force VISA to timeout and give me an error so that I don't have a runaway heating? I'll still lose the sample, but at least it will be less dangerous for the hardware.
Hardware/Software involved: Dell XPS 8700, Labview 2013, Windows 8.1, Omega UTC-USB
06-18-2015 07:21 PM
It looks like you use a VISA Configure Serial Port VI in that VI you linked to. This has a default timeout of 10 seconds. You're saying it stays frozen for longer than that, though?
Also, that is not the right way to read and write from the serial port. It is opening the connection, reading or writing, and then closing again every single time. If you can, you want to maintain a connection to the port and just use the Read or Write VIs when needed.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-18-2015 07:24 PM
06-18-2015 07:25 PM
Yes, it freezes for at least half an hour. I assume it is permanently frozen, but I haven't let it sit longer than that. The read function normally takes less than 100 ms.
That's a good point about reopening the VISA connection. I will change the code so that it doesn' t do that anymore.
06-18-2015 07:27 PM
I haven't talked to Omega. I will try, but I imagine they'll tell me that it's a Labview problem. Unplugging the USB device doesn't do anything--I can even open the Omega software while Labview is frozen, unplug the device, then plug it back in and observe that it continues working. I didn't think to look at it in device manager (this problem happens every couple weeks, so it's very difficult to replicate), but since it shows up in the Omega software, I assume it would also be visible there.
06-18-2015 07:28 PM - edited 06-18-2015 07:28 PM
Yeah if it hangs that long, it has to be some sort of communication issue. Though, it is weird LabVIEW doesn't time out. Is your Write string really long or something, or have a weird character in it?
Try opening the VISA connection only once and just closing it at the end and maybe that will fix the problem.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-18-2015 07:30 PM
Write string is just "C\r" and the read string is up to six characters, temperature plus termination characters. I will fix the connection opening issue and, since the problem is so infrequent, probably forget to post about it here. So for future readers: if I haven't posted anything else, that fixed the problem.
06-18-2015 07:37 PM
Hehe alright good luck.
I found another forum topic here with the same problem and they marked the solution as separating the open and closing of the VISA serial comms from the loop.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-18-2015 08:09 PM
In case it helps anyone else, here is a new set of three sub-vis that open, read, and close the connection for use as part of loops, and also a vi that combines all of them for standalone use.