LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with serial transmission speed when using 4 ports at the same time

I'm trying to download software to 4 independent devices with labview 5.1. I've writen a vi that does the hole progamming for one device, and copied it with different comportnumbers. If i run one vi, i get a program duration of 5:20min. Running 2 vi's results in about 7:00min.Running 4 vi's result in about 13:00min. Why don't i get the same time for programming 4 at a time?
0 Kudos
Message 1 of 2
(2,516 Views)
You probably have software bottlenecks and hardware bottlenecks. Your main bottlenecks are probably in software, which, to an extent, are easier to fix.
You have software bottlenecks because LabView, by default, keeps only one copy of a VI in memory. Any number of VIs may call a subVI, but each call needs to wait until the previous call is complete. You made copies of your higher level VI, but each copy is trying to call the same lower level VIs (e.g. Easy VISA Write.vi or Serial Port Write.vi), so they need to wait for each other. However, if you make the subVIs reentrant, each call gets a new copy in memory which doesn't need to wait for other calls to be complete. Review LabView help topics for rentrant VIs.
You need to be careful making communication VIs reentrant: you can easily get into trouble with two pieces of code trying to access the same hardware if your code doesn't control the order of the access. In your case, you're a little safer because you could use the reentrant subVIs to access different ports, not the same port. But if your code doesn't have good control over accessing any one port, your send or receive junk data.
To make LabView VIs reentrant in LabView 6.1, from the VI window, goto File >> VI Properties >> Category >> Execution >> Reentrant Execution. In older versions of LabView, maybe you need to right-click on the VI's Icon on the VI's front panel and select VI Setup (or something like that).
You have hardware bottlenecks on the PC bus and on your multi-port serial card. At the I/O side, you have four separate ports. But on the PC Bus side, you only have one path to the card. The Bus speed is much higher than your serial communication speed, so the bus may often be idle waiting for the card to be ready with or for more data. So the bus bottleneck usually isn't a big factor in communication functions. There are additional hardware bottlenecks on a multi-port I/O card: all ports may share some common bus-side hardware before the data is routed to separate ports. Again, the speed of this hardware is typically much faster than the communication speeds.
If you need to reduce your hardware bottlenecks, you may need to look for an I/O card with a large independent FIFO for each port.
Message 2 of 2
(2,516 Views)