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)
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.
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.
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.
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?
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.
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?
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??