02-27-2020 05:58 PM
I am currently using a system that has a PXI-6220 card to be used for digital output. I cannot use LabView for this application, I need to do everything in C. I am already using the DaqMX C library to configure the channels to write to. (I have everything working as desired for Port0 and Port1, it's port2 that I'm having issues with)
I have a digital waveform I need to write out on Dev1/port2/line1 (which is pin PFI-9). I need to write out the waveform on PFI-9 at the same frequency of a clock signal that I already write out on PFI-8 at 2Mhz. (I need to use these specific lines because all other lines are used up for something else on this card, and everything is already wired up for this configuration).
The problem is, PFI lines do not support buffered operations, so I cannot simply use DAQmxCfgSampClkTiming on the channel and write it out with a buffer.
I know this can be done in LabView using the SPI Digital Waveform Reference Library by generating an SPI waveform and writing out on PFI-9 at the frequency of 2Mhz. I've even seen it done in LabView and seen it work with this PXI-6220 card, so I know the functionality that I'm going for is possible with this card. But is it possible without LabView? (Unfortunately I can't just swap the wires on Port2 with Port0 which does support buffered operations, since the system is already configured to do it with port 2 and I'm not in a position where I can change that.)
Ultimately, my question is whether or not there exists a counter-part to the SPI Digital Waveform Reference Library but with C function calls rather than LabView. Similar to the DaqMX library that has support in LabView or in C. If so, could someone point me in the direction of that library? I haven't been able to find it anywhere on here. If it doesn't exist, I'm not positive on how to accomplish my goal, which is to write out an 8-bit waveform on PFI-9 synced to the clock I already output on line PFI-8. Can it be done without LabView?
03-10-2020 07:39 AM
Hello,
I don't know this particular card, but I've worked with digital outputs using external sync signals/timers on various other cards and I don't see why you can't use a buffered output. Have you tried ?
03-10-2020 07:52 AM
Hi, thanks for your response.
Yes I have tried, I get the error: Error -201062 Selected Lines Do Not Support Buffered Operations.
This is because the lines I have available to use are all PFI lines, which only support routing clock signals, or static digital IO.
I was hoping there would be an SPI library in C to use with the DaqMX library to output an SPI waveform on a PFI line, like how it is possible in LabView with this card.