04-26-2007 03:52 PM
04-26-2007 04:09 PM
04-27-2007 03:38 AM
Is there any unnecassary large time-delay (wait ms) primitive inside the while loop ?
Check for this. Post the code to shed more light on it.
04-27-2007 07:13 AM
04-27-2007 07:46 AM
The build array + writing to file using Write to Spreadsheet aren't very efficient to have inside a loop like that. Write to Spreadsheet file opens, writes, and closes the file every time it is used. It would be a better idea to create the array and write it to file outside the loop, or buffer the data and write it every once in a while if you are running this for an extended period of time.
If you know how long this will be run, I suggest initializing a 2D array before the loop with 3 columns and as many rows as necessary to hold your data. Then each time you read, use replace array subset to replace a row of the array. This will be more efficient.
If the program will run for an indeterminant amount of time, create the array to use as a buffer. Whenever it fills up, write the contents to the file and start over at the beginning. If you're going to do this, it will be even faster to open the file before the loop, write inside it, and close the file after it.
04-27-2007 11:21 AM
04-27-2007 02:51 PM
It would be thankful, if you could give me a rough layout of your suggestion:
low-level file functions.
Open the file on the left outside the loop, then append your data with simple writes inside the loop while keeping the file open. Once the loop has finished, you would close the file on the right, again outside the loop.
(1) If you want to write to a ASCII table (spreadsheet), you would do the formatting manually using "array to spreadsheet string" and just append the string to the end of the file at each iteration.
Yes, it is expected to always contain two data, one is time, and the other is what yields from VISA write in each iteration.
Is the array always the same size?