11-06-2007 11:27 AM
11-07-2007 03:28 PM
Hi UTvol,
To get the counter to work, search the .NET help (Start » All Programs » National Instruments » NI-DAQ » .NET Framework 2.0 Help) for “create angular” (make sure you’re looking at “local support”) and you’ll be able to find the right CI channel method.
To get the counter to read at the same time as the analog input, you’ll want to share the analog input sample clock. The syntax for the sample clock is “/devx/ai/sampleclock”, where ‘x’ is the number of your device in Measurement & Automation Explorer (MAX).
The signals A and B from your encoder need to be connected to the correct pins for your device. The pinout is found in the user manual or in MAX by right-clicking the device and selecting “Device Pinout”.
I have no experience using VB .NET with Access, but I did a Google search (“vb .net create access table” or similar) and found a few links that might be helpful:
http://www.dotnet4all.com/Dot-Net-Books/2004/08/creating-table-in-access-database-with.html
http://www.vbforums.com/showthread.php?t=251384
http://www.thescripts.com/forum/thread369481.html
There is a property node for the total samples per channel acquired that you can combine with the iteration count of the while loop to stop it when it reaches that number (or greater than that number to be safe). This would be OR’ed to the stop terminal. As there are several methods used in VB .NET to perform the read operation, this may be done in different ways, and there might be a better way. That’s just the way I would do it.