02-24-2009 03:25 PM
Has anyone tried using the WriteNamedWaveformWDT function from the VB6 wrapper provided by NI? I see the following discrepancies.
1. Unable to pass a byte sized array to this function - it will only accept long (32-bits). If a byte sized array is passed, the waveform is not written to the board memory.
2. When the waveform defined in 1 is clocked out, the top three bytes contain '0's and are observable.
3. The definition of a 'tri-state' is NI_DIO_Z = 2 is a 'Long' in the function definition file "hsdio.bas" supplied by NI.
One possible workaround to this might be to pack data into the top three bytes of a 32 bit long and see what happens.
Anand
02-25-2009 06:10 PM
Hey Anand,
Currently we are looking into this issue over here at National Instruments, the individual who is most familiar with this has been out of the office the past few days. We know that a service request is open regarding this issue and we will let you know when we have some more information on this function and how it is used..
02-25-2009 09:30 PM
Hi Jordan,
I believe there is a workaround to the data type bug in the VB6 wrapper supplied by NI. Since only a 32-bit long array is accepted by WriteNamedWaveformWDT, pack the 8-bit samplewise (group by sample) data into the 32-bit long. So if there are four channels CH0, CH1, CH2 & CH3, place the first sample of each in bytes 0, 1, 2, and 3 of the first 32-bit long array element. Do this for all the samples and for all channels. Then just pass it to the WriteNamedWaveformWDT function which is configured to "read by sample" and it send out the data correctly.
I can even assign tri-state values (decimal 2) to the data.
Anyways, let me know if NI comes up with a fix for this so that I can use regular code
02-26-2009 01:27 PM
Thanks for the info Anand, I will keep in contact with the other engineers who are currently working on this to see if we can get a better solution.