06-15-2010 11:11 AM
Hi!
So attached are the codes I had for retrieving data from a network analyzer. I wanted to divide the sweep range into 800 subintervals, to run several times on each sub, and to generate an averaged data point for that subinterval. Now it takes me 30s to run once on each subinterval, so in total that's gonna take me over 20hours, which is way too much... I am just wondering if there's a way to drastically reduce the total run time to, say 1h? Thanks!
06-15-2010 11:15 AM
06-15-2010 11:42 AM
First, get rid of all the timed structures. I don't know what you think they do but at best, all they will actually do is report that they are running late. If a GPIB Write takes x number of msec, then that is how long it will take. The timed structures are just adding overhead. Use the error in/error connections to enforce dataflow and use the VISA functions instead of the low level GPIB. Make sure to add error in/error out connections to your subVIs. Move the file write out of the loop and use a producer/consumer architecture.
Finally, as I hinted, the GPIB communication speed is dependent on how many bytes you read and write. The instrument itself may not be capable of high speed communication. GPIB itself is not really designed for high speed communication.
I'll also mention that changing the timeout points to a fault in your code. You really aren't tracking errors, but if you did and got timeout errors, then you need to fix that. You are perhaps not sending a correct command, the instrument is not sending the correct termination, whatever.