06-10-2021 08:51 AM
I'm relatively new to NI's PXIe boxes and the NI-6562 card, so I may be making a newbie mistake.
I'm using the niHSDIO_WriteNamedWaveformWDT command to generate a dynamic signal with an NI-6562 card. (Note: I'm using C#.)
While experimenting with things, I've discovered that the command's samplePerChannel / samplesToWrite parameter apparently must be an integer multiple of 4. (i.e. 4, 8, 12,...) If I use anything other than an integer multiple of 4, I get an error similar to the following (In the interest of space, I've omitted the source and the stack trace):
"System.Runtime.InteropServices.ExternalException
HResult=0xBFFA4A6F
Message=Requested waveform length is invalid, because the number of samples is not an integer multiple of the waveform length increment.
Requested Value: 6
Waveform Length Increment: 4
Status Code: -200400
NationalInstruments.ModularInstruments.Interop.niHSDIO.WriteNamedWaveformWDT(String Waveform_Name, Int32 Samples_To_Write, Int32 Data_Layout, Byte[] Data) in "
I don't see anything in the documentation indicating that I had to use an integer multiple of 4 for the samplePerChannel. Also, when I was experimenting with an NI-6556 card, that didn't appear to be the case. For example, with the 6556 card, I could use a samplePerChannel value of 3.
Did I miss something in the documentation? Could there be something in my code that's forcing the "samplePerChannel = integer multiple of 4" requirement?
I've attached my code to this post.
Solved! Go to Solution.
06-10-2021 10:46 AM
Yes, it is HW requirement defined in the spec sheet pg.17
06-10-2021 12:01 PM
Thanks! I obviously missed that.