12-02-2015 04:25 PM
Hi all,
Currently working with LV2011 and NI visa 2014. In my application i have 7 serial ports open of which 4 i am writing to devices over, 3 are simply listening. Now i write to 4 of these devices, alternating between them, the second time i try to write to a device, the write isnt received, but when i exit the application and close the port, the message is recieved. I have seen this on 2 similar devices and it is a bit random. Its possible this is an issue of the device, but when using tera term i dont see this issue. Has anyone ever seen this before?
I can post code, but its a larger application and i am using the AMC add on.
Thank you,
Matt
Solved! Go to Solution.
12-02-2015 07:08 PM
Are you using native serial ports or USB-to-serial adapters? The USB adapters often behave badly with LabVIEW in certain circumstances.
While it may be a bit of a workaround, is it possible you can close the reference in LabVIEW right after the visa write to "force" the message across, then re-open the serial port reference again?
12-02-2015 07:18 PM
@Kyle97330 wrote:
Are you using native serial ports or USB-to-serial adapters? The USB adapters often behave badly with LabVIEW in certain circumstances.
While it may be a bit of a workaround, is it possible you can close the reference in LabVIEW right after the visa write to "force" the message across, then re-open the serial port reference again?
Hi kyle,
Youre absolutely correct, im using FTDI USB to RS232 converters and im using the FTDI chipset because ive had terrible experience with other converters and labview, but i havent seen a problem in labview with these converters and i have used them often. But i did take the brute force method and i close and reopen the port every time, seems to be working for now. The software on the device seems a bit shaky.
Thank you,
Matt
12-03-2015 06:54 AM
The FTDI-based USB to Serial converters are usually pretty good (beware that there are some imitation/fake chips out there). Having 7 of them on the same computer might be causing some USB conflicts or something like that.
Have you tried changing the I/O buffer size and/or tried using the Flush Buffer functions in the Serial palette? There is an option there for flushing the transmit buffer manually and you can also manually set the serial port buffer size.
12-03-2015 09:55 AM
Closing and re-opening VISA sessions constantly is a band-aid at best, bad form, and can cause memory leaks.
Post your code and I bet a proper solution could be found.
12-03-2015 12:52 PM
With seven devices are you certain that you are not having a power problem?
Lynn
12-03-2015 12:58 PM
@johnsold wrote:
With seven devices are you certain that you are not having a power problem?
Lynn
I am not entirely sure im not having a power problem, i dont know how to determine that i am. I orginally had them connected to the native USB's on the computer, but then moved them to a USB hub with external power and saw better results, but not good enough. I had 6 connected to a laptop at one point, i adjusted the power settings there for the USB's, ran it for weeks and never saw a problem. All that said I have a PXI 1042 chassis with a PXI 8430/16 that im hooking up right now. Its a rack mount and i had to move it into another lab, but nobetter time to do it than right now.
If this doesnt fix it then im blaming the device.
Matt
12-03-2015 01:22 PM - edited 12-03-2015 01:23 PM
Check that the combined current of the devices does not exceed the current rating of the USB hub with power supply.
Edit: I mean the current rating of the USB hub, not the current rating of the power supply.
12-04-2015 03:48 AM
While USB hubs are good for providing more power, they are not good for the reliability of the connection as you'd have all 7 devices essentially multiplexing through a single USB port for communications which could cause issues. The best solution would be to use a PCI or PCIe card with 8 serial ports, then either using a single usb to 8 serial port box or adding more USB ports via PCI/PCIe.
Did you try my suggestion about flushing the transmit buffer?
12-04-2015 10:44 AM
@billko wrote:
Check that the combined current of the devices does not exceed the current rating of the USB hub with power supply.
Edit: I mean the current rating of the USB hub, not the current rating of the power supply.
Hi Bill,
I actually cant find the power ratings for the hub, its a rosewill RHUB-500, some off the shelf thing I thought might work better than the native ports. I would agree it could definitely be either power issues or enumeration issues with all the adaptors and then the hub. I have an NI chassis with a PXI 8430/16. Im going to charge my devices for a few hours and then give that a try. If the problem is fixed then it is either the adaptors or the hub. I ran a test similar to this with a lot more data transfer going on and 6 USB converters and didnt see an issue for around 3 weeks.