01-17-2007 09:42 AM
Hi i have 2 problems with my PXI-6509. I need to control it over CVI DAQmx
1. I found lot of commands for setting port to high impedance (DAQmxTristateOutputTerm, DAQmxSetDITristate, DAQmxSetDOTristate, DAQmxSetDigitalPowerUpStates)
But none of them work. I also found a info, that 6509 does not support tristate, but datasheet says something else.
I need to set specific port or even better specific line to high impedance.
2. I also need to set/check port direction. I know that PXI-6509 has bidirectional ports, but sometimes i need to set a port just for sending data and sometimes just for receiving. But before sending data i need to check if port is set to output direction. How can i do it?
Any help?
Thanks Michal
01-17-2007 10:08 AM
Hi Michal,
I think there may be some confusion here over the wording in the datasheet. The 6509 does NOT support Tristate outputs, it supports three states:-
1. High impedance input.
2. High output (i.e. logic 1).
3. Low output (i.e. logic 0).
If you need to use a tristate output you would need to use the 655x board, but this is much more expensive and much lower channel count.
To check if a port is set to be an output you could use the DAQmxGetDevDOPorts device property, this will return all ports currently configured as outputs then just check to see if the port you want to use is amongst them.
Hope this helps,
Nick
01-17-2007 11:06 AM
01-17-2007 11:30 AM
Hi Michal,
I may be missing something here but I cannot see where you are creating an output port in your code. I see an input port which would return empty. Am I missing something here?
Nick
01-18-2007 01:34 AM
Sorry Nick,
my fault, here is the rest of code.
uInt8 data_out[4]={0};
char errBuffOut[2048]={'\0'};
int taskHandleOut=0;
char data[256]="";
int bufferSize=0;
/*********************************************/
// DAQmx Configure Code
/*********************************************/
DAQmxCreateTask("",&taskHandleOut);
DAQmxErrChk (DAQmxCreateDIChan(taskHandleOut,"/Dev5/port3/line0:3","",DAQmx_Val_ChanForAllLines));
/*********************************************/
// DAQmx Start Code
/*********************************************/
DAQmxErrChk (DAQmxStartTask(taskHandleOut));
/*********************************************/
// DAQmx Write Code
/*********************************************/
DAQmxErrChk (DAQmxWriteDigitalLines(taskHandleOut,1,1,10.0,DAQmx_Val_GroupByChannel,data_out,NULL,NULL));
DAQmxGetDevDOPorts("Dev5", data, bufferSize);
DAQmxStopTask(taskHandleOut);
DAQmxClearTask(taskHandleOut);
01-18-2007 02:59 AM
01-18-2007 03:30 AM
Hi Nick,
still nothing.
DAQmxGetDevDOPorts("Dev5", data, bufferSize);
returns me empty data, and bufferSize = 0
if i initialize bufferSize=256 before DAQmxGetDevDOPorts.
Then at the end is
data ="Dev5/port0, Dev5/port1, Dev5/port2, Dev5/port3, Dev5/port4, Dev5/port5, Dev5/port6, Dev5/port7, Dev5/port8, Dev5/port9, Dev5/port10, Dev5/port11, Dev5/port0_32, Dev5/port4_32, Dev5/port8_32"
01-18-2007 04:02 AM
01-18-2007 06:20 AM
01-18-2007 08:08 AM