From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Use board memory PCI 6534 DAQmx

Hello,

 

I am trying to re-write an old program (Which is using the Traditional DAQ driver) with NIDAQmx. I am close to succeeding but have some problem with the use of only the on board memory and regeneration of the PCI 6534 card.

 

I found some interesting discussions on the forum, but this card is a bit old and most (if not all) of the links to useful documentation have died.

For example the post How to use the PCI-6534 hint the existence of a guide of how to use the PCI 6534 with the new drivers, but this guide is nowhere to be found. (We can still find the one Traditional DAQ)

 

Related post with the old drivers here.

 

From what i see when i run my program, the buffer is outputed once, and not regenerated. With no error.

Here is the old version of the interesting part. Two groups of two DO ports with regeneration and use of only the on board memory.

 

//Configure 2 groups

DIG_Grp_Config(DOB, 1, 2, 0, 1); // Group 1, size 2, port 0 (A, B), output
DIG_Grp_Config(DOB, 2, 2, 2, 1); // Group 2, size 2, port 2 (C, D), output

 

//Clock settings

// DIG_Block_PG_Config (deviceNumber, group, config, reqSource, timebase, reqInterval, externalGate)

DIG_Block_PG_Config(DOB, 1, 1, 0, -3, 20, 0); //-3 = 50 ns timebase
DIG_Block_PG_Config(DOB, 2, 1, 0, -3, 5, 0);


Set_DAQ_Device_Info(DOB, ND_PATTERN_GENERATION_LOOP_ENABLE, ND_ON); // Regeneration on for both group


DIG_Block_Out(DOB, 1, buffer_DO, nb_points_DO); // Output Group 1


DIG_Trigger_Config(DOB, 2, 1, 1, 0, 0, 0, 0, 0); //Hardware trigger for group 2, start active low


DIG_Block_Out(DOB, 2, buffer_Ram, nb_points_R); //Output group 2

 

 

The version with DAQmx looks like this:

Two tasks of two ports each.

 

/***** First task *****/

DAQmxErrChk_DO (DAQmxCreateTask("",&taskHandleDOBoard));
DAQmxErrChk_DO (DAQmxCreateDOChan(taskHandleDOBoard,"Dev1/port0:1","DOVChan",DAQmx_Val_ChanForAllLines));

// "DOVChan" is a virtual channel name to avoid error saying that UseOnlyOnBrdMem cannot be set to individual lines


DAQmxErrChk_DO (DAQmxSetDOUseOnlyOnBrdMem(taskHandleDOBoard, "DOVChan", TRUE));

DAQmxErrChk_DO (DAQmxSetWriteRegenMode(taskHandleDOBoard, DAQmx_Val_AllowRegen));

 

DAQmxErrChk_DO (DAQmxCfgSampClkTiming(taskHandleDOBoard,"OnboardClock",1e6, DAQmx_Val_Rising, DAQmx_Val_ContSamps, nb_points_DO));

DAQmxErrChk_DO (DAQmxWriteRaw(taskHandleDOBoard, nb_points_DO, 0, 10.0, buffer_DO, NULL, NULL));

DAQmxErrChk_DO (DAQmxStartTask(taskHandleDOBoard));

 

/***** Second task *****/
DAQmxErrChk_DO_Ram (DAQmxCreateTask("",&taskHandleDORamBoard));
DAQmxErrChk_DO_Ram (DAQmxCreateDOChan(taskHandleRamDOBoard,"Dev1/port2:3", "DORVChan", DAQmx_Val_ChanForAllLines));

 

DAQmxErrChk_DO_Ram (DAQmxSetDOUseOnlyOnBrdMem(taskHandleDORamBoard, "DORVChan", TRUE));
DAQmxErrChk_DO_Ram (DAQmxSetWriteRegenMode(taskHandleDORamBoard, DAQmx_Val_AllowRegen));


DAQmxErrChk_DO_Ram (DAQmxCfgSampClkTiming(taskHandleDORamBoard,"OnboardClock", 4e6, DAQmx_Val_Rising, DAQmx_Val_ContSamps, nb_points_Raman));

DAQmxErrChk_DO_Ram (DAQmxCfgDigEdgeStartTrig (taskHandleDORamBoard, "/Dev1/PFI3", DAQmx_Val_Falling));


DAQmxErrChk_DO_Ram (DAQmxWriteRaw(taskHandleDORamBoard, nb_points_R, 0, 10.0, buffer_R , NULL, NULL));
DAQmxErrChk_DO_Ram (DAQmxStartTask(taskHandleDORamBoard));

 

 

 

If someone have some documentation or some insigth on what i am doing wrong it would be greatly appreciated.

 

Regards,

Romain

0 Kudos
Message 1 of 1
(1,445 Views)