09-28-2005 11:17 AM
Valid Values: Vary by device.
NI 654X | 1, 2, 4 |
NI 655X | 1, 2, 4 |
NI 656X | 1, 2 |
Solved! Go to Solution.
09-29-2005 07:49 AM
Hello emvee. The data width attribute is mainly an aquisition attribute - you can call "set attribute" and change it's value only when performing acquisition. You can still perform a "get" to see what the driver's default value is for generation sessions; for a 32-channel device, data width is 4, and all waveforms written to onboard memory will contain 32-bit samples. If your channel list is 0-15 then only the first 16 bits of each sample are generated.
As for the example returning 4 bytes even though there are only 16 channels, you'll see this behavior in acquisition as well. The driver does not automatically adapt data width based on what channels are selected. The fetch and write functions are closely tied to data width (if data width is 4 bytes, you MUST use a U32 flavor of fetch or write)... thus the driver doesn't try to guess what fetch/write you'll be using by changing data width based on the user's channel selection. However, a 16-channel device (such as the 656x) will default to a data width of 2. A 32-channel device (such as the 654x) will default to a data width of 4. Since most of the NI-HSDIO examples can run on multiple devices, they all call "get" on the data width attribute to determine which fetch/write function to use.
I hope this helps.
Chris
09-29-2005 08:03 AM