Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Buffered Event Counting / Trigger

Hello
 
I am writing a program in Visual Basic 6.0 with DAQmx driver 8.1, Have some problem in converting some functions from traditional DAQ to DAQmx
 
1) Buffer operation
 
I would like to do single buffer operation (finite)
 
function in traditional DAQ is
 
  i6602Status = GPCTR_Change_Parameter(i6602DeviceNum, lCounter, ND_BUFFER_MODE, ND_SINGLE)
 
Is there any function in DAQmx to set up single buffer operation?
 
2) I would like to configure the buffer
 
function in traditional DAQ is
 
i6602Status = GPCTR_Config_Buffer(i6602DeviceNum, lCounter, 0, Int(MCS_ChannelsPerSweep.Text), pulBuffer(1)
 
Shd I configure the buffer when i do buffer operation or will be done automatically when calling the buffer operation? If not is there any function in DAQmx to configure buffer operation?
 
3) Setting up hardware trigger and software trigger
 
traditional DAQ function:
 
            Hardware trigger:
 
            i6602Status = GPCTR_Change_Parameter(i6602DeviceNum, lCounter, ND_START_TRIGGER, ND_ENABLED)
 
           Software Trigger:
           i6602Status = GPCTR_Change_Parameter(i6602DeviceNum, lCounter, ND_START_TRIGGER, ND_AUTOMATIC)
 
Is there any function in DAQmx to set up different trigger?
 
 
Thanks
0 Kudos
Message 1 of 4
(3,797 Views)

Hello Rajaram,

There wont necessarily be direct replacement DAQmx functions for each of the functions calls you have made using Traditional NI DAQ. These functions that you have listed configure various parameters of the counter task, and are not the whole picture of setting up the buffered operation. Setting these parameters will form part of creating the task and configuring the timing in DAQmx rather than explicit function calls.

If you can tell me a little more about the type of acquisition you are trying to setup, and I can give you an example or point you into the right direction with the functions.

Regards
Hannah
NIUK & Ireland

0 Kudos
Message 2 of 4
(3,782 Views)
Hello Hannah,
 
Thanks for your response. Ok I understood there s no need for direct replacement of functionality of Traditional DAQ, but with the lack of proper documentation it s not easy to find the way to work around. I have figured out the buffered event counting and its making it synchronous.
 
DAQmxErrChk DAQmxCreateCICountEdgesChan(taskHandleTS, TStaskCounter.Text, "mychan", _
    DAQmx_Val_Edge1_Rising, 0, DAQmx_Val_CountDirection1_CountUp)
   
    DAQmxErrChk DAQmxSetCICountEdgesTerm(taskHandleTS, TStaskCounter.Text, sMyTimebase)
    If ChkContinuous.Value = 1 Then
        DAQmxErrChk DAQmxCfgSampClkTiming(taskHandleTS, PhotonSourceTxt.Text, 1, DAQmx_Val_Rising, _
        DAQmx_Val_AcquisitionType_ContSamps, N)
    Else
        DAQmxErrChk DAQmxCfgSampClkTiming(taskHandleTS, PhotonSourceTxt.Text, 1, DAQmx_Val_Rising, _
        DAQmx_Val_AcquisitionType_FiniteSamps, N)
    End If
    DAQmxErrChk DAQmxSetCIDupCountPrevent(taskHandleTS, "mychan", False)
 
I would like to know the difference between software trigger and software trigger. In my application, hardware trigger is used to wait for the pulse to be generated once it completed its single finite pulse. Software trigger automatically starts the next pulse without waiting for signal to generate the pulse. Is there any way to differenciate these two triggers? or can it be worked out logically?
 
Thanks
0 Kudos
Message 3 of 4
(3,769 Views)

Hello

What do you mean by trigger - do you mean a trigger that will start the counter task off? and the difference between a hardware and software trigger for this?

Or do you mean a pulse train which will determine how the events are counted - so gating the signal, rather than triggering it.

Regards
Hannah
NIUK & Ireland

0 Kudos
Message 4 of 4
(3,737 Views)