05-03-2016 05:53 AM
First of all, sorry for my bad english. I Asked for help in my main Comunity but nobody help me.
I have an error that i don't know why it happens. I have a sub VI that I founded here some time ago (Sorry, I dont remember who was the original creator). Its a simple VI that search for all COM ports and instruments conected to any serial port in the PC, and allow it to the user to choose one and save it like VISA resource name. I modify it a little bit, to found and choose automaticaly the instrument with "Barcode Scanner" name.
The first program works well, when I modify it there wasn't any error, but when I build the Main Program and I install the executable in any other PC pop outs the Error.
The most strange thing of all, its that the SUB VI works fine. It detect the COM port where the Bar Code Scanner it's conected. But in the next execution, when I try to conect with the VISA OPEN block sometimes pop outs another error. This happens even with the Original Sub Vi so it´s not problem of my modification.
This only happens in the Executable, in the PC where I program and I work with LabView everything works fine.
Y upload the Sub V.
Thank for everyone.
05-07-2016 09:25 AM
Hello,
I'd firstly like to clarify by your description that the executable on the second PC runs successfully once but not subsequent executions?
If this is not the case then my first inclination would be that the second PC does not have NI-VISA or NI-Serial installed (links provided below):
1. http://www.ni.com/download/ni-visa-15.0.1/5693/en/
2. http://www.ni.com/download/ni-serial-15.0/5573/en/
Additionally I would recommend, when deploying applications to other machines, to achieve this by creating an installer instead with automatically select additional installers enabled. This will resolve any dependancy problems when deploying to other machines. I have included a document below which outlines how to achieve this:
http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/build_installer/
Finally, if these are Serial ports, I would recommend to instead of using the VISA Open function, use the VISA Configure Serial Port found in the VISA Palette -> Advanced -> Bus-Specific -> Serial.
05-07-2016 10:17 AM
05-09-2016 05:49 AM
edjones93 escribió:Hello,
I'd firstly like to clarify by your description that the executable on the second PC runs successfully once but not subsequent executions?
If this is not the case then my first inclination would be that the second PC does not have NI-VISA or NI-Serial installed (links provided below):
1. http://www.ni.com/download/ni-visa-15.0.1/5693/en/
2. http://www.ni.com/download/ni-serial-15.0/5573/en/
Additionally I would recommend, when deploying applications to other machines, to achieve this by creating an installer instead with automatically select additional installers enabled. This will resolve any dependancy problems when deploying to other machines. I have included a document below which outlines how to achieve this:
http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/build_installer/
Finally, if these are Serial ports, I would recommend to instead of using the VISA Open function, use the VISA Configure Serial Port found in the VISA Palette -> Advanced -> Bus-Specific -> Serial.
Hi.
Thanks ror the Help.
About your first cuestion. The Executable runs perfect in the Programing Enviroment of Labview and as Independent Executable un the programing PC. But when I install the Executable and Run it is when the error happens. Tha happens in every execution.
The Sub VI only works once per execution, when it finds the COM port, it sets as Visa Resource name in the Main Program. In next fases of the code I only use the Visa Resource name.
I chek before if it could be Drivers problem, The NI-VISA looks weel but there isn't any NI-Serial Driver installed neither in the Programing PC or the Secondary PC. I think that if it is NI-Serial Problem it would happens in both PCs.
Maybe I wrong, i don't know.
Again, sorry for my bad English.
05-09-2016 06:03 AM
mikeporter escribió:
That error means exactly what they error message says. You have a good resource identified but Windows won't let you use it right then. The most common place I get the error is if I am testing a serial program in the development environment and the test an executable I just built without shutting down the development environment. If I quit LabVIEW and run the same executable again, all it well.
Based on your description, my suspicion is that you are trying to reopen the serial port multiple times. The second attempt at opening will also give this message.
Mike...
If Windows dont let me using the resource what is aboiding me to use it? Because I don't have labview instaled in the second PC and I run the program without any other program runing at the same moment.
05-09-2016 06:14 AM
@Ekama wrote:The Sub VI only works once per execution, when it finds the COM port, it sets as Visa Resource name in the Main Program. In next fases of the code I only use the Visa Resource name.
Are you closing the port when you are done with it?
05-11-2016 01:16 AM - edited 05-11-2016 01:18 AM
crossrulz escribió:Are you closing the port when you are done with it?
Yep!
Moreover, The First Time y sow the error I put a Visa Close before the VISA configuration Port. Nothing Changed 😞
I put the Program Secuence. (The "Note" are in spanish, they explain very simply what is doing the program)