From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-25-2013 09:40 AM - edited 09-25-2013 09:42 AM
Hello NI community,
While developing my LabVIEW application I encounter the following problem:
If I call the VISA Close I occasionally have the problem that the call won't return. Below are screenshots from NI-IO Trace.
As visible on the 2nd screenshot the "output" tab is missing. Also a start time is filled-in but the finish and call duration are missing (as in the 3rd image)
The hardware setup is a FTDI FT232RL connected via USB. From this a board based on a RS485 is connected.
The drivers of the FTDI chip are version 2.8.30.0 (latest VCP drivers on FTDI web-site and Microsoft update)
Edit:
As long as the VISA close won't return my program hangs so it is not possible to quit in any orderly fashion (except for a reboot)
Do you have any suggestions where I can start debugging this problem?
09-25-2013 09:55 AM
You need to post screenshots that are readable. Trying attaching the full size images to the message as attachments.
09-26-2013 01:02 AM
I guess a stupid mistake
The pictures are uploaded on full resolution and in my album here on the NI forums. The direct links:
@NI moderators/administrators Is there a way that you can make the pictures clickable so that once you click on them you'll get a pop-up with the full-size image?
09-26-2013 03:12 AM
Your VISA read calls return a status indicating that there might still be characters left in the transfer buffer.
Are you sure that the buffer doesnt encounter an overflow?
I understand that this hang does not occur every time. Correct?
What makes situations where the hang occurs "unique" (e.g. long duration of communication, large amount of command/data transfer, ...)
What happens during the hang if you unplug the USB cable?
Does VISA report a correct error if you unplug the cable during a "normal" communication?
Norbert
09-26-2013 04:36 AM - edited 09-26-2013 04:37 AM
It's correct that the Labview *thinks* that there are characters left in the buffer. I ask for 16 and I get 16. So since there is no timeout and I don't check if there are *only* 16 characters in the buffer I get this warning. (my read code)
It is correct that the hang doesn't occur every time. It was (I'll get back to that) about every 3/4 closures. After that a reboot is required.
So there is nothing unique to it.
If I unplug the cable nothing happens (no change, the hang remains)
A unplug during normal communication I just tested and below are the results:
So all seems normal.
However I have to admit that there were some changes to my set-up.
Since I didn't have this problem before I decided to uninstall all virtual com port drivers and also remove their presence in the system.
After this no hangs happened *so far*.
If it's useful I can do a write of my process (the only question is where?)
09-26-2013 02:44 PM
"If it's useful I can do a write of my process (the only question is where?)" Here would be as good as anywhere. These threads are most useful to others when the solution is identified and described.
Thanks, in advance.
09-26-2013 03:56 PM
Without seeing code, I would hazard a guess that the I/O isn't properly implemented.
09-26-2013 10:21 PM
Before reading and after writing flush the buffer. Try one more thing, Instead of using 16 byte use property node of no of byte available. use some timeout also because by default it is 10sec. hence it will be waiting although it shouldn't. Bit of strange
09-26-2013 10:23 PM
See this also
09-27-2013 02:30 AM
So here is my write-up of the fix I used (it worked so far).
Note:
!!!These actions might damage your system, may break your computer or do other unwanted stuff. You are responsible for the result (nor me nor NI)!!!
Note 2:
This will remove the drivers so make sure you have a copy of them before proceeding.
With that out the way here are the instructions for windows 7 (vista and 8 should look the same, XP might be a bit different), the OS language is Dutch but the locations of the buttons is the same:
Part of these of the instructions are from this document
1st add the option to show all disconnected devices by opening the system Environment Variables:
right mouse button on "my computer" and select properties.
In the system property select "Advanced system settings"
If requested accept the UAC prompt.
Select the advanced tab, Select the Environment Variables.
In the Environment Variables window select the lower New button
Add the variable "DevMgr_Show_NonPresent_Devices" (without quotes) and a value of 1.
Ok all dialogs and open the device manager.
In the device manager select view and select "Show Hidden Devices"
The list will now get extra long since all devices that where ever connected to your computer will show up.
For the next step disconnect all (USB) serial ports from your computer.
All serial ports that where connected will now show up under "Ports (COM & LPT)" and under "Universal Serial Bus Controllers"
For every "USB Serial Port (COMxx)" port and "USB Serial Converter" that is semi-transparent (disconnected) do the following steps:
Right-mouse button on the port or converter and select property's
The general tab should give a code 45 that the device is not connected.
Select the "Driver" tab next and select "Remove"
In the confirmation dialog select the checkbox (if present) and select "OK"
Once this is done for all "USB Serial Port (COMxx)" ports and "USB Serial Converter" devices you should be good.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Optional part
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Download the FTClean tool from here: http://www.ftdichip.com/Resources/Utilities/FTClean.zip
unzip and run the tool (as administrator) more information can be found here.
http://www.ftdichip.com/Support/Knowledgebase/index.html?ftcleanutility.htm
Download the latest VCP driver from the FTDI web-site and install it. (although windows update should take care of this)
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Optional part end
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Plug-in a USB serial converter and if everything went well you should be greeted with a "found new hardware" dialog and drivers should install automatically. (or you can re-install them manually)
This fixed the problem for me anyway.