Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert from PCIe-6535 to PCI-653x using DAQmx Sampling Clock Timing

Hi Ben,

I've never used Tri-State before.  as I understand, I could use Port0:3 as OUTPUT for generation, and use Port0 as Tri-State for both Generating and Acquitition? How do I setup a tri-state?

 

Thanks,

Dom

0 Kudos
Message 11 of 39
(1,961 Views)

You will essentially set up all of the ports for acquisition and then assign, for example, lines 0-7 (port 0) as a tri-state "generation" which will put the lines in the 'Z' state.  This way you can write on the other 24 lines and the tri-stated lines will accept data from your DUT.  

 

You will use the syntax to set the property :  

 

int32 __CFUNC DAQmxSetDOTristate(TaskHandle taskHandle, const char channel[], bool32 data);

 

You will want to set this property before you commit the task so that it determines whether DAQmx will drive data on the specified channel(s).  This property will be set to TRUE before you read from the channel(s) of interest.  

 

There is a CVI example posted on our community of a user doing this programming with the same hardware.  You can link to it here : 

 

http://zone.ni.com/devzone/cda/epd/p/id/5438

Regards,

Ben N.
Applications Engineering
ni.com/support
0 Kudos
Message 12 of 39
(1,959 Views)

Thanks,

I use Tri-State by following the example, and now there is no more error -200899, If I don't use Triggering, then when reading data from Input port the data returns ALL ZEROs, the output parameter i32BytesPerSample = ui32NumSamples.  The data is not what I'm expecting.

 

When I use Trigger:    

        DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandlePortBCDO, "OnBoardClock", i32SamplingRate, DAQmx_Val_Rising, DAQmx_Val_ContSamps, ui32NewNumSamples));
        DAQmxErrChk (DAQmxExportSignal(taskHandlePortBCDO, DAQmx_Val_SampleClock, acPFISrc ));
        DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandlePortAI,  acPFIDest  , i32SamplingRate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, ui32NewNumSamples));
        DAQmxErrChk (DAQmxCfgDigEdgeStartTrig(taskHandlePortAI,  acPFIDest  , DAQmx_Val_Falling));
The following Errors occurred for different value (acPFIDest, and acPFISrc) of clock sources PFI0 to PFI7:  I just list a few errors code below

 

"Start Trigger Source cannot be the same as the Sample Clock Source in the same task for this device.
Property: DAQmx_DigEdge_StartTrig_Src
Requested Value: /Dev3/PFI2
Property: DAQmx_SampClk_Src
Requested Value: /Dev3/PFI2
Task Name: PortAI_Local
Status Code: -200953"

 

and


"Specified route cannot be satisfied, because the hardware does not support it.

Property: DAQmx_DigEdge_StartTrig_Src
Requested Value: /Dev3/PFI3
Suggested Values: PFI2, PFI6, RTSI0, RTSI1, RTSI2, RTSI3, RTSI4, RTSI5, RTSI6
Task Name: PortAI_Local
Status Code: -89136"

 

What is the right clock source or what type of triggering method for this PCI-6533/6534?

 

Regards,

Dom

0 Kudos
Message 13 of 39
(1,956 Views)

I think, the Tri-State mode could overwrite the data on the bus.

 

Here is the Timing Diagram for my device.

 

OWBReadTimingDiagram.JPG

0 Kudos
Message 14 of 39
(1,950 Views)

Dom, 

 

In working with your start trigger, you will need check the Device Routes in Measurement Automation & Explorer (MAX) to determine if there is a direct route to the PFI line you are routing and the Digital Start Trigger.  For instance with the PCI-6534 PFI2 routes directly to the \Dig0\StartTrigger.

 

In regards to your second post with the waveform you are working with.  Have you had a chance to work with the DUT to determine if the behavior you are concerned about occurs when running your program?  

Regards,

Ben N.
Applications Engineering
ni.com/support
0 Kudos
Message 15 of 39
(1,947 Views)

Hi Ben,

 

This is my first time to use MAX to test the card, and I have MAX version 4.8.0f0, when I click on one of the tab button: Properties, Test Panels, and Reset Device, the MAX crashes.  My PC using Windows7 32-bit.

Only the tab "Create Tasks" works.  I created 2 tasks (Port0 for Input, and Port0:3 for Output) for PCI-6534, I only see PFI-6, PFI7, and RST0-7 for both tasks in the ComboBox in Trigger Tab Page.

 

For the waveform, our DUTs are working fine with PCIe-6535 using Sampling Clock Timing and also works for Unstrobed I/O Method for all cards (PCI-6533/6534 and PCIe-6535).  I read DUT EEPROM data with no problem but not PCI-6533/6534 using Sampling Clock Timing.

 

0 Kudos
Message 16 of 39
(1,944 Views)

Dom, 

 

The crashing behavior with MAX is unusual.  Can you download the latest DAQmx driver and see if this doesn't resolve the issue?  Version 9.4 of the driver is the latest and you can download it here:  

 

http://joule.ni.com/nidu/cds/view/p/id/2604/lang/en

Regards,

Ben N.
Applications Engineering
ni.com/support
0 Kudos
Message 17 of 39
(1,942 Views)

The download and installation of this version 9.4 took 3 hours.  The triggering terminal still complaining errors.  If NO trigger, I get a block of data (NumSamples) randomly the same byte repeated for the whole block of buffer.  I don't know how to use the trigger for this cards 6533/6534.

 

sprintf(acPort,"/%s/port0", g_tdsDaqDevInfo.acDevName);
DAQmxErrChk (DAQmxCreateTask("PortAI_Local", &taskHandlePortAI));
DAQmxErrChk (DAQmxCreateDIChan(taskHandlePortAI, acPort, "", DAQmx_Val_ChanForAllLines));
//Combines Port A, B, C, and D as Output Task.  Port-A as Tri-State
sprintf(acPort,"/%s/port0:3", g_tdsDaqDevInfo.acDevName);
DAQmxErrChk (DAQmxCreateTask("PortBCDO", &taskHandlePortBCDO));
DAQmxErrChk (DAQmxCreateDOChan(taskHandlePortBCDO, acPort, "", DAQmx_Val_ChanForAllLines));

//Config Sampling Clock Timing, and Exporting the Clock Timing.
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandlePortBCDO, "OnBoardClock", i32SamplingRate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps /*DAQmx_Val_ContSamps*/, ui32NewNumSamples));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandlePortAI,  "OnBoardClock" , i32SamplingRate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, ui32NewNumSamples));

//=====================================================================================================================
//      THE TRIGGER DOES NOT WORK !!!!!
//Configure Read Start Trigger
//DAQmxErrChk (DAQmxCfgDigPatternStartTrig (taskHandlePortAI, "port0:3", aui8TriggerPattern, DAQmx_Val_PatternMatches));
//DAQmxErrChk (DAQmxCfgDigEdgeStartTrig(taskHandlePortAI,  acPFIDest  , DAQmx_Val_Falling /* DAQmx_Val_Rising */));
//=====================================================================================================================


DAQmxErrChk (DAQmxStartTask(taskHandlePortAI));
/*********************************************/		
// Unreserve the input task, so we can access Output task
/*********************************************/		
DAQmxErrChk (DAQmxTaskControl (taskHandlePortAI, DAQmx_Val_Task_Unreserve));  
DAQmxErrChk (DAQmxWriteDigitalU32(taskHandlePortBCDO, ui32NewNumSamples, 0, 10.0, DAQmx_Val_GroupByChannel, pui32DataPortBCD, &i32BytesPerSample, NULL));
DAQmxErrChk (DAQmxStartTask(taskHandlePortBCDO));
/*********************************************/		
// Set DO tristate
/*********************************************/		
sprintf(acPort,"/%s/port0", g_tdsDaqDevInfo.acDevName);
DAQmxErrChk (DAQmxSetDOTristate(taskHandlePortBCDO, acPort, TRUE)); 
		
/*********************************************/
// Unreserve the output task, so we can access Input task
/*********************************************/
DAQmxErrChk (DAQmxTaskControl (taskHandlePortBCDO, DAQmx_Val_Task_Unreserve));
DAQmxErrChk (DAQmxReadDigitalU8(taskHandlePortAI, -1, 10.0, DAQmx_Val_GroupByChannel, pui8Data, ui32NumSamples, &i32BytesPerSample, NULL));

 

0 Kudos
Message 18 of 39
(1,934 Views)

Hi Ben,

Now I try to use the following trigger setting and only PFI2 and PFI6 are supporting for PCI-6533/6534.  When I'm using either PFI2 or PFI6, it's still timeout when getting data (error -200284).

 

//Configure Read Start Trigger, ONLY PFI2 and PFI6 are SUPPORT for PCI-6533/6534
DAQmxErrChk (DAQmxCfgDigEdgeStartTrig(taskHandlePortAI,  "PFI2"  , DAQmx_Val_Falling /* DAQmx_Val_Rising */));

 Error description:

"Some or all of the samples requested have not yet been acquired.
To wait for the samples to become available use a longer read timeout or read later in your program. To make the samples available sooner, increase the sample rate. If your task uses a start trigger, make sure that your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock.
Property: DAQmx_Read_RelativeTo
Corresponding Value: DAQmx_Val_CurrReadPos
Property: DAQmx_Read_Offset
Corresponding Value: 0
Task Name: PortAI_Local
Status Code: -200284"

 

 

Regards,

Dom

0 Kudos
Message 19 of 39
(1,932 Views)

Dom, 

 

Can you confirm on a Test Panel in MAX that the line you have set is actually seeing the trigger signal?  

Regards,

Ben N.
Applications Engineering
ni.com/support
0 Kudos
Message 20 of 39
(1,930 Views)