11-27-2009 09:02 AM
Hi,
I am a NIDAQmx novice and need some help for the following task:
I need to rewrite a piece of C-code (that uses routines presumably from NIDAQ.DLL) in LabVIEW (8.5 or higher) using NIDAQmx VIs.
The hardware is a PCI-6503 card, and the port0 of that card is to be used in bidirectional mode. The following code fragment lists the bare functions as they are used in the C-code (I removed all error checking and query-for-ready calls):
int16 Port = 0;
int16 HandShaking = 1;
int16 Bidirectional = 2;
/*Initialise Board and Ports*/
Init_DA_Brds(*deviceNumber, &deviceNumberCode);
Timing = HandShaking;
Mode = Bidirectional;
DIG_Prt_Config (*deviceNumber, Port, Timing, Mode);
begin loop
/*perform a write/read */
DIG_Out_Prt (DeviceNumber, Port, Port_writeData); /*Write one byte of data */
DIG_In_Prt (DeviceNumber, Port, &*Port_readData); /* Read one byte of data */
end loop
The LabVIEW examples 'Handshaking Output-8255.vi' and 'Handshaking Input-8255.vi' show me how to configure the tasks, but I have no idea how to implement the bidirectional behaviour.
I tried to get help in this forum already by waking up the thread CVI - DAQmx : How do I configure a channel as bidirectional? , and I had consulted message#3 of another thread , but I'm still not sure what exactly I should do.
I'd appreciate any help or any hint to an example program which demonstrated what I want.
-Franz
11-30-2009 03:34 AM
Hello Franz,
in general:
Also the following Links should help you to get a bettter understanding to your hardware and the bidirectional configuration:
Understanding the Bi-Directional Mode of 8255 Chip
http://digital.ni.com/public.nsf/allkb/F865C1157622C9DE8625648B00782CDA?OpenDocument
How Do I Use Bidirectional Mode with an 8255 DIO Chip?
http://digital.ni.com/public.nsf/allkb/92582BD25EE97F8D85256442005968C9?OpenDocument
Best wishes, Jan