02-11-2003 04:33 AM
02-12-2003 11:15 AM
02-13-2006 03:06 PM
02-14-2006 06:00 PM
Hi PIGM-
Can you elaborate on what happens when you try to use the other events? How exactly do they "not work?"
You may also be interested to know that change notification is supported for the NI 6527 with NI-DAQmx, and it's considerably easier to work with than Traditional (Legacy) NI-DAQ. I have attached an NI-DAQmx example to this message.
02-15-2006 10:19 AM
Thank you for your response.
(1) What happened is that: I used the code (refer to the link above) using tradition DAQ which works well, however, if I changed the event from MouseMove to MouseUp/MouseDown/KeyPress, it just does not work.
(2) I will think about transfering to DAQmx.
So, In tradition DAQ, Does the "Change Detection" work only on the single event of "MouseMove"?
Regards.
02-16-2006 04:17 PM
Hi PIGM-
I'm still not clear on how it doesn't work. Do you simply never see the event fire? Are you modifying the event both in the target form as well as the host form? You will also need to update the notification values (i.e. Const WM_MOUSEMOVE = &H200 only applies to a MOUSEMOVE event). Some googling for the various event names should turn up the values for those notifications (for example, Private Const WM_LBUTTONDOWN As Long = &H201).
Hopefully this helps-
02-17-2006 07:23 AM
Thank you for your response,
What I did is:
1. In Form1,
Const WM_MOUSEUP = &H210
DIG_Change_Message_Config 1, 0, "0.0", "0.1", EventSinkForm.hWnd, WM_MOUSEUP, 0
DIG_Change_Message_Config 1, 1, "0.0", "0.1", EventSinkForm.hWnd, WM_MOUSEUP, 0
2.In EventSinkForm
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Form1.Callback
End Sub
Then the event has never been fired.
02-17-2006 07:43 AM
Hi, Tom,
surprise!
I read your code about "change detection" using DAQmx, and found that It is NOT driven by interrupt/event like the one using tradition DAQ.
Can you give piece of code about REAL change detection using DAQmx dirven by interrupt/event?
Thanks.
02-20-2006 12:04 PM
Hi PIGM-
Actually, the first example I posted does use change detection (i.e. hardware-timed latching of new data on a change of value). You seem to be actually asking about an example of change notification (software-timed callback/event response to a change); a good NI-DAQmx example to get you started would be the ANSI C NI-DAQmx Events example "C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Events\Signal\Change Detection\Read Dig Chan-Change Detection Event"
Hopefully this helps-
02-20-2006 12:20 PM
Hi, Tom,
Thank you very much.
You are right that I am looking for "Change Nodification" which is driven by Interrupt/Event.
The condition to me is that I have to use Visual Basic due to the other equipment (not NI ones), currently I am using the code from NI in which there is a form EventSinkForm, and I met some issues like I mentioned above.
And for the NI cards I have (PCI 6527, PCI 6024E), it seems that it is the only way to work with interrupt/event driving code in VB (I got confirmation that I can not use Generic DAQ Event controls for them.)
So, could you give me the sample code about "change nodifiction" using DAQmx in VB? (C code does not help becuase the callback routine issue.)
Thanks.