02-20-2018 02:25 PM
Part of a program has to read a set of scales using serial coms and when first run it is fine. However if the program is stopped (controlled shut down) and then re-started it sometimes can no longer access the serial port and if the program is stopped message pops up to say that serial com port not available. The only way to get it released it is to close Labview down and then open it up again. I know this is an issue if the serial port is not closed down correctly but thought that I had taken care of it with 'Visa Close'. Could it be that the instrument is not allowing the port to close?? any thoughts would be appreciated,
02-21-2018 06:09 AM
What does the rest of the program look like? Is anything using the Stop LabVIEW function or closing the front panel? Either of those could shut down the program before the serial port actually gets closed out.
02-21-2018 09:07 AM
These MTT- VIs are not well designed. If either of them are called with an error, they return with an empty VISA indicator, with this the "VISA Close" doesn't close the expected port.
You could place a probe on the VISA- wire before the "VISA Close"- node, then you should see if there is passed the right VISA reference.
02-21-2018 12:16 PM
There are 2 other loops, one that handels the DAQ IO and the other the program operation which is created around state design using case statements. When operator logs out all 3 loops are still running but files closed and DAQ IO in idle but not closed. At the moment because the program is in development its not an executable so when EXIT button is pressed, captured in an event structure, variables then close the 3 loops and the program just stops running.
02-21-2018 12:19 PM
Thanks Dave, I will give that a try tomorrow and post outcome,
Jack
02-21-2018 02:22 PM
Does not seemed to have been asked or mentioned...
Have you tried a different comm port?
Have you tied a different comm port from a different manufacture?
I have seen some miserable comm port devices that work once but required a reboot to use them again.
Ben
02-21-2018 05:15 PM
Thanks Ben,
I have been using 2 different computers for the development.
First runs Windows 7 and has the failure on occasions.
The second has our PXI rack on it so tends to be used for hardware interfacing final test and runs windows XP.
Off topic but reason for this is a lot of our software with customers are being run on windows XP Pro PC's which are up to 10 years old, so I know not ideal, but there we are............
On this PC I have found the problem much worse and re-occurs almost every time the program is re-started.
Our final build for client will have Win 7 Pro (at their request) and an executable so it will shut down etc, but being honest I have done quite a lot on interfacing with serial over the last few years and not seen this problem (only in the early days!) so wonder if this issue is in the MTT vi's being used as Dave TW suggests.
When I used the MTT (Mettlair Toledo) Vi's I had a probelm with a few of them so wrote my own, which were basic but got the process to work, after a fashion........
Jack