03-05-2009 10:53 PM
I have this intermitten problem and have no idea what causes it. Basically I program the PCI-6229 as followed
#define P1AirAllOff 0xC0000; // bit 18 & 19 <- Moved from bit 16-17 so Transducers don't get plugged in 24V
#define P1InOffExhOn 0x40000; // bit 18
#define P1InOnExhOff 0x80000; // bit 19
char chanP1AirCtl[] = "dev1/port0/line18:19"; // inlet & relief
...
// Solenoid Air Input Control
DAQmxErrChk (DAQmxCreateTask("",&P1TaskDOAirCtl));
DAQmxErrChk (DAQmxCreateDOChan(P1TaskDOAirCtl,chanP1AirCtl,"P1AirCtl",DAQmx_Val_ChanForAllLines));
DAQmxErrChk(DAQmxSetChanAttribute(P1TaskDOAirCtl, "P1AirCtl", DAQmx_DO_InvertLines, 0));
DAQmxErrChk (DAQmxStartTask(P1TaskDOAirCtl)); //start the output task
...
and the code to turn it on & off is like this
// Inlet->off, Exhaust->On
AirCtl = P1InOffExhOn;
DAQmxWriteDigitalU32(P1TaskDOAirCtl,1,1,timeOut,DAQmx_Val_GroupByChannel,&AirCtl,NULL,NULL);
do { something here }
AirCtl = P1InOnExhOff;
DAQmxWriteDigitalU32(P1TaskDOAirCtl,1,1,timeOut,DAQmx_Val_GroupByChannel,&AirCtl,NULL,NULL);
...
The 2 bits are used to activate 2 Coto Relay 9001 SPST (5V, 10mA curent) when active low (high off, low on). The relay has 1N4148 crossed the coil as a snubber diode. The problem is after running for a while (like 100 cycles on & off), bit 19 becomes stuck low make the coresponding relay active all the time.There is no way to drive it high to disable the relay, unless I quit the running program, turn off the system, reload & rerun the program again. And the cycle repeats. Weird is I only have this problem with bit 19. If I recall correctly, I have the same problem with bit 17, using bit 16-17 instead of 18-19. Could be the weak pull down suddenly become hard pull down on the DIO? What would be the best way to find the culprit?
Thanks a lot guys.
03-06-2009 03:25 PM
UKnowWhat,
Thank you for posting on the NI Forums. When you say that you have an intermittent problem, how often does this behavior occur? Does the problem always happen every time you run the program? Has this been a problem the whole time or is this something that just started happening? I looked through our database and was unable to find any similar problems to this one. Is it possible to use another bit other than 19 or is it necessary to use that bit?