LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I program a 32-bit DAQ transfer in CVI?

There is a library of DAQ functions in CVI to facilitate digital transfers. The library includes functions that allow grouping of the DAQ ports, so that data can be exchanged in bytes and words. The function DIG_Grp_Config is able to group all 4 ports of the DAQ, which should result in 32-bit transfers. However, all the other transfers functions (namely DIG_Out_Grp, DIG_In_Grp, DIG_Block_In and DIG_Block_Out) only accept pattern or buffers of type short, which is only 16-bits. Is any C function or routine available such that I can effectivelly achieve 32-bits of data in a single transfer?
0 Kudos
Message 1 of 4
(3,027 Views)
Howdy,

The best sources of information on these functions are the NI-DAQ User Manual (included in pdf form as part of the NI-DAQ install) and the NI-DAQ Help (included as a Windows online help file as part of the NI-DAQ install).

The NI-DAQ User Manual gives call chains for the proper functions used for a given task, and the Help file gives details for each of the functions and its parameters.

Now, in the NI-DAQ Help for DIG_Grp_Config, it states that "[o]nly the DIG_Block calls can use a group of size 4." So, for single read/update calls using DIG_In/Out_Grp, you'll have to use two operations to 16-bit ports.

For block operations, the way in which the data will be passed is described in the help for the DIG_Block_In/Out. Basically, the four bytes are stored in t
wo elements of an array of 2-byte integers. The documentation provides explanation and examples.

Josh Martin
0 Kudos
Message 2 of 4
(3,027 Views)
I appreciate your comment. The problem is that the block functions will not compile with a buffer type long integer (32-bits), but only with type short (16-bit). Unless I am mistaken about the type size, it is really impossible to use the 32-bit functionality on a single block command. The prototype for the block output function is as follows:

short DIG_Block_Out (short Board, short Group_Number,
short Buffer[],
unsigned long Number_of_Points);
0 Kudos
Message 3 of 4
(3,027 Views)
As Josh said, for 32-bit transfers the data is STILL stored in the short[] format, but now 32-bit value is stored in the first 2 short values. So short buf[0] and buf[1] make up the first 32-bit read buffer. This is all in the NI-DAQ User Manual.

Best Regards,

Chris Matthews
Measurement Studio Support Manager
0 Kudos
Message 4 of 4
(3,027 Views)