Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

daqmx dotnet multiple devices simultaneous sampling

NI documentation implies in several places that DAQmx will allow simultaneous sampling of AI channels across multiple devices assuming that the user has certain hardware.  In my case I have S Series hardware, two PXI 6123 modules, each of which has 8 channels.  According to the documentation, S-series devices qualify. 
 
Using VB6 and DAQmx I have been able to simultaneously sample all 16 channels using two tasks, one for each module, and synchronizing the tasks with a routed trigger.  And I presume with enough effort, like that already expended to convert from VB6 to VBNet, I could do so in VBNet.
 
Yet DAQmx claims that it is possible to use multiple devices and that it will route the triggers automatically.  I assume this means that I can create just one task and add all 16 channels to it.  But when I attempt to add channels from different modules to a single task, any channels from different devices result in the exception:   "Duplicate channels in the list of physical channels are not supported by this device."
I have been unable to find any examples on the entire NI site that address this issue.  Does anyone have any hints?
 
 
 
0 Kudos
Message 1 of 10
(4,469 Views)
You can not combine channels from multiple boards into one task, so I guess what you did was the right way: You have to create one task for every board, and set the timing-options in a way, that all cards use the same sample clock.
This topic is discussed in this thread as well:
http://forums.ni.com/ni/board/message?board.id=232&message.id=525&requireLogin=False

You can find an example attached to this message.

Hope this helps!
0 Kudos
Message 2 of 10
(4,466 Views)

Hi All-

Actually, with NI-DAQmx 8.1 and later multi-device tasks are supported for S Series.  You need to specify your channel list as "Dev1/ai0:7, Dev2/ai0:7" or similarly for the two devices.  The only other requirement is that you have your PXI chassis (or RTSI cable) configured in MAX.  With these settings there is no difference between programming for multiple S Series cards; any internally clocked AI example should work fine.  Please post the channel/task creation portion of your code so we can help identify what is causing the error.

Thanks-

Tom W
National Instruments
0 Kudos
Message 3 of 10
(4,454 Views)

Here is code: 

The hardware is two PXI-6123 modules in a PXI-1031 chassis.  Daqmx is DAQmx 8.1.0f1.

Perhaps 6123 modules are not considered "S Series" by Daqmx?

----------------------------------------------------------------------------

Private

Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim mTask As DAQmx.Task

Dim mChannel As DAQmx.Channel

Dim s As String = ""

Dim x As Double = 5 'Full scale volts

mTask = New DAQmx.Task()

's = "dev1/ai0:7" 'This works OK

's = "dev1/ai0:3, dev2/ai4:7" 'This works OK

's = "dev1/ai0:3, dev2/ai0:3" 'This creates error: 'duplicate channels'

s = "dev1/ai0:7, dev2/ai0:7" 'This creates error: 'duplicate channels'

mChannel = mTask.AIChannels.CreateVoltageChannel(s, "", DAQmx.AITerminalConfiguration.Differential, -x, x, DAQmx.AIVoltageUnits.Volts)

0 Kudos
Message 4 of 10
(4,451 Views)
Hi DaveG-
 
The PXI-6123 (and all PXI- and PCI-61xx) modules are considered S Series by NI-DAQmx and support the multi-device tasks.  I was able to create a task with two simulated PCI-6123's and a RTSI cable and did not receive any errors.  The code snippet you provided looks correct- can you please post your .sln and associated files?  I'd like to compile a test system and try it on my end.
 
Thanks a lot-

Message Edited by Tom W [DE] on 07-17-2006 02:15 PM

Tom W
National Instruments
0 Kudos
Message 5 of 10
(4,449 Views)
Tom,
 
I too was able to create two simulated 6123 devices and the code worked fine when I used those devices.  But any time a channel in either of the two physical 6123 devices is the same as a channel in another 6123 device (either physical OR simulated), the error occurs.  DAQmx does not seem to like my physical devices.  I have attached the code as you requested but it is extremely simple and I do not think that is the problem.  It seems like an incompatibility between my physical devices and DAQmx.  I think you are going to have to try it with physical devices instead of simulated devices to find the error.
 
Dave George
970 263 9714
 
0 Kudos
Message 6 of 10
(4,444 Views)

Hi Dave-

Thanks for the additional info and sample code.  I have attempted to replicate the issue with physical hardware on my end in both VS2003 and VS2005 and have not been able to reproduce.  I am leaning toward thinking that there may be some version mismatch or software corruption on your end.

Are you able to create a multi-device task in MAX?  The easiest way to do this is open the test panels for a single device and manually enter Dev1/ai0:7, Dev2/ai0:7 into the physical channel field.  You will also need to adjust the timing parameters to select continuous timing.  Whether this works or not, I would suggest that a software reinstall is in order to ensure that all the driver components are up to date.  You will need to uninstall NI-DAQmx from the control panel Add/Remove Programs utility and then reinstall NI-DAQmx 8.1 from here.  It may also be helpful to install NI-DAQmx to a different "clean" machine to check if you're able to see better results.

Keep us posted on how it works out.  Thanks-

Tom W
National Instruments
0 Kudos
Message 7 of 10
(4,418 Views)

Rebuilding NI software, YET AGAIN, fixed the problem.  I infer from various clues that it was apparently an incorrect version of NIDAQCommon.dll.  VS2005 had complained about an our-of-date version of something unidentified.  It fixed itself by adding an entry in its app.config file. 

Please excuse me while I vent a bit.  I think I have spent half my recent life installing, uninstalling, installing, uninstalling, re-uninstalling and re-installing NI software trying to get installed versions that were compatible with each other.  AND IT IS NOT A TRIVIAL TASK TO SIT AROUND AND WAIT WHILE NI INSTALLERS REMOVE AND THEN REPLACE 70 OR 80 TASKS.  I believe I could install an entire Windows operating system faster.  At first all I wanted was a version of Traditional NIDAQ that was compatible with a new version of DAQmx so that I could adapt my 'old' software first to DAQmx and next to VS.Net.  That was a non-trivial task and NI software continued to complain that I hadn't purchased Measurement Studio.  Somewhere along the way incompatible versions of NIDAQmx.dll and NIDAQCommon.dll got installed. 

Even with this latest install in which I cleaned up EVERYTHING that even smelled of starting with "NI," and then installed just NIDAQmx with support for VB6, VisualC, and MSNetFramework 2, then MAX still complains of a missing license when installing a test task in MAX to see if the problem was acceptable to MAX.  The license is bypassable and MAX now showed that I could indeed use multiple modules in a single task. 

I hope that NI is working actively and seriously on their version control and compatibility problems, especially the installation process.

Thanks for your help Tom.  That part of this case was nice.

Dave

 

0 Kudos
Message 8 of 10
(4,397 Views)
Hi Dave

Sorry about the problems that you saw here. This is not something we have seen before nor were we able to replicate the issue.

The issue about NI.Common is documented in this KB. It should not have affected the runtime behavior of your application since this is just a warning by VS 2005 (it did not happen with VS 2003). We use policy files installed in the GAC to automatically use the correct version of the library and you should have all the correct versions in your library.

Also, can you make sure that the assembly references that you are picking up in the project are coming from C:\Program Files\National Instruments\MeasurementStudioVS2005\DotNET\Assemblies\Current\ and not from the GAC? You can check this by right-clicking on the assembly refernce in the project and looking at the path property. The path should not look like c:\windows\assembly\...

Can you tell me what versions of DAQ you had installed prior to 8.1? I suspect this might have been some weird upgrade scenario that we missed.

This will help us ensure we avoid problems like this in the future.

Thanks

Bilal Durrani
NI
0 Kudos
Message 9 of 10
(4,372 Views)

The new system I purchased was delivered in early June.  DAQmx v8.0 was shipped with it as well as a device driver disk.  Since I already had a fully debugged application written in VB6 and Traditional NIDaq, for a previous system, I wanted to simply upgrade that application to the new system.  My first attempt was to load and execute the old application even though Traditional NIDaq was not supported for the ADC modules (PXI 6123) in the new system.  Perhaps my fault, perhaps not, I found it extremely difficult to install Traditional NIDaq along side of DAQmx even NI documentation clearly states that it is OK to do so.  Traditonal NIDAQ (specifically NIDaq32.dll) would seemingly appear and disappear dependent on what else was installed.  As I said previously, I spent at least one full day just installing and uninstalling DAQmx, Tradional NIDaq, various NI modules (that I don't use) such as Visa.  I even painfully downloaded a trial version of Measurement Studio to attempt to get a working version.  I also painfully upgraded everything to the latest versions.  Eventually I was able to run Tradional NIDaq along side of DAQmx and I was able to make a working version of my application using VB6 and DAQmx but I used separate DAQmx tasks for each module.  My next step was to attempt to upgrade that application to VB.Net and in doing so I learned that DAQmx v8.1 would support multiple modules per task.  That is when the difficulties started that are posted in this thread.

So I can't tell you exactly what was installed and in what order and in what version.  I can only say that several versions were installed and uninstalled and installed and uninstalled and installed and uninstalled.  From the preponderance of threads on this site with similar problems (which I read as I was having my difficulties with installation) I believe my experience is not rare nor "weird."  I can only say that NI software and its dependencies and its versions and its documentation has been difficult for me to follow and verify.

 

 

0 Kudos
Message 10 of 10
(4,349 Views)