Discussion:
NI PCIe-6536 Synchronized serial bus
(too old to reply)
yttern
2007-02-19 22:10:13 UTC
Permalink
Hi,
Today I'm using a NI-PCI-6541 for generating the correct serial bus timing (Both generation and acquisition). What I do with the 6541 is to configure the correct output ports (0 to 15) and then download the serial data and handshake bits to the onboard memory. For generation I use the onboard clock to as source clock. I then configure an acquisition memory of the same size set up to use external clock as source (This is the output from the generation session NIHSDIO_VAL_DDC_CLK_OUT_STR connected to NIHSDIO_VAL_PFI2_STR ). I then trigger the board and it sends tree sequences of 16 bits serial clock and handshake bits where the two first 16 bits sequences are commands to the DUT and on the last 16 bit sequence the DUT responds with serial data back to the board memory. I then read out the memory and decodes the last 16 bits in memory.
 
I now bough another high-speed DIO card, the NI PCIe-6536 for the same task. My question is then. Is it possible to both generate data and aquire data at the same time with this card? Sending serial clock to the DUT and at the same time stream the data returning from the DUT to disk ?
 
For the NI 6541 there was an example showing how to do this but for the NI PCIe-6536 there are only examples of either generation sessions or acquisition sessions. I start to suspect that I should have bought a PCI-6541 instead of a PCIe-6536.
 
Thanks
jcarbonell
2007-02-26 14:40:14 UTC
Permalink
yttern wrote:Hi,
Today I'm using a NI-PCI-6541 for generating the correct serial bus timing (Both generation and acquisition). What I do with the 6541 is to configure the correct output ports (0 to 15) and then download the serial data and handshake bits to the onboard memory. For generation I use the onboard clock to as source clock. I then configure an acquisition memory of the same size set up to use external clock as source (This is the output from the generation session NIHSDIO_VAL_DDC_CLK_OUT_STR connected to NIHSDIO_VAL_PFI2_STR ). I then trigger the board and it sends tree sequences of 16 bits serial clock and handshake bits where the two first 16 bits sequences are commands to the DUT and on the last 16 bit sequence the DUT responds with serial data back to the board memory. I then read out the memory and decodes the last 16 bits in memory.
 
I now bough another high-speed DIO card, the NI PCIe-6536 for the same task. My question is then. Is it possible to both generate data and aquire data at the same time with this card? Sending serial clock to the DUT and at the same time stream the data returning from the DUT to disk ?
 
For the NI 6541 there was an example showing how to do this but for the NI PCIe-6536 there are only examples of either generation sessions or acquisition sessions. I start to suspect that I should have bought a PCI-6541 instead of a PCIe-6536.
 
ThanksHi,You can run bidirectional DAQmx tasks with the PCIe 6536.  I assume that with the 6541 you are using the upper 16 data lines for the acquisition session?  If so, you can do the same thing with the 6536: Assuming the PCIe 6536 is "Dev1", use "dev1/port2_16" or "dev1/line16:31" for the acquisition data lines.  And also assuming that your DUT is sending data to the 6536 source synchronously with a data valid signal, you want to use the "Pipelined Sample Clock" timing type with a Pause trigger.  The relevant example to look at for the acquisition is called "ContReadDigChan-PipeSampClkwHshk."  Depending on your DUT, you may not need to export the ready for transfer event.If you want to configure the 6536 to behave like the 6541 (that is source synchronous generation w/ a free-running clock), you will also want to use the pipelined sample clock timing type.  A good example for this is "ContWriteDigChan-PipeSampClkwHshk" but you will need to consider the appropriate setting for the "DAQmxSetSampClkUnderflowBehavior" property. Like the acquisition task, for this generation task, you may not need to configure the pause trigger.Good Luck,Jeff
yttern
2007-02-28 23:10:11 UTC
Permalink
Hello Jeff and thank you for your response.
Yes I use the lower 16 bits for generation and upper 16 bit (Use only 2) for acquisition. I was able to create a sequence that clocks data in and out data on the same serial clock. Actually it turn out to be much easier than the code I had to generate for the NI 6541 Card.
For your information I use the code given below. This code initialise the card acq. and gen. sessions, sends and receive data and the at the end closes the handlers. I use a trigger from the acq. task to start the gen. task. That was the solution for me to syncronise the tasks.
Yttern
ViStatus SetupAndSendRec_GenAcqDev_6536( ViUInt32 *iGenWaveformData, ViUInt32 *iReadWaveformData, ViUInt32 iWaveFormSize, ViUInt32 *iActualRead) //, ViUInt32 waveformData[WAVEFORM_SIZE] ){  int         error=0; uInt32      i=0, iActualWritten = 0; char        errBuff[2048]={'\0'};
  /*********************************************/ // DAQmx Generation Configure Code /*********************************************/ // Create a task handler DAQmxErrChk (DAQmxCreateTask("",&GenerationtaskHandle));  // Alloctae 16 bits for generation  DAQmxErrChk (DAQmxCreateDOChan (GenerationtaskHandle, "PXI1Slot3/port0_16", "",         DAQmx_Val_ChanForAllLines));
 //  Set Active clk edge, sampling frequency and number of samples.  DAQmxErrChk (DAQmxCfgSampClkTiming (GenerationtaskHandle, "OnboardClock",          dSampleClockRate, DAQmx_Val_Rising,          DAQmx_Val_FiniteSamps, iWaveFormSize));  // Set up sample clock to output pin PFI4 DAQmxErrChk (DAQmxExportSignal (GenerationtaskHandle, DAQmx_Val_SampleClock,         "/PXI1Slot3/PFI4"));
 // Set up trigger to input pin PFI1 DAQmxErrChk ( DAQmxCfgDigEdgeStartTrig (GenerationtaskHandle, "/PXI1Slot3/PFI1",            DAQmx_Val_Rising));
 // Set-up the buffer to be written DAQmxErrChk (DAQmxWriteDigitalU32 ( GenerationtaskHandle, iWaveFormSize, 0, 10.0,           DAQmx_Val_GroupByChannel, iGenWaveformData,           &iActualWritten, 0));  DAQmxErrChk (DAQmxStartTask(GenerationtaskHandle));  /*********************************************/ // DAQmx Acquisition Configure Code /*********************************************/ // Create a task handler DAQmxErrChk (DAQmxCreateTask("",&AcquisitiontaskHandle));  // Allocate 8 bits for Acquisition DAQmxErrChk (DAQmxCreateDIChan (AcquisitiontaskHandle, "PXI1Slot3/port2", "",         DAQmx_Val_ChanForAllLines));  //  Set Active clk edge, sampling frequency and number of samples.  DAQmxErrChk (DAQmxCfgSampClkTiming (AcquisitiontaskHandle, "/PXI1Slot3/PFI5",          dSampleClockRate, DAQmx_Val_Rising,          DAQmx_Val_FiniteSamps, iWaveFormSize));
 // Set up trigger to output pin PFI0 DAQmxErrChk (DAQmxExportSignal (AcquisitiontaskHandle, DAQmx_Val_StartTrigger,          "/PXI1Slot3/PFI0"));
 // Set up read Task. This function automaticly starts the task. DAQmxErrChk (DAQmxReadDigitalU32  (AcquisitiontaskHandle, iWaveFormSize, 10.0,            DAQmx
Loading...