Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I multiplex scan in code?

I'm using two SCXI 1102/b modules and an NI PCI 6221 card - trying to code in VC++.
 
The manual tells me to use functions like SCXI_SCAN_Setup, and SCXI_MuxCtr_Setup to achieve a multiplexed scan, but I can't find any of these documented properly anywhere.
 
It's possible that they're out of date, but the box only arrived two days ago!  Can someone please point me to the documentation (because Google was not my friend) or tell me what functions I should be looking at?
 
Cheers,
John
0 Kudos
Message 1 of 5
(4,743 Views)
Duplicate of this thread.
Message 2 of 5
(4,730 Views)
Hi John,

The functions you are trying to use are Traditional DAQ function calls. For M-Series devices of which your 6221 is one, you need to use the DAQmx API.

It would be best to make sure you have installed the DAQmx 8.1 driver to check this can you please open Measurement and Automation Explorer (MAX) and go to My System >> Software >> NI-DAQmx. Please make sure this entry is in the list and that the version is 8.0 or 8.1.
If you need to upgrade or install the driver please follow this link to the Drivers and Updates page.

While installing the NI-DAQmx driver please make sure you include C support .
After installation please go to Start >> All Programs >> National Instruments >> NI-DAQ >> NI-DAQmx C Reference Help

This will give you all the functions you can use in DAQmx and also this will give you programming flow charts, to give you the structure of the program you need. The flowcharts can be found in seide the help file at the following location NI-DAQmx Concepts >> NI-DAQmx Help >> Common Applications. From here you have a number of different subcategories to determine what type of flow chart you need to see.

You might also find the examples helpful located at "C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Analog In\Measure Temperature"

In DAQmx you do not need to specifically state a multiplexing function, if you choose mulitiple channels then the driver multiplexes for you. i.e "SC1Mod1/ai0" will only get data from ai0, but "SC1Mod1/ai0:31" will automatically multiplex between all channels on a 1102B board apart from the CJC channel. So it will get data from channels 0 through 31.

I Hope this gives you a good starting point

Regards
JamesC
NIUK and Ireland


Message 3 of 5
(4,729 Views)
Many thanks!  🙂
 
Apologies for the duplicate thread - I really needed an answer urgently, and was worried noone visted the other board!
 
Can I just ask one supplementary question:  If I have two modules, can I get the data over all the channels by specifying the channel string as "SC1Mod1/ai0:31,SC1Mod2/ai0:31", and have a return all into the same block?
 
Many thanks once again!
 
John
0 Kudos
Message 4 of 5
(4,726 Views)
Hi John,

I was not sure of the answer to your previous question regarding the channel string "SC1Mod1/ai0:31,SC1Mod2/ai0:31", I have since tested this in LabVIEW, and proved that you can address the modules this way, so you will be able to do this in VC++ 6, but remember you will need to increase your buffer size.

Regards
JamesC
NIUK and Ireland

Message Edited by JamesC on 07-06-2006 05:01 PM

Message 5 of 5
(4,726 Views)