Discussion:
How can you read serial data from PXI-6534 triggering on Enable signal and clocking data on a clock signal?
(too old to reply)
samantham
2008-03-07 18:15:22 UTC
Permalink
Hello, 

 

I understand your desired setup to trigger bases on the rising edge of the ENB line and continue to acquire while the ENB line is high.  Via the scheme layout, I can see the eight bits of data that associate with the ENB line high state.  I also saw from your depiction of the CLK, DAT, and ENB that it does not seem there is a rising clock edge for each data point of interest.  I would imagine that the clock should have been depicted to be twice as fast as currently posted.  Please clarify the CLK relation to the DAT. 

 

A possible solution for your setup would be to use the Burst Handshaking, which will utilize the setup of a REG1 and ACK1 that you mentioned.  Please refer to the DAQmx C Reference Help for details about this Sample Timing Type.  The conceptual topic is titled Burst Handshaking Signals. 

 

I currently have a 6534 in my computer and will finish testing the handshaking setup compatibility with your desired application tomorrow morning. 
jcarbonell
2008-03-10 14:10:09 UTC
Permalink
Hi,With this timing diagram, I'd recommend:- Use an NI-6536/7, but configure the device for a pipelined sample clock input task.  Your enable signal would be the "Pause Trigger"
- Use an NI-6541, it has a mode that is compatible w/ your timing diagram.  Like the 6536/7, your enable signal is a "Pause Trigger"
- Continue to use the 6534, but configure the device for a burst handshake input task.  Your enable signal would again be the "Pause Trigger."  There is but one caveat: burst handshake has three control lines: a sample clock, a pause trigger, and a ready for transfer event.  If we assume that the 6534 is the write side of a FIFO, the pause trigger is like the write enable signal, the ready for transfer event is a FIFO-is-full signal, and the clock is, well, a clock.  With this configuration, when the FIFO is full, the write enable signal is ignored and the ready for transfer event deasserts.  In contrast, the 6536 and 6537 will signal an overflow error to software; the 6541 will signal a data-overwritten error when you try to fetch the data.
If you're willing to ignore the 6534's ready for transfer event, then I'd go with the 6534 in burst handshaking.&nbsp; In all solutions, you will need to deserialize the data in software.Good luck,Jeffjdviolin wrote:Samantham,Thanks for your response.&nbsp; Perhaps the confusion came in that I swapped the labels for the ENB and DATA signals.&nbsp; The ENB signal stays high for the entire data transmission (which will almost always be longer than 8 bits, but I used this as an example).&nbsp; The data transitions on the falling edge of the clock and is valid on the rising edge of the clock.&nbsp; The data that should be acquired from the diagram are the data points in bold.&nbsp; Let's try a waveform picture:<img src="" style="padding: 7px 8px; background-color: #F6FEFF; border-left: 1px solid #8FF1FF; margin: 10px 0px; display: inline-block; color: #3B5053; font-size: 13px; ">Loading Image... Does that help?&nbsp; The length of data is not really important, but this image has the data being 32-bits wide.&nbsp; Let me know if there are any other questions.&nbsp; Thanks again!!!JOHN
samantham
2008-03-12 19:10:08 UTC
Permalink
Hello,

National Instruments ships examples with the DAQmx driver.&nbsp; If you have DAQmx 8.5 or later the examples are located at the path listed below.&nbsp; Find the appropriate folder related to your development environment.&nbsp; Then under the &lt;Digital&gt; &lt;Read Values&gt; &lt;Cont Read Dig Chan-Ext Clk&gt; folders are the example files.&nbsp; The path for ANSI C is the second path listed below.&nbsp; This example uses the DAQmxCfgSampClkTiming timing function.&nbsp; You would just have to replace this function with the DAQmxCfgBurstHandshakingTimingImportClock function.

C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples

C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Read Values\Cont Read Dig Chan-Ext Clk

If you are using a version of DAQmx prior to 8.5 then the location is C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C.
jdviolin
2008-03-13 19:40:10 UTC
Permalink
Thank you for your help.

I can not seem to get the this to work.&nbsp; Here is my code:

DAQmxCreateTask ("", &amp;hTaskHandle);
DAQmxCreateDIChan(hTaskHandle,"PXI1Slot3/port0/line0","",DAQmx_Val_ChanPerLine);
DAQmxCfgBurstHandshakingTimingImportClock (hTaskHandle,
DAQmx_Val_ContSamps, uiNumBytes, 2000000, "/PXI1Slot3/PFI4",
DAQmx_Val_Rising, DAQmx_Val_Low, DAQmx_Val_ActiveHigh);

DAQmxRegisterDoneEvent(hTaskHandle,0,HandshakeCallback,&amp;uiNumBytes);

DAQmxStartTask(hTaskHandle);

When I run this code, the "Ready for Transfer Event" signal (PFI6/ACK1)
never asserts.&nbsp; It seems this value should assert as soon as the task
is started (right after DAQmxStartTask()).&nbsp; Does it need a continuously
running clock?&nbsp; Must the clock be valid before the "Ready for Transfer
Event" signal asserts?&nbsp; In addition, I never get a callback.&nbsp; Here's
the callback function:

int32 CVICALLBACK HandshakeCallback(TaskHandle taskHandle, int32 status, void *callbackData)
{
&nbsp;&nbsp;&nbsp; printf( "Handshake Callback Registered"); // create message

&nbsp;&nbsp;&nbsp; return 0;
}

I put a break point in here too, so I know that it is never being executed.&nbsp; Any ideas?&nbsp; Thanks.
jcarbonell
2008-03-14 14:10:07 UTC
Permalink
(1) The clock for burst handshaking needs to be freerunning.&nbsp; I don't know how many clock pulses the 6534 needs before the Ready For Transfer Event is valid.&nbsp; Yes, the Ready for transfer event is clocked from the sample clock that you've configured.(2) You're not getting your callback because the 6534 hasn't sampled any data yet.If your clock is not freerunning, can you gate the clock and get rid of the enable?&nbsp; If you can, you can use the sample clock timing type.Jeffjdviolin wrote:Thank you for your help.

I can not seem to get the this to work.&nbsp; Here is my code:

DAQmxCreateTask ("", &amp;hTaskHandle);
DAQmxCreateDIChan(hTaskHandle,"PXI1Slot3/port0/line0","",DAQmx_Val_ChanPerLine);
DAQmxCfgBurstHandshakingTimingImportClock (hTaskHandle,
DAQmx_Val_ContSamps, uiNumBytes, 2000000, "/PXI1Slot3/PFI4",
DAQmx_Val_Rising, DAQmx_Val_Low, DAQmx_Val_ActiveHigh);

DAQmxRegisterDoneEvent(hTaskHandle,0,HandshakeCallback,&amp;uiNumBytes);

DAQmxStartTask(hTaskHandle);

When I run this code, the "Ready for Transfer Event" signal (PFI6/ACK1)
never asserts.&nbsp; It seems this value should assert as soon as the task
is started (right after DAQmxStartTask()).&nbsp; Does it need a continuously
running clock?&nbsp; Must the clock be valid before the "Ready for Transfer
Event" signal asserts?&nbsp; In addition, I never get a callback.&nbsp; Here's
the callback function:

int32 CVICALLBACK HandshakeCallback(TaskHandle taskHandle, int32 status, void *callbackData)
{
&nbsp;&nbsp;&nbsp; printf( "Handshake Callback Registered"); // create message

&nbsp;&nbsp;&nbsp; return 0;
}

I put a break point in here too, so I know that it is never being executed.&nbsp; Any ideas?&nbsp; Thanks.
jdviolin
2008-05-01 21:40:07 UTC
Permalink
I wanted to rekindle this topic a little bit.&nbsp; I noticed in the documentation that it says: "The NI 653X asserts the ACK signal if it is ready to perform a transfer. If the peripheral device also asserts the REQ signal indicating it is ready, a transfer occurs on the rising edge of the PCLK signal."&nbsp; (Page 3-5 of NI653X User's Manual)What I would like to know is, can you change the input clock polarity?&nbsp; In the DAQmxCfgBurstHandshakingTimingImportClock() function, there is a Sample_Clock_Active_Edge parameter, but I can not seem to get the device to sample on the falling edge setting this parameter to DAQmx_Val_Falling.&nbsp; FYI, it works great on the rising edge.If it would be helpful, I setup some test code that can be used to test this.&nbsp; I can send it in an email if that would help.Any information you can provide would be very much appreciated.&nbsp; Thank you.
samantham
2008-05-06 19:10:10 UTC
Permalink
Hello,
Please confirm if you are using the internal sample clock or an external source for the sample clock with the DAQmxCfgBurstHandshakingTimingImportClock function.&nbsp; I saw in older posted code that you are looking to a PFI line, but wanted to confirm the fact that you were using an external clock.&nbsp;
&nbsp;
jdviolin
2008-05-06 19:40:09 UTC
Permalink
This is correct.&nbsp; We are using an external clock coming in on a PFI line.&nbsp; Thank you. JOHN
samantham
2008-05-09 16:40:08 UTC
Permalink
Hello,
&nbsp;
You should be able to use the falling edge of the clock with the burst import task with an external clock.&nbsp; I assume you are setting the int32 sampleClkActiveEdge parameter to DAQmx_Val_Falling on the DAQmxCfgBurstHandshakingTimingImportClock function.&nbsp; Please let me now how you have determined / proven that the data that you are acquiring is actually related to the timestamp of the rising rather than the falling edge.&nbsp; Are you reading / detecting the external clocks ... so you have a timestamp of both the rising and falling edges and comparing it to the timestamp of the data?
Loading...