Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with code for PXI-6533

I am having trouble getting a PXI-6533 to work properly.

I am using NIDAQ V7.4.1 in MS C++ V7.1 (MS VS 2003) under Win2K SP4 with all current updates.

As a test case, I have written the following code and executed it to exhibit the problem.

The basic problem is that I can set an output line high but not low using my code. The test panel in NI MAX operates the line correctly.

The sample code (with error checking removed) is:

  i16 wBoardCode;
  iStatus = Init_DA_Brds(3, &wBoardCode);
  iStatus = DIG_Grp_Config(3, 1, 2, 0, 1);
  iStatus = DIG_Out_Grp(3, 1, 0x8000);
  NIDAQYield(1);
  Sleep(1);
  iStatus = DIG_Out_Grp(3, 1, 0);
  NIDAQYield(1);
  Sleep(1);

The first call to DIG_Out_Grp raises the line. The second call to DIG_Out_Grp does not lower the line.

I must use the "Group" functions because I need to generate clocked patterns on these ports after setting this line.

0 Kudos
Message 1 of 3
(3,343 Views)
Hello Charles.  I have looked at your code and looked at the Traditional NI-DAQ(Legacy) C function reference help.  Your code seems to make sense to me so I'm not completely sure of what could be causing this.  However, I do have a few recommendations.  First, even though this shouldn't impact your code, what happens if you change iStatus = DIG_Out_Grp(3, 1, 0); to iStatus = DIG_Out_Grp(3, 1, 0x0);.  The hex input seemed to work on the first DIG_Out_Grp so making the two functions as close as possible could be beneficial for troubleshooting.  Secondly, instead of using DIG_Out_Grp, we could try using Dig_Block_Out.  This functions help refers to 653x devices explicitly in the help file so maybe this will work better with your card.  You state that you must use the Grp functions, but for troubleshooting purposes, using the Dig_Block_Out could help us understand what is going on better. 
 
I hope this helps!  Let me know if this helps or brings up additional questions!
 
Brian F.
National Instruments
0 Kudos
Message 2 of 3
(3,330 Views)
Brian,

Changing "0" to "0x0" did not help, but changing from DIG_Grp_Out to DIG_Block_Out did. I think I can deal with using DIG_Block_Out in my code, but the change does not make sense. I have used DIG_Grp_Out successfully on other devices.

Thanks for the ideas.
0 Kudos
Message 3 of 3
(3,326 Views)