LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Poor serial communication speed

I'm programming a unit via serial port which has FLASH on there.I send S-records (1 line at a time) and get back an "ACK" if the programming was o.k. My vi works.
But my vi is aprox. 50% slower, then an other programm? They other program does exactly the same (checked with Portmon). My vi seems to get slower, after running a while.(Total time for programming 6min. @38400)
0 Kudos
Message 1 of 18
(3,257 Views)
What are you doing in your VI? Are you using a lot of local or global variables, string concantanations, building arrays, property nodes, file references? Why don't you post your VI for someone to look at.
0 Kudos
Message 2 of 18
(3,257 Views)
Here is the loop that seems to be extremely slow.
I already took away the hole timecalculation, with no result. The 2 "wait on next mutiple" are for freeing up processorpower. I intend to use as many such vi's as possible, running parallel.
Download All
0 Kudos
Message 3 of 18
(3,257 Views)
You didn't include some important VIs - like the serial reads and writes. Do a Save with Options>Development Distribution and create an llb with all VIs. Do you get an ACK after every line or only after the whole file is sent? You might want to create an array of strings outside the while loop and not use the pick line each and every time. Then your write might be simpler by wiring the array to a for loop with the serial write inside. Also, as far as I can tell, none of your local variables are required. Use shift registers instead.
0 Kudos
Message 4 of 18
(3,257 Views)
Try changing your flow control settings.

Also try setting the windows (If it`s windows you`re using) buffer settings for the serial port lower.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 5 of 18
(3,135 Views)
It seems that my last answer didn't get to the Internet last night. So here are my vi's.
Yes, i get an "ACK" after every line sent succsefully.
Is arrayprocessing faster then multilinestring?
Are shiftregisters faster then local variables?
0 Kudos
Message 6 of 18
(3,257 Views)
The problem with local variables (especially strings) is that a new copy of the contents is made each time the local is read and this can cause significant slowdowns. You've also used a DBL data type for the serial port number. The functions actually use an I32 so a type coercion occurs every time and again, a copy of the data is made. You could try replacing the old serial functions with VISA calls. NI supports only VISA now and if you plan on upgrading to LV 7 at any time, you'll find that serpdrv is no longer included.
0 Kudos
Message 7 of 18
(3,257 Views)
The problem with local variables/strings sounds logical to me. I will try it. I will also correct the type coercion in serial port number. I already tried to replace the "old" seriel vis with "VISA"-> no change in performance. Will the other 2 corrections really powerup my vi?
0 Kudos
Message 8 of 18
(3,257 Views)
I've played around with buffer-settings, with no result in performance.
0 Kudos
Message 9 of 18
(3,135 Views)
O.k., i read the file in to an array, and then picked the lines out of the array and sent them via serial port. this procedure lastet longer then reading out of multilinestring??
0 Kudos
Message 10 of 18
(3,257 Views)