LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

NI6534 card, How can I check to see when data on the bus is being aquired? Need to read the data on the bus 150nano seconds after the the data strobe goes low and read/write goes high.

I am using two NI 6534 card. One card is setup to output data and control lines:

First Card(Device2)Write Card
  • Buss A (A0-A7)
  • Buss B (B0-B7)
  • Control Lines (Data Strobe, Read Write, Address Strobe)


Second Card(Device3)Read Card

  • Buss A (A0-A7)
  • Buss B (B0-B7)


The write card is put into a tristate mode during read operations.

Having problems to read data within a data strobe of 250nano seconds and read/write pulse of 350nano seconds.

Need to read the data on the bus 150nano seconds after the the data strobe goes low and read/write goes high.


Below are some of the functions being used in my code.

 


  Write_WFM16 (Module_Strobe, 10, 12, x0202, 16, 18); //Sets up the module ID of 02
  Write_WFM16 (Address_Strobe, 10, 12, xFF00, 16, 18); //sends address 00 on A/B bus
  Write_WFM16 (Data_Strobe, 10, 12, D_xFF55, 16, 18); //sends data FF(B)00(A) on A/B bus
  Write_WFM16 (Address_Strobe, 10, 12, xFF00, 16, 18); //sends address 00 on A/B bus
  
ReadAB_Bus();
Fmt (Read_data, "%x[w4p0]",read_data[0]);//w4 insures a 4bytes, p0 patches any blank characters

 
 

void Write_WFM16 (unsigned short *control_Array_Name, int control_WFM_Size,
                             int control_Buffer_Size, unsigned short *bus_Array_Name,
                             int bus_WFM_Size, int bus_Buffer_Size)
{
 DAQmxResetWriteAttribute (Control_Lines, DAQmx_Write_RegenMode);
 DAQmxResetWriteAttribute (Bus_Lines, DAQmx_Write_RegenMode);
 DAQmxCfgSampClkTiming (Control_Lines, "OnboardClock", 20000000, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, control_Buffer_Size);
 DAQmxCfgSampClkTiming (Bus_Lines, "/Dev2/RTSI0", 20000000, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, bus_Buffer_Size);
 DAQmxWriteDigitalU16(Control_Lines,control_WFM_Size,0,2.0, DAQmx_Val_GroupByChannel, control_Array_Name, &control_samp,NULL); 
 DAQmxWriteDigitalU16(Bus_Lines,bus_WFM_Size,0,2.0,DAQmx_Val_GroupByChannel,bus_Array_Name, &bus_samp,NULL);
 
 DAQmxStartTask (Bus_Lines);
 DAQmxStartTask (Control_Lines);
 
 DAQmxStopTask (Bus_Lines);
 DAQmxStopTask (Control_Lines);
 
 return;
}
 
void ReadAB_Bus(void){
//
// /*********************************/
// /***** Multi Thread Code**********/
// /* Need AB_Read Waveform    */
// /* and ReadDigitalU16 to    */
// /* execute almost silumtaniously */
// /* (within 100ns of AB_Read)     */
// /*********************************/
 DAQmxResetWriteAttribute (Control_Lines, DAQmx_Write_RegenMode);
 DAQmxResetWriteAttribute (Bus_Lines, DAQmx_Write_RegenMode);
 
 DAQmxSetDOTristate (Bus_Lines, "Bus_Lines", 1); /*TRUE before you read from the channel*/
 
 DAQmxCfgSampClkTiming (Control_Lines, "OnboardClock", 20000000, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, 12);
 DAQmxWriteDigitalU16(Control_Lines,10,0,2.0,DAQmx_Val_GroupByChannel, AB_Read, &control_samp,NULL);
 CmtScheduleThreadPoolFunction (DEFAULT_THREAD_POOL_HANDLE, Read_Bus, NULL, &functionID);  /*Indicates what function to run for multithreading*/
 DAQmxStartTask (Control_Lines);
 
 CmtWaitForThreadPoolFunctionCompletion (DEFAULT_THREAD_POOL_HANDLE, functionID, 0); /*waits for secondary function to finish and close before exiting program*/
 CmtReleaseThreadPoolFunctionID (DEFAULT_THREAD_POOL_HANDLE, functionID);
 
 DAQmxStopTask (Control_Lines);
 DAQmxSetDOTristate (Bus_Lines, "Bus_Lines", 0);
}
 
int CVICALLBACK Read_Bus (void *functionData)
{
 DAQmxStartTask (ReadBack);
 DAQmxReadDigitalU16 (ReadBack, 1, 2.0, DAQmx_Val_GroupByChannel, read_data, 2, &samples_read, NULL);
 DAQmxIsTaskDone(ReadBack,&done);
 DAQmxStopTask (ReadBack);
 DAQmxSetDOTristate (Bus_Lines, "Bus_Lines", 0); /*TRUE before you read from the channel*/
 return 0;
}
0 Kudos
Message 1 of 8
(4,209 Views)

Hi,

Are you running into any specific errors during your application or is this strictly a timing issue? I recommend using some of the shipping examples that come with the DAQmx driver. There are a couple of good digital input and digital output examples in the CVI Example Finder. These are located in Help >> Find Examples >> Hardware Input >> DAQmx. The digital output examples are in the digital generation directory and the digital input examples are in the digital measurements directory.

Regards,
Hal L.

0 Kudos
Message 2 of 8
(4,169 Views)

This is strictly a timing issue. After the datastrobe & read/write waveforms are sent the data is present 40 nano second on the buss. Any low level transition decays to a high level.

Example: During our test there is a device that we send HEX 55. This data is then latched into the device. The next step is to read the HEX 55 value back from the device, changing the direction of the data on the buss using the read/write line. It seems like the only way we can read this data is if it is present on the buss for longer than 4milliseconds of greater. The only way this test works is if we change are read/write waveform so that it produces a read/write pulse of that pulse width.

Our end customer has a buss requirement of (datastrobe 250nano seconds & read/write 350nano seconds). We need to meet these requirements.

thanks

 

 

0 Kudos
Message 3 of 8
(4,160 Views)

Hi,

I would like to make sure that I have a good high level understanding of your application. This involves two 6534's as well as a 3rd party DUT. Your first 6534 will output data to the DUT and after some time the DUT will reply with some data. This data is read by the second 6534 and you are tristating the first 6534 at the same time. Please let me know if any of this is incorrect. Also, would it be possible for you to test this application without tristating one of the 6534's on the fly? I think that this could be causing some of the delays that you are running into.

Regards,
Hal L.

0 Kudos
Message 4 of 8
(4,125 Views)

If I disable the tristate mode, the output will all go high and the NI6534 reads all FFFF.  NI indicated that we needed to connect the RTSI cable between the two units. This will help in syncronizing the two cards in the system. But, having trouble trying to get this to work. Idea is to trigger the read card when the read/write lines go high and capture the data on the BUSS.

Note: Using LW CVI example : FiniteAI.C as a reference tool.

Any help is appreciated.

 

THANKS

 

0 Kudos
Message 5 of 8
(4,110 Views)

Hi,

I would really like to help you on this one. However, I'm still curious if I have your system setup correct from my previous post. Was my assessment of your overall application correct? Please let me know and I'll continue to help you with this.

Regards,
Hal L.

0 Kudos
Message 6 of 8
(4,086 Views)
Fixed our problem with the following function call. We are now able to capture the 8th clock sample of the return data with in the 150nano second window.
Eliminated the use of a thread pool function.
The idea behind this is to RTSI the onboard clock to the read card during the StartTask(Control Lines). With the sample rate set to 12 we were able to be selective on the samples read into the buffer.
 
*****************************************************************************************************************************************
 
void ReadAB_Bus(void){
 DAQmxResetWriteAttribute (Control_Lines, DAQmx_Write_RegenMode);
 DAQmxResetWriteAttribute (Bus_Lines, DAQmx_Write_RegenMode);
 
 DAQmxSetDOTristate (Bus_Lines, "Bus_Lines", 1); /*TRUE before you read from the channel*/
 
 DAQmxCfgSampClkTiming (Control_Lines, "OnboardClock", 20000000, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, 12);
 DAQmxWriteDigitalU16(Control_Lines,10,0,1.0,DAQmx_Val_GroupByChannel, AB_Read, &control_samp,NULL);
 
 DAQmxStartTask (ReadBack);
 
 //CmtScheduleThreadPoolFunction (DEFAULT_THREAD_POOL_HANDLE, Read_Bus, NULL, &functionID);  /*Indicates what function to run for multithreading*/
 
 DAQmxStartTask (Control_Lines);
 
 DAQmxReadDigitalU16 (ReadBack, 11, 1.0, DAQmx_Val_GroupByChannel, read_data, 100, &samples_read, NULL);
 
 //CmtWaitForThreadPoolFunctionCompletion (DEFAULT_THREAD_POOL_HANDLE, functionID, 0); /*waits for secondary function to finish and close before exiting program*/
 //CmtReleaseThreadPoolFunctionID (DEFAULT_THREAD_POOL_HANDLE, functionID);
 
 DAQmxIsTaskDone(ReadBack,&done);
 DAQmxStopTask (Control_Lines);
 DAQmxStopTask (ReadBack);
 DAQmxSetDOTristate (Bus_Lines, "Bus_Lines", 0);
}
I hope this make sense, it seems to be working fine.
 
Best Regards,
Chinook.
Message 7 of 8
(4,018 Views)
That looks good.  Thanks for posting the solution you found.
0 Kudos
Message 8 of 8
(4,012 Views)