1 /* Humusoft data acquisition library.
\r
3 * Example that shows writing to analog output channels
\r
4 * using the function to write multiple channels together.
\r
7 /* Copyright 2002-2006 Humusoft s.r.o. */
\r
11 #include "hudaqlib.h"
\r
14 int main(int argc, char* argv[])
\r
17 /* Buffer for channel numbers. Order of channels is not signifficant.
\r
18 Duplicated channels are also supported. */
\r
19 unsigned channels[8] = {4,5,6,7,0,1,2,3};
\r
20 /* Buffer that contains values to be written.
\r
21 Is size must correspond to buffer of channels. */
\r
22 double values[8] = {5.0, 6.0, 7.0, 8.0, 1.0, 2.0, 3.0, 4.0};
\r
24 /* Open a handle to the first MF624 device in the system. */
\r
25 h = HudaqOpenDevice("MF624", 1, 0);
\r
28 printf("\nData acquisition device not found.\n");
\r
32 /* Write all the 8 analog outputs in one call. */
\r
33 if(HudaqAOWriteMultiple(h, 8, channels, values)==HUDAQSUCCESS)
\r
35 printf("\nData has been written.\n");
\r
38 /* Close the device handle. */
\r
39 HudaqCloseDevice(h);
\r