Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

active low output mode on 660x?

Is it possible to configure the counters on the 6602 to be idle high/ active low?
 
I currently have an application doing single pulse generation: the output is low when the board is initialized, low after trigger of the counter until the delay count is reached, then high for the duration of the pulse width count. I would to change the program that configures the board (traditional NI-DAQ from a Delphi program) so that some outputs of the board are high after board initialization and are only pulled low during the pulse width count. Possible? Hints on how to do it?
 
thanks, dean
0 Kudos
Message 1 of 5
(4,596 Views)

Hi Dean,

This forum will answer your question. Have a great weekend!

David L.
Systems Engineering
National Instruments
0 Kudos
Message 2 of 5
(4,579 Views)
Taking hints from the forum posting referenced by David, it looks like the command for active-low counter output in "traditional" programming would be:

status := GPCTR_Change_Parameter( deviceNum, gpctrNum, ND_OUTPUT_POLARITY, ND_NEGATIVE );

I haven't been able to test this yet!

dean
0 Kudos
Message 3 of 5
(4,505 Views)
I'm finally getting around to implementing this active-low output modification in our code. What I have found to work is something like the code below. This seems to be a minimal set of commands to get an output to invert, i.e. if one of these is eliminated, it no longer works.

I'm surprised that  so many seemingly unrelated commands are needed just to invert the output of a counter. I have two questions:

  • is this really a minimal set of commands to switch the state of a counter output, if not, how can it be done more simply?
  • is there some documentation on this somewhere?
TIA, dean

procedure SetOutputPolarity(
gpctrOutput, gpctrNum : cardinal; invert : boolean );
var
   polarity  : cardinal;
begin
   if invert then
      polarity := ND_NEGATIVE
   else
      polarity := ND_POSITIVE;

   { Stop the counter doing whatever it is doing now:
   }
   GPCTR_Control(CBSyncDeviceNum, gpctrNum, ND_RESET);

   { Set the application: a single output pulse after a delay:
   }
   GPCTR_Set_Application(CBSyncDeviceNum, gpctrNum, ND_SINGLE_PULSE_GNR);

   { Set polarity:
   }
   GPCTR_Change_Parameter( CBSyncDeviceNum, gpctrNum, ND_OUTPUT_POLARITY, polarity);

   { Enable output:
   }
   Select_Signal(CBSyncDeviceNum, gpctrOutput, gpctrOutput, ND_LOW_TO_HIGH);

   { Get the counter ready for the arm command:
   }
   GPCTR_Control(CBSyncDeviceNum, gpctrNum, ND_PREPARE);
end;


0 Kudos
Message 4 of 5
(4,272 Views)
 

Hi,

Unfortunately DAQ drivers are not supported under Delphi, it can be used but the only information you can find about using DAQmx or Traditional under Delphi are from customers discussion forums and a couple of National Instruments knowledgebase’s.  

Although information is minimal I have some pointers, you are probably in a very advance stage of your project and changing API at this point would be a mistake; but for further implementations there are some knowledge bases on using DAQmx on Delphi, such as How Can I Use the NI-DAQmx ANSI C Function Library with Borland C and Delphi?

Another point; it seems to me you are trying to implement something like this:  Events >> Counter Output Event >> Output Behavior:  “Specifies whether the exported Counter Output Event pulses or changes from one state to the other when the counter reaches terminal count. Upon reaching terminal count, the counter can issue a pulse. Use Polarity to select a high or low pulse. For the C reference this is the function needed to change it idle state: “DAQmxSetExportedCtrOutEventPulsePolarity”, it is located in the NI-DAQmx reference help, even though you are not coding in DAQmx it might give you a hint to find the minimum functions needed to accomplish this task.

I hope it helps

Jaime Hoffiz
National Instruments
Product Expert
0 Kudos
Message 5 of 5
(4,256 Views)