Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ-653X handshaking mode in C

Hello all,
 
I'm new with the NI products, I tried to post my question last week maybe I was not in the right part of the forum (https://forums.ni.com/t5/Multifunction-DAQ/DAQ-653X-handshaking-mode-in-C/m-p/291550).
So I try here to get some help. I was in troubles just with the user manual and the NI-DAQ C Reference Guide to use the handshaking mode. Now it's ok with the DAQmxCfgHandshakingTiming function, I can go to the next step in my program with the REQ signal but nothing is generate on the port which I apply the handshaking ! There is a part of my code :

DAQmxErrChk (DAQmxResetDevice ("Dev1"));

DAQmxErrChk (DAQmxCreateTask("emission",&taskE));

DAQmxErrChk (DAQmxCreateDOChan(taskE,"Dev1/port0","",DAQmx_Val_ChanForAllLines));

DAQmxErrChk (DAQmxCreateTask("reception",&taskR));

DAQmxErrChk (DAQmxCreateDOChan(taskR,"Dev1/port2","",DAQmx_Val_ChanForAllLines));

DAQmxErrChk (DAQmxCfgHandshakingTiming (taskE,DAQmx_Val_ContSamps,1));

...

for

(i=0;i<a;i++){

 

   DAQmxErrChk (DAQmxWriteDigitalU8(taskE,64,TRUE,180,DAQmx_Val_GroupByChannel,&data[i][0],&writeE,NULL));

   DAQmxErrChk (DAQmxWriteDigitalU8(taskR,1,TRUE,180,DAQmx_Val_GroupByChannel,&data[i][1],&writeR,NULL));

   DAQmxErrChk (taskE);

   DAQmxErrChk (taskR);

}

I get samples on port2, but nothing on port0. When I try to apply handshaking on port2, it's the same as for port0... I think my problem come from the buffer size or the numSampsPerChan which I have to pass to 64 to get only one sample generated in my loop.

If anyone know what's wrong or have a detailed documentation on the handshaking mode, please help me !
Thanks
 
Vergnolle G.
0 Kudos
Message 1 of 3
(3,609 Views)
 

Hi,

You will find some help about handshaking mode here :

http://zone.ni.com/devzone/conceptd.nsf/webmain/467ED254F3A30B1286256A6F00720951?OpenDocument 

 

Here is an example :

http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=F0F644DE4AEC00FDE0340003BA7CCD71&p_node=201181&p_source=External 

Marc L.

0 Kudos
Message 2 of 3
(3,590 Views)

Thank you for these links,

But I still don't find what I was looking for, how to configure the right handshaking mode. Today I tried to use DAQ instead of DAQmx, I found here the function DIG_Group_Mode which allow to pass in parameter the wished mode. DAQmx seem to be the new generation of DAQ, delivered with the PCI-DIO-32HS card but in the user manual there is only flowcharts for DAQ !

With DAQ I have the same mistake as with DAQmx : I can generate samples on my ports only if I don't configure handshaking, if I do the program run but I don't get any signal !

If you can help me.

Thanks

Vergnolle G.

0 Kudos
Message 3 of 3
(3,571 Views)