I'm trying to use the PCI-6514 for a low speed digital IO control application. All I need is a license free way to access the IO from VB or a C++ DLL called from VB.
I've tried running the demo app VC_WriteDigPort.dsw. It appears to work
after I changed the channel name to the name that I'd set up.
I then took the code and inserted it into my application. The
DACmxCreateTask function doesn't return. The application hangs inside the
call and I have to stop the application from the VC menu. My application is
written in VB 6.0, calling a VC++ 6.0 DLL, which contains the call to NI's
library functions. See enclosed C++ class.
Don't know how to get the driver version. Masurement and Automation version
supplied with board given below.
Software Details: Visual C++ version N/A
NI Hardware : Digital Input/Output device PCI-6514
Driver Version : Meas and Aut 3.1.0.3021
Operating System: Windows XP
NI6514::NI6514()
{
int iError = 0;
m_hTask = 0;
if ( DAQmxFailed( iError = Configure_WriteDigPort("Dev1/port4",&m_hTask)) )
{
return;
}
if ( DAQmxFailed( iError = Start_WriteDigPort(m_hTask)) )
{
return;
}
m_boOpen = true;
}
int32 Configure_WriteDigPort(const char chan[], TaskHandle *taskHandle)
{
int32 error=0;
/*********************************************************************
* 1. Create a task.
* 2. Create a Digital Output channel. Use one channel for all lines.
* In this case, the port itself acts as an individual channel.
*********************************************************************/
error = DAQmxCreateTask("",taskHandle);
// DAQmxErrChk (DAQmxCreateTask("",taskHandle));
DAQmxErrChk (DAQmxCreateDOChan(*taskHandle,chan,"",DAQmx_Val_ChanForAllLines));
Error:
return error;
}