I used the NIDAQ legacy driver before. All you have to do is include the library file in the VB project setup, and you can call the DIO card specific functions.
First, on the InitDiag routine, I setup Inputs and Outputs. What channels are used as inputs and outputs.
Then I used a OnTimer to periodically monitor any activity on the input channels. There is a NIDAQ function that periodically returns an array (Index is CH number) with 0's and 1's. I call this timer every 20ms or so, so the response appears to be instantaneous. If none of the channels are being triggered, this array contains something like
0000000000000000000.
IF the array is
0001000111000000000
Then CH4,8,9,10 are trigerred. Then there is 20 or so IF-THEN statements that calls some other function that does something else.
On Output side, there is a function that's like CHANNEL(CH,STATUS).... if I call CHANNEL(21,1) then it turns on the channel 21.
It's pretty simple. I am not a computer programmer, and it took me a day to write a complete application. Jimmy you sound like you are an electrical engineer, it'll take less than 2 hours for you to figure it out.
Thanks for the circuit info. Really appreciate it.
There is one MAJOR problem though. The ISA version's driver does not support WinXP. It works with NT, 2000 and below, but not with WinXP.



LinkBack URL
About LinkBacks

Reply With Quote


Bookmarks