Continuous Software Timed Analog Output for the USB-6008 and USB-6009

程式碼與文件

附件

This program demonstrates how to perform continuous analog output tasks on the USB-6008 / 6009 and also incorporates the theory of operation that is associated with software timed analog output. Continuous software timed analog output means that your analog channel will update only once for every iteration of the program's while loop. It is important to remember that these devices allow a maximum update rate of 150 samples per second on each channel; therefore the main program's while loop can iterate no faster than once every 6 ms.

It is also important to remember that these devices allow an output voltage range of 0 to 5 Volts. For demonstration purposes, this program outputs a sine wave with a DC offset of 2.5V and allows the user to select the number of points per cycle. It will be observed that increasing the points per cycle will increase the resolution of the output waveform, but also decreases its frequency. The approximate period of the output waveform is equal to the points per cycle times the output rate.

NI 社群中,來自 Example Code Exchange 的範例程式碼已含 MIT 授權

貢獻者