8. speed optimization -ag真人试玩网址
by speed optimization in relation to remote-control application, we mean performing a measurement task as fast as possible, but still with reliable and repeatable results.
visa trace tools mentioned in chapter 3 - visa and visa tools can help you to point to operations taking big amounts of time. their logs contain timestamps which you can use to calculate measurement task durations.
when starting with speed optimization, always consider your application overhead in relation to the measurement duration. if, for example, an oscilloscope acquisition time is 2ms, reducing your overall overhead from 5ms to 3ms results to approximately 30% speed increase. however, if the acquisition time is 2 seconds, the same overhead reduction leads to only a 0.1% speed increase.
hints on how to improve the speed of your measurement task:
- never sacrifice proper measurement synchronization for speed. at the end it costs you more time to debug problems and repeat measurements, than do it properly the first time.
- if you have more than one measurement instruments in your test setup, try to parallelize tasks. for example, you can set up signal generator and oscilloscope in parallel and only synchronize them before an acquisition.
- do not perform instrument error checking in loops with many repetitions and short acquisition times (less than 10ms). if you use the instrument drivers, switch the error checking off before the loop and switch it back on after the loop.
- switch the instrument’s display off after you have debugged your application. this usually improves the instrument's performance.
- try to avoid reading entire traces or waveforms. rohde & schwarz instruments offer many trace / waveform evaluation possibilities. you do not need every point of an oscilloscope waveform to evaluate frequency, amplitude or pulse rise time. the instrument provides ready-to-use measurements for such parameters.
- use the instruments averaging or maxhold functions for traces and waveforms instead of performing these operations in your application. this saves data transfer time and the measurement triggering overhead.
- use limit lines and mask functions for the cases when you only need to evaluate simple pass/fail criteria. transferring the entire trace and evaluating it in your application is unnecessary.
- rohde & schwarz instruments are capable of parallel command processing. always set the parameter that takes the maximum time first. if for example, you set the spectrum analyzer manual attenuator first, then the center frequency and then resolution bandwidth, it is faster than setting them in the reversed order.
- combine several scpi commands (separated by semicolons) into one string to send to the instrument; it is faster than sending them separately. in addition, it lets the instrument decide the most optimal order of executing the commands. an example of already mentioned three parameters of a spectrum analyzer – mechanical attenuator, center frequency, resolution bandwidth settings: inp:att 50;:freq:cent 2ghz;:bwidth 5mhz