Determine number of channels on a DAQ card

Is there a function to determine the number of channels on a given DAQ card?

I found no native function to get this attribute; you can use DAQmxGetDeviceAttribute with DAQmx_Dev_AI_PhysicalChans attribute to get a list of available channels on a device and then parse the string counting channels. The following lines can be executed in the Interactive Execution window: provided the device name is correct they count how many input channels are present on the board:
#include <ansi_c.h>
#include <utility.h>
#include <NIDAQmx.h>
static int i;
static char msg[512];
static char *token;
DAQmxGetDeviceAttribute ("Dev1", DAQmx_Dev_AI_PhysicalChans, msg, 512);
i = 0; token = strtok (msg, ",");
while (token) {
i++;
token = strtok (NULL, ",");
DebugPrintf ("# of channels: %d\n", i);
 The same function has equivalent attributes for analog outputs, counters and digital I/O lines / ports.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos?

Similar Messages

  • Can I get a stepper motor to work useing an AO channel on a DAQ card?

    Can I get a stepper motor to work useing an AO channel on a DAQ card? I know its a very low currentl coming out, but what Im going to be using the motor for is very weak. Has anyone tried this before? I certinaly dont want to spend 2,000+ on somthing that will be basicly moving a string on some pullys back and forth.
    Thanks,
    -Mark

    Greetings, Mark
    You can certainly use the A0 as a driving signal, but you need to amplify the current considerably to run a stepper motor. Additionally, most stepper motors require multiple phase driving signals to work properly. If I understand your application, I believe a stepper motor is a bit of overkill...you only want to use them when precise positioning and repeatability is an issue. You might look at some of the linear actuators available.
    Eric
    Eric P. Nichols
    P.O. Box 56235
    North Pole, AK 99705

  • How SCXI modules are multiplexed into one Channel of the DAQ card?

    Hi all,
    I am Sirisha from Hyderabad.
    I am a new to NI hardware.
    take the below mentioned senario.
    Suppose i am using SCXI-1000 chassis with SCXI-1520 and 3 SCXI-1102 modules and PCI-6070E DAQ card.
    now i know that if i connect the DAQ card to the SCXI chassis through sh-6868 cable and 1349 adapter, all channels of SCXI modules are multiplxed into the 0th channel of DAQ card.
    Here i want the detailed explanation of theory of multiplexion on how all the scxi channels go to 0th channel of DAQ card
    Thanks in advance
    regards
    Preetam

    Sirisha,
    Thank you for contacting National Instruments.
    Here is a KnowledgeBase article entitled "How Are SCXI Channels Multiplexed While Having Other Inputs On The DAQ Card?"
    There is a little more specific information about multiplexed mode here.
    Michael P
    National Instruments

  • VI Logger - use of multiple DAQ cards

    How do I configure VI Logger to acquire data from multiple DAQ cards?
    I have set up channels for two DAQ cards but the VI Logger Tasks seems only capable of acquiring from either DAQ card, not both.

    Hi Metronet,
    VI Logger doesn't support acquiring data from multiple DAQ cards.
    VI Logger was a free software tool that came with new DAQ cards up until the end of March. To get customers up and running and acquiring data in the quickest possible time.
    VI Logger however is not LabVIEW, and as such cannot use more than 1 DAQ card at any one time. If you want to acquire from multiple cards then you will need to program in LabVIEW, CVI, Visual Basic or Visual C.
    I am sorry that I have to inform you of this, but NI has no plans to release VI Logger with support for multiple DAQ cards.
    Regards
    James
    Applications Engineer
    NI UK

  • Determine number of selected channels for traditiona​l DAQ

    The blocks of "DAQmx Task" and "traditional DAQ Channel" look quite similar (see attachments). The DAQmx block ist an individual selection of channels and I am able to determine the number of selected channels.
    Now I am trying to determine the number of selected channels of a traditional DAQ, but the DAQmx property block does not work here. I did already try some blocks form the trad. DAQ palette but failed.
    Any idea?
    Message Edited by pgraebel on 07-21-2009 11:31 AM
    Solved!
    Go to Solution.
    Attachments:
    DAQ.png ‏2 KB
    DAQ_frontpanel.png ‏5 KB

    The new attachment is showing channels for traditional DAQ (upper) and DAQmx (lower). You can clearly see a selection of channels inside the traditional DAQ box.
    How do I determine the number of channels? The DAQmx way to do that does not work for the traditional.
    Attachments:
    Clipboard01.png ‏2 KB

  • How to structure the DMA buffer for PXie 6341 DAQ card for analog output with different frequencies on each channel

    I'm using the MHDDK for analog out/in with the PXIe 6341 DAQ card.
    The examples, e.g. aoex5, show a single Timer  (outTimerHelper::loadUI method), but the example shows DMA data loaded with the same vector size.
    There is a comment in the outTimerHelper:rogramUpdateCount call which implies that different buffer sizes per channel can be used.
       (the comment is: Switching between different buffer sizes will not be used)
    Does anyone know what the format of the DMA buffer should be for data for multiple channels with different frequencies ?
    For example, say we want a0 with a 1Khz Sine wave and a1 with a 1.5Khz sine wave.  What does the DMA buffer look like ?
    With the same frequency for each channel, the data is interleaved, e.g.  (ao0#0, ao1#0; ao0#1, ao1#1, ...), but when the frequencies for each channel is different, what does the buffer look like ?

    Hello Kenstern,
    The data is always interleaved because each card only has a single timing engine for each subsystem.
    For AO you must specify the number of samples that AO will output. You also specify the number of channels. Because there is only one timing engine for AO, each AO will channel will get updated at the same time tick of the update clock. The data will be arranged interleaved exactly as the example shows because each AO channel needs data to output at each tick of the update clock. The data itself can change based on the frequency you want to output.
    kenstern wrote:
    For example, say we want a0 with a 1Khz Sine wave and a1 with a 1.5Khz sine wave.  What does the DMA buffer look like ?
    With the same frequency for each channel, the data is interleaved, e.g.  (ao0#0, ao1#0; ao0#1, ao1#1, ...), but when the frequencies for each channel is different, what does the buffer look like ?
    In your example, you need to come up with an update rate that works for both waveforms (1 KHz and 1.5 KHz sine waves). To get a good representation of a sine wave, you need to update more than 10x as fast as your fastest frequency...I would recommend 100x if possible.
    Update Frequency: 150 KHz
    Channels: 2
    Then you create buffers that include full cycles of each waveform you want to output based on the update frequency. These buffers must also be the same size.
    Buffer 1: Contains data for the 1 KHz sine wave, 300 points, 2 sine wave cycles
    Buffer 2: Contains data for the 1.5 KHz sine wave, 300 points, 3 sine wave cycles
    You then interleave them as before. When the data is run through the ADC, they are outputting different sine waves even though the AO channels are updating at the same rate.

  • How to arm channel 1 of a PCI 6133 DAQ card using labview?

    Hi,
    I am new to the Labview and I need some help.  I have a PCI 6133 multifunction DAQ card and I'm using Labview 8.2 to capture five channels waveform data.  I setup channel ai0 to be the trigger channel and I need to capture data from ai0, ai1, ai2, ai3, and ai4 when ai0 is trigger.
    Question:
    1) I am using DAQ assistant to configure my channels.  How can I arm the channel ai0?  I have an "execute button" and it should arm the scope when I click it.
    2) Is there trigger ready signal, so I can save all the channels data when channel ai0 is trigger?
    Can anyone provide some help?
    Thanks

    Hello wirte spreedsheet,
    Thanks for posting to Discussion Forum. It looks like you are using the
    PCI-6133 to acquire analog data from ai0:ai4. You want to use ai0 as
    the trigger for the other channels.
    Does your application need to be retriggerable?
    Are you doing continuous acquisition?
    Are you doing Analog start trigger or reference trigger?
    Take a look the following shipping examples, found in LabVIEW click
    Help>>Find Examples. On the browse tab, Hardware Input and
    Output>>DAQmx>>Analog Measurements>>Voltage:
    Cont Acq&Graph Voltage - Analog SW Trigger.vi
    >> This example demonstrates how to perform an analog software
    triggered acquisition. The example allows the user to specify the
    triggering condition and the number of pre-trigger samples to acquire.
    Cont Acq&Graph Voltage - Int Clk - Analog Start.vi
    >> This example demonstrates how to continuously acquire data
    (Waveform) using the DAQ device's internal clock and an analog slope
    start trigger.
     Take a look at these applications and let me know if you have any questions or comments.
    Have a good day.
     Regards,
      Sandra T.
    Applications Engineer | National Instruments

  • Read/acquire signal from remaining empty channels of NI9205 by modifying the vi of ATI Force/Torque Transducer which uses the first 6 channelsof DAQ card.

    Hello,
    I am using force/torque transducer by ATI Automation. It provides me with its own vi to measure and write the data of the 6 signals (3 axes Forces, 3 axes torques)
    Following is my Ni system: -
    cDAQ 9172 chassis: Slot 5 - NI 9401, Slot 6 - NI 9205, Slot 8 - NI 9237. (Excitation voltage to the sensor/transducer (0-5V) using 9237).
    I connect the 6 signals from the transducer cable to channels ai0,1,2,3,4,5 in NI 9205(differential). The vi uses a calibration 6*6 matrix to finally display the calibrated voltage data.
    Now, I wish to use the remaining availabe channels that empty in 9205, namely ai17, ai18, ai19 for other signal measurements.
    ai17 channel is connected to Hall sensor  that gives out a square waveform corresponding to the rotor rpm. ai18, ai19 is connected to rotor-motor power supply's voltage and current signal respectively.
    But I am not able to access these 17, 18,19 channels from ATI company's vi. The vi loads the complete DAQ card (9205), uses only first 6 channels, hence the array data wire consists of only 6 channels. I can split these into 6 individual signals only.
    If I use a separate DAQ task to read channels ai17,18,19, then I get the error that this channels are reserved for some other task. Please tell me how can I access all the remaining channels apart from the first 6.
    I am attaching the vi here.
    Steps to run the "MEASUREMENT main.vi" : -
    Load calibration file:-  FT8840.cal;
    Load DAQ card: NI 9205
    Load ctr0 of NI 9401 (I am using this counter for rpm measurement purpose, this is my addition to the actual vi) 
    Attachments:
    DAQ - Copy.zip ‏574 KB

    There's nothing I can do to help.  I don't have your hardware to be able to modify your code and to set it up to make sure it runs properly.  Most people on the forum probably don't either.  This is where you'll have to put your programming and LabVIEW skills to work to solve your problem and make it run the way you want to.  If you run into a specific problem and get stuck, then please post back.

  • How do I use two DAQ cards in one Labview code? Current I'm getting error " error 200558 occurred at DAQmx Create Channel.vi. One task cann't contain multiple independent devices". Can someone help me?

    The two DAQ cards are NI PCI-6070E & NI PCI-6052E. The Labview I'm using is labview 7 Express and the Window system is Window XP. I'm using NI SCXI-1000 chasis and SCXI-1102 & 1102B two modules plus a feedthrough SCXI-1180. 1102 is connected through SCXI-1349 cable to DAQ card 6052E while 1102B is connected through SCXI-1349 cable to DAQ card 6070E. SCXI-1180 is connected to 6070E through SCXI-1349 adaptor on the back of 1102B.

    Sarah, thank you for replying my question. It seems that I'm making progress everyday (smile). I'm able to run the test using both daq cards in my code now. But as I'm moving forward, I'm getting new questions too. How do I use one STOP button to control both tasks and how can I save data into one single file?
    I attached my code here hoping you can get the specifics on my application by looking at the code. Thanks very much!
    Thanks.
    Attachments:
    DAQmx_Task_Example_plus_voltage_2.vi ‏416 KB

  • What is the maximum number of samples that can be acquired with a single trigger using PCI-6036E DAQ card?

    1. My PCI-6036E card has a FIFO of 1024 bytes in AI. Maximum how many samples can be acquired with single trigger for digitizing a waveform?
    2. PCI-6036E DAQ card has got a AO with 10ks/s update rate? Can I generate a pulsed output with the AO of this card? I need a pulse of, say, 5 V and 1 kHz frequency.

    Giri,
    1.The trigger is usually for enabling the acquisition. I mean, when it is logic zero, you acquire nothing; however, when it is logic one, you start acquiring your waveform,and you can acquire continuously without having to worry about how many samples, unless you want to set your program for doing so. You can acquire continuously by implementing buffer acquisition. Finally, the FIFO that is in the board will not affect the buffer acquisition.
    2.Yes, you can do that! You can generate your 5V signal with that specific frequency, and you should not have any problems, because the freq fits in the update rate.
    I hope this information is helpful.
    L Aguila
    Applications Engineer
    National Instruments

  • How to acquire data from 2 chs of the same DAQ card at different sampling rate

    I am using single DAQ card (either 6013 or 6014) in my system i want to acquire data from 2 (or more) channels with following requirements
    1. sampling rate of each channel should be independant of each other (say one is 20 Hz and other is 15 kHz)
    2. data from all the channels should be acquired simultaneously.
    3. coding must be done using DAQmx VIs
    I have tried out following things
    1. I created separate task for each channel: i found out that two tasks can not run simultaneously even though the channels are different
    2. I tried out single task with two channels included in it. and i used 'channels to Read' property to determine from which ch. i want to acquire data: this method works fine if the sampling rates are same. but if i change the sampling rate of one channel it gets reflected in other channels as well.
    can somebody help me out to solve this problem.
    i will appreciate if somebody can post the sample code as my deadline is approaching
    Tushar Jambhekar
    [email protected]
    Jambhekar Automation Solutions
    LabVIEW Consultancy, LabVIEW Training
    Rent a LabVIEW Developer, My Blog

    Hi Dennis Knutson
    Thanks for your suggestion.
    Tushar Jambhekar
    [email protected]
    Jambhekar Automation Solutions
    LabVIEW Consultancy, LabVIEW Training
    Rent a LabVIEW Developer, My Blog

  • How can I create software start and stop trigger in LabView using 6023E series DAQ card? I don't want to use the external trigger.

    I am using 6023E DAQ card to collect the signals, such as AE, Force, Torque from the machine. I want to collect only some part of signal for example between start triger and stop trigger. I'd like to know how I can creat those triggers in LabView from one of the channels that I am acquiring at the same time. I found one or two library file that is only for start trigger. I know that this is availabe in some of DIAdem functions. Please let me know if you have done some example for this requirement.

    If you are wanting to create a software trigger based on an analog input voltage in LabVIEW, there are several options. One suggestion would be to compare the voltage values from one input channel to a number within a loop. If the input voltage crosses that threshold (is greater than the number), have a case statement that will acquire data from the other channels. This would simulate a software start trigger in LabVIEW.

  • How can I connect the output of a force transducer unit(BNC cable) to the PCI-6036E DAQ card via the SCB-68 block connector?

    I m using the 404A force transducer unit by Aurora Scientific and i want to connect the (converted to Volt) output, which is a BNC cable, to the PCI-6036E DAQ card via the SCB-68 connector block, facing difficulties in choosing the correct input mode for my signal(couldn t clear this using the manual), setting the switches and which channel shall i use in the block connector in order to configure ot with LABVIEW

    Hi MSc Student,
    Connecting your transducer to the 6036E card via the SCB-68 connector block should be pretty straight forward. You have 2 choices of input mode, Referenced Single Ended (RSE) this is where you will connect the screen of the BNC cable to a ground connection for the DAQ card in the SCB-68 and the other to any analogue input channel . These are listed in the device pinouts in the help section of MAX, under the 68 pin devices section. The terminal block numbers correspond to the DAQ card's pin numbers. Another method, which avoids ground loop problems would be to use the Differential connection and connect the signal and ground connections of the BNC cable to a differential analogue input, these are listed in the 6036E manual and in th
    e MAX help section again. the disadvantage to using this method is 2 analogue input channels are used and you must use the lowest 8 analogue input channels for differential inputs.
    The switch settings that you need can be found in the manual for the SCB-68 in table 2-1, the manual can be found here : http://www.ni.com/pdf/manuals/320745b.pdf
    The switches are for power to extra signal conditioning and the cold junction compensation for thermocouples which in your case you do not need so set the switches to the positions in the first box ie Direct feedthrough, with temperature sensor disabled and accessory power disabled. The channel you use should not matter the only ting to remember will be that if you use differential mode measurement that you will be connecting the signals to AI(n) and AI(n+8) so differential input 0 is across the connectors for AI0 and AI(8). The channel numbers corespond to the analogue input number for the card.
    I hope this information helps,
    Chris M
    App
    lications Engineer, National Instruments

  • Accessing DAQ-Card 1200 in LabVIEW?

    I configured Daq-Card 1200 in MAX, set the input and output values and so on. How can I now access the card in LabVIEW. Should there be maid any additional configuring under LabVIEW since first time I set up in and out values in MAX there was a place I could set different values to different channels but this time the configuration window lacked many things it used to have.

    When you configure the device in MAX, MAX assigns Device Number to the DAQ Cards starting with 1.
    In labview you can open up DAQ example and run it by specifying correct device number and channel number from which you want to acquire data. You do not need special configuration in labview.
    Hope this helps
    A Rafiq
    National Instruments
    http://www.ni.com/ask

  • Capturing data instantane​ously after condition is met using 2 DAQ cards

    Hi all,
    I am wanting to sample a pulse and a sine wave at a low frequency of 1 kHz point by point sampling and upon a condition being met - the leading edge of the pulse being greater than a certain value - I the want to take a certain number (here 270) of samples of the sine wave at 50 kHz, multiple samples. I am doing this within a case structure and using a separate DAQ card. 
    The problem is that when the conditon is met is does not capture the data at the higher frequency straight away. It misses part of the sine wave before commencing capturing the 'window' of the 270 samples of the sine wave at 50 kHz. I want to know if there is any way of speeding this up? I am aware that using an FPGA could help but I don't have access to one. 
    The other solution would to advance the condition, i.e advance the pulse train by a certain amount so that I compensate for the delay in activating the high freq capture. I would need to set up this advance of the pulse train so that, after the delay in activation, it captures the data exactly where it is required to. What would be the best way to do this? I could delay the pulse train by a certain number of samples/ or delay the sine wave, or I have read that you can use the sample timer/counter within the DAQ card to change the 'trigger of the pulse train'. How would I implement this?
    Attached is my vi. I would be very appreciative if you could help. 
    Attachments:
    2 DAQ cards Low and High Freq Sampling.vi ‏29 KB

    I do not have DAQmx or any suitable DAQ devices so I have not tested this.
    This is a start on cleaning and speeding things up. Note that writing to the front panel indicators at 1 kHz will not work because the screen update rate is on the order of 50-100 Hz. Also charts take a considerable amount of computation beacuse they need to (1) store data in the internal buffer, (2) erase old data if the buffer is full, and (3) (slowest) recalculate all the pixels in the display for the updated data. The cart should be moved to the parallel loop. The condition True boolean will only be true for about 5 ms out of each 100.  Look at the 5 ms boolean.vi  attached. It runs close to 1 ms per iteration. The boolean is true about 5% of the time but I never see it change. Remove that boolean from your VI.
    With continuous sampling on the pulse channel and reading 1 sample every millisecond (assuming you get that fast) when the high speed sampling occurs it takes 5.4 ms to acquire the 270 high speed samples. So, ten times per second the loop takes >= 6.4 ms for an iteration. The next sample it reads from the pulse channel is the one which was measured (acquired) at 1 ms after the previous sample. Thus, this data point is read ~5.4 ms after it actually occurred. The next time you detect a pulse, it will be 5.4 ms late. The second one will be 10.8 ms late. Eventually you will get a buffer overflow, but your data will be useless long before the error occurs.
    The Dual Sampler Simulator.vi shows a possible approach to the issue. It simulates sampling both channels at high speed.  I generate both a sine wave and a square wave and sample both at 50 kHz. It simulates reading 4000 samples at a time (equivalent to reading 12.5 times per second or every 80 ms). The square samples are then processed for the transition using the boolean Implies function. I do not recall whether the Conditional terminal was available in LV2012. I did not get an error when saving for previous version so I think it will be OK. The same thing can be done with a while loop with some extra logic.  This does not handle the case where the transition occurs at the boundaries of the 4000 sample segment. To handle those cases use a shift register on the outer loop to pass the needed samples to the next iteration. The 800 ms Wait makes it run slower than "real" time but allows you to see what is happening.
    Lynn
    Attachments:
    2 DAQ cards Low and High Freq Sampling.2.vi ‏26 KB
    5 ms boolean.vi ‏10 KB
    Dual sampler simulator.vi ‏15 KB

Maybe you are looking for

  • Dynamic File Name on Receiver Side using XSLT mapping

    Hi,   My scenario is a Proxy to File scenario.The File on the receiving side is a TEXT file generated due to XSLT mapping. The file name has to be dynamic like- TEST<DDMMYYHHMMSS>File.DAT. If somebody knows how to do the same please help. Regards Rit

  • Standard Queries

    Hi All, How to find the standard queries in SAP BI related to specific module like FI. How to install that queries? If you have SAP FI standard queries, Please let me know. thanks, KN

  • Event for reversing the write off document

    Hi All, Can anyone suggest me the event that I should enhance for our requirement which is when a incoming payment comes in system should first check whether there is any write off document and if there is then write off document should be reversed a

  • ORA-01017: invalid username/password; logon denied error...Help Please!!!

    when I log into either a Unix server or a windows server, I use the same account GILLR, and as such I created an account in the DB as OPS$GILLR and issued the follwing command: CREATE USER OPS$GILLR IDENTIFIED EXTERNALLY DEFAULT GRANT CREATE SESSION

  • BB 8350i is slow (not network connetion)

    My Blackberry 8350i (on Nextel) is so incredibly slow sometimes that it is almost unuseable. This is not the Nextel network connection, it is the phone itself. I will roll the trackball and at least 50% of the time, it's literally 2 or 3 seconds befo