Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

daqmx DAQmxCfgDigEdgeStartTrig simulated

Hi.

 

I am developing under LabWindows on a Simulated device Daq PXIe-6363

 

I use two tasks (one to send data, the other one to receive)

 

I need to synchronize the tasks.

 

I started with the example SynchAI-AO.c

 

In this code, DAQmxCfgDigEdgeStartTrig is called for the AOtask.

I just added a call to DAQmxRegisterEveryNSamplesEvent for AOtask, and I see that the callback is called even if task AI is not started .

 

I thought that the AO task will only start when AI task is started (due to the call to DAQmxCfgDigEdgeStartTrig )

 

Do I misunderstand something ?

Is it because I am running with a Simulated device (and it will work as I thought with real hardware ? ) ?

 

Thanks

 

 

0 Kudos
Message 1 of 6
(3,979 Views)

Hello,

 

You're rigth  AO task will only start when AI task is started.

DAQmxRegisterEveryNSamplesEvent for AOtask is just called to define the paramater of the AO Task.

 

Fell free to ask if I'm not clear.

Have a good day.

 

 

 

Eloise
NI France

0 Kudos
Message 2 of 6
(3,958 Views)

Hi.

 

Ok, so the issue is that in my attached source code, I don't start the AI Task. (Code commented)

 

//	DAQmxErrChk (DAQmxStartTask(AItaskHandle));

The AO Task should be synchronized on the AI Task

 

	DAQmxErrChk (GetTerminalNameWithDevPrefix(AItaskHandle,"ai/StartTrigger",trigName));
	DAQmxErrChk (DAQmxCfgDigEdgeStartTrig(AOtaskHandle,trigName,DAQmx_Val_Rising));

 

But when I start the soft I enter the callback 

int32 CVICALLBACK EveryNCallbackTx(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, void *callbackData)
{
	
	printf("Tx\n");
	return 0;
}

meaning that AO task is running.

 

Is it because I am working with simulated device ?

 

Thanks

 

 

0 Kudos
Message 3 of 6
(3,950 Views)

Hello,

 

I made some tests with your code and a multifunction board in my computer and I don't obtain the same résult if I run your code with a simulated device. 

But the result is not what I expected. So I continue to investigate...

 

Eloise
NI France

0 Kudos
Message 4 of 6
(3,920 Views)

Hello,

 

Like you supposed in your first message, you enter in the callback because you are in a simulated mode.

 

But with a system (non simulated) you enter in the callback too but only for the few times. This is because the configuration of your AO Task writte in the buffer and  the function "DAQmxRegisterEveryNSamplesEvent"  run for the Number of the samples in the buffer.

In my case, the callback is called 8 times because my buffer have 8192 samples...

 

Have a good day.

Eloise
NI France

0 Kudos
Message 5 of 6
(3,892 Views)

Ok. thanks for your tests.

 

I should have real hardware when coming back from holidays.

So I will check this ASAP.

 

Chris

 

0 Kudos
Message 6 of 6
(3,887 Views)