Discussion:
Using Data Transfer Mechanism IRQ in VB 6.0
(too old to reply)
Raidoh
2007-12-17 22:10:17 UTC
Permalink
I'm trying to configure my NI-USB-6211 to watch for a digital input as an interrupt request instead of an on-demand sample. I'm using Visual Basic 6.0. I've identified the DAQmxSetDIDataXferMech function and the DAQmx_Val_Interrupts value, but the help files I have refer to C code instead of VB code.From Help:int32 __CFUNC DAQmxSetDIDataXferMech(TaskHandle taskHandle, const char
channel[], int32 data);So far, I get an "= expected" error when I try to use it in my code:Private Sub SetupTriggerDAQ()    Dim sampsPerChanRead As Long    Dim data As Long    Dim numBytesPerSamp As Long    Dim bufferSize As Long    Dim channelList As String * 255    Dim arraySizeInBytes As Long    Dim readArray() As Byte        On Error GoTo ErrorHandler        arraySizeInBytes = 1        'Can be changed to read more digital channels    bufferSize = 255        '  Re-initialize a dynamic array to hold values read off the digital lines    ReDim readArray(arraySizeInBytes)         'Load the DAQmx task that was created in NI-DAQ MAX    DAQmxErrChk DAQmxLoadTask("TriggerDigIn", TriggerHandle)        'Start the task running and read from digital lines    DAQmxErrChk DAQmxStartTask(TriggerHandle)    DAQmxErrChk DAQmxReadDigitalLines(TriggerHandle, 1, 10#, _        DAQmx_Val_GroupByChannel, readArray(0), arraySizeInBytes, _        sampsPerChanRead, numBytesPerSamp, ByVal 0&)    DAQmxSetDIDataXferMech(TriggerHandle, "DigitalIn",  DAQmx_Val_Interrupts)        If readArray(0) <> 0 Then        bTrigger = True    End If        DAQmxClearTask (TriggerHandle)    Exit Sub    ErrorHandler:    MsgBox Err.Number & " " & Err.Description, , "Error"End SubAttached is the MAX task that is loaded, should that be of any use. Your help is appreciated. Thanks,Chad
MikeA
2008-04-04 15:10:11 UTC
Permalink
Guys,
I have similar problem that I need help with. I need to use interrupt on a given INPUT PIN that notifies my program about its status change. I am using VB6 platform. Would appriciate any clues.
Thanks,
MikeA
Raidoh
2008-04-04 15:40:11 UTC
Permalink
Sorry. I never got this command to work for me. I just ping the digital signal often to look for a change of state. Good luck.
Chris_D
2008-04-07 15:10:12 UTC
Permalink
Hey MikeA,Can you give more details about what problems you are having with the function? Are you getting a "= expected" error similar to what Raidoh was getting? Also, can you post the exact error message you are receiving if so?
Loading...