11-30-2007 07:19 PM
Hi Paul,
The way we have the DAQpad set up is we have a one pulse per sec coming from a GPS device going into PC6 (pin 36) and Exttrg (pin 38), and we use pc7 (pin 37) as output. I tried your code and it didn't work until I put in iStatus = DIG_Prt_Config(iDevice, iPort, 1, 1), but it still would set the output low when the program would exit. Could the problem have something to do with using pc6 and exttrg? Also, although we are using Port C pins 6 and 7, the software would only work if set to port A (iPort = 0). This doesn't make sense.
Thanks,
Greg
Hi Greg,
I have set up a computer running Windows XP, Visual Studio 2005, and NI DAQ 6.9.3. I setup a very basic example using the digital out port A line 0 of the DAQpad 1200. I tested a few things. Running my application with the following code below set the digital output lines high and leaves them high after closing the application.
// test2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "nidaq.h"
#include "nidaqex.h"
int _tmain(int argc, _TCHAR* argv[])
{
/*
* Local Variable Declarations:
*/
i16 iStatus = 0;
i16 iDevice = 1;
i16 iPort = 0;
iStatus = DIG_Out_Port(iDevice, iPort, 0xFF);
return 0;
}
In addition, I tested the example that contained the iStatus = DIG_Prt_Config(iDevice, iPort, iMode, iDir). I verified with a break point that this does set the digital output lines low. I suggest removing this section of code as seen above if you want to avoid this behavior.
In regards to your question: "Also, I was informed by our technician and our Electrical engineer that unplugging the DAQPad from the parallel port before the program quits is a bad idea, that something could get damaged. Is this true?"
I don't see any documentation on doing this and how it may affect the DAQpad 1200. However, I would recommend, as a precaution, to not remove the parallel cable while an application is accessing the DAQpad 1200.
I hope this helps,
Paul C.
12-03-2007 03:50 PM
12-03-2007 08:03 PM
Also, although we have the output hooked up to line 37 which according to the documentation is Port C, line7. The above code only works if the port is set to 0, which correspnds to port A, it doesn't work with the port set to 2, which corresponds to port C. I haven't tried any other ports yet.
12-04-2007 01:06 PM - edited 12-04-2007 01:07 PM
12-04-2007 06:26 PM
12-05-2007 02:05 PM