03-17-2009 07:25 AM
I've been using Traditional DAQ and MS VS 6.0 (VB) for years. And now I try to more to DAQmx and MS VS.NET 2003. It seems that the DAQms is not convenient.
(1) To use digital I/O in traditional DAQ, just simply call DIG_In_Line/DIG_Out_Line. But using DAQmx, I have to do 1. task, 2. channel, 3. reader/writer, etc.
Question: How to make a generic digital reader/writer using DAQmx&VB.NET. There 24 DI and DO lines, and I want to use them ramdomly in rondam. Do I have to declare 24 DI channels and readers (and same for the DO lines)?
(2) Same question for analog (I have PCI NI 6527 and 6024E).
Thanks
03-18-2009 11:28 AM
Hello PIGM,
so you are correct in that in Traditional daq there were 'easy' I/O functions, but these comprised directly of the advanced functions which do exactly what DAQmx does. We had to standardize with the 'advanced palette' when we moved to DAQmx because the main issue we were seeing is that you couldn't switch between using the easy and advanced functions easiy. DAQmx no has one set of function calls and that includes creating a task/channel then configuring that task, read/write then close the task after completion.
If you are interested in seeing examples of how to do this please look on your machine: ...\National Instruments\NI-DAQ\Text-Based Code Support. Choose the proper coding environment and navigate to see which examples apply best to you!.
Let us know if you have any other questions.
03-18-2009 12:43 PM
Hi,
Thanks for the response.
(1) (To confirm)So, I do have to create 24 DI Channels, readers in order to use individual DI line in PCI 6527 in random?
(2) When I tried the example code in: C:\Program Files\National Instruments\MeasurementStudioVS2003\DotNET\Examples\DAQmx\Digital\Read Values\ReadDigChan_ChangeDetection_DigFilter\vb
I changed the task time out value to: myTask.Stream.Timeout = -1 (because the event that I want to measure is a ramdom event). The issue is, however, that the task will not be abort by using Task.Control(TaskAction.Abort), Task.Control(TaskAction.Stop) if the event does not come, and I have to use Device.Reset. Did I use it right?
03-19-2009 11:22 AM