How to read multiple channels based on the external clock

Hello

Normal 0 false false false MicrosoftInternetExplorer4 / * Style Definitions * / table. MsoNormalTable {mso-style-name: "Table Normal" "; mso-knew-rowband-size: 0; mso-knew-colband-size: 0; mso-style - noshow:yes; mso-style-parent:" ";" mso-padding-alt: 0 to 5.4pt 0 to 5.4pt; mso-para-margin: 0; mso-para-margin-bottom: .0001pt; mso-pagination: widow-orphan; do-size: 10.0pt; do-family: "Times New Roman"; mso-ansi-language: #0400; mso-fareast-language: #0400; mso-bidi-language: #0400 ;} "}

I use 6254 multifunction for playback of tension with VC ++ 6 as the development tool.

Based on the documentation NOR I created tasks like this.

DAQmxCreateTask (_T ("Voltagetask"), & taskHandle);

DAQmxCreateAIVoltageChan(taskHandle,sChannels,,DAQmx_Val_NRSE,0,10,DAQmx_Val_Volts,);

DAQmxCfgDigEdgeStartTrig (taskHandle, "PFI2", DAQmx_Val_Rising);

DAQmxCfgSampClkTiming(taskHandle,"PFI2",303000,DAQmx_Val_Falling,DAQmx_Val_FiniteSamps,nSamples);

DAQmxStartTask (taskHandle);

After the generation of clock finished thanks to the DAQmxReadAnalogF64 function, I tried to read samples of each channel.

DAQmxReadAnalogF64 (taskHandle, DAQmx_Val_Auto, 10, DAQmx_Val_GroupByScanNumber, read, m_nStates & sampsPerChanRead, NULL);

Total number of samples (nSamples) available in the buffer when the task is created with a single channel and several channels are still to come as even. In several modes of channel returns total sample by channel, which is equal to the total number of samples divided by the number of channels at once.

For example, if a total number of clock 8000

With single channel, it reads all the 8000 samples (m_nStates = 8000, sampsPerChanRead = 8000)

When two tracks he read 4000 samples per channel and so on. (m_nStates = 8000, sampsPerChanRead = 4000)

If any body know, on every clock how to take samples of all of the configured channels.

Thanks in advance,

Renjith.

Renjith,

Please note that the behavior, I explained is in line with the provisions should only if you use your clock as I convert clock. You can find information about the different types of synchronization of the analog inputs using NOR-DAQmx; the element to search for is "clocks".

Since you do not set the clock to convert MY (should be DAQmxSetAIConvSrc()), the fact that I mentioned above is only informative for you, but does not apply to your question.  Sorry for responding too quickly without looking in your code between quotes...

In order to answer your question, we take a look at the approach to programming DAQmx:

If you configure your task to be "finished", the task will stop running if the number of samples per channel is acquired. In the case of an external clock (not configured as I convert clock), served it in the sampling interval. The sample clock will automatically receive a sample for all channels with a single clock pulse. From this point of view, the installation program you have in your program seems correct.

If you do not get the number of samples that await, the fault must be somewhere in your playback function. Do you get any error messages?

DAQmxReadAnalogF64 (taskHandle, DAQmx_Val_Auto, 10, DAQmx_Val_GroupByScanNumber, read, m_nStates & sampsPerChanRead, NULL)

If you set m_nStates set to 8000, it's here. You say the Read function to retrieve 8000 samples. None. So if you have two channels, DAQmx acquires 2 x 8000 samples, but read you only 8000 samples... Please change m_nStates to

m_nStates = #channels x #samples by channel

This should solve your problem.

hope this helps,

Norbert

Tags: NI Hardware

Similar Questions

  • How to stop multiple self-switching to the address bar every time I open a new tab and try typing something anywhere outside the address bar?

    How to stop multiple self-switching to the address bar every time I open a new tab and try typing something anywhere outside the address bar? As something just wants me to use this integrated search when you type something non-Web-address in the address bar and press to enter. And the most ridiculous thing is that happens repeatedly on as every second, as I just got off the address bar and start typing again, but still he passes me in the address bar, then 3, 4 times like that. And the result is that I don't see the address of this page.

    I think that its has something to do with my AVG Antivirus, because it started the same time a Nation AVG started to appear in each new tab I opened (and which is irritating as me, I've read here on support.mozilla.org and it seems that the only solution is to completely reinstall Firefox, but I don't want to lose all my settings) but when I type something in the address bar and press enter It opens the search results in Google.

    Please try to help me, I love Firefox but I have to switch to Chrome until I fix this.

    Thanks in advance

    First of all, please update Firefox 32. 22 is no longer support is not safe. So, let us know if you still have this problem. Update Firefox to the latest version

  • How to replace filtering engine based on the Windows Component?

    HI - how to replace filtering engine based on the Windows Component?

    See the link below.   This fix is well worth trying, but if your system has been damaged by malicious programs such as Sirefef there may be more issues involved.

    blogs.technet.com/b/asiasupp/archive/2011/12/27/error-code-0x80070424-with-Windows-Firewall-and-quot-base-filtering-engine-service-quot-not-available-in-services-database-list.aspx

  • How to create a report based on the item selected from the list of selection?

    Hello

    I created a tables_LOV based on:

    Select table_name table_name user_tab_cols r, d

    where column_name like '% _type % '.

    Then I created a ListOfTables page element, display in a selection list and pointing to tables_LOV.

    I run the page, and I can choose the table I want in the drop-down list.

    How to create a report based on the selected element? (ex: select * from selected_table)

    Thanks in advance

    Salah

    Hi Salah,

    Allright, take a look at this page: http://apex.oracle.com/pls/apex/f?p=vincentdeelen:collection_report

    I think that simulates what you are trying to accomplish. I've implemented the simplest method I could think of.

    The report is based on a collection of apex. If you are not familiar with this, you should study the documentation: APEX_COLLECTION

    To recreate my example, you should:

    (1) create a report (interactive) on your collection

    SELECT *
       FROM APEX_collections
     WHERE collection_name = 'MY_COLLECTION'
    

    (2) create a selection list page_item for the tables that you want to display (in my case, this is called "P38_TABLES")

    (3) create a dynamic action that triggers on the evolution of your selection list page_item. Dynamic action must be a parade of PL/SQL procedure the following code:

    declare
      l_query varchar2(4000);
    begin
      l_query := 'select * from '||:P38_TABLES;
      if apex_collection.collection_exists
            ( p_collection_name => 'MY_COLLECTION' )
      then
        apex_collection.delete_collection
          ( p_collection_name => 'MY_COLLECTION' );
      end if;
    
      apex_collection.create_collection_from_query
        ( p_collection_name => 'MY_COLLECTION'
        , p_query           => l_query
        );
    end;
    

    Make sure that you add your page_item 'Page to send items' section.

    (4) add a real extra action that makes an update of the report area.

    Here are two photos describing the da:

    http://www.vincentdeelen.com/images/OTN/OTN_COLLECTION_REPORT_DA1.PNG

    http://www.vincentdeelen.com/images/OTN/OTN_COLLECTION_REPORT_DA2.PNG

    Good luck and greetings,

    Vincent

    http://vincentdeelen.blogspot.com

  • How to read a file of all the text in a pl/sql variable?

    Hi, I need to read an entire text file - which actually contains an e-mail message from a system of content management - in a variable in a pl/sql package, in order to insert the database information and then send the email. I want to read the whole of a sudden text file, no not one line at a time. Shoud I use Utl_File.Get_Raw or is there a more appropriate to do this?

    How to read a file of all the text in a pl/sql variable?

     ...
    your_clob_variable := dbms_xslprocessor.read2clob('YOUR_DIRECTORY','YOUR_FILE');
    ....
    
  • activate the external clock

    Alrighty, I'm a total noob to LabView and others. I'm at the point where I don't even know if I know is relevant, so forgive if I give too much information and probably not enough.

    I've got:

    cDAQ-9174 chassis

    9422 module into the connector #2

    This 9422 module will be connected to a meter that will send a square wave. What I need is the frequency of the square wave. Problem is, I don't have any idea how to get it.

    I open a new .vi and use the DAQassist. From there I select entry counter and then I tried the frequencies and Edge Count.

    At the end of the day, either it usually gets me the following error message:

    Error-200284 occurred to...

    Possible reasons:
    Some or all of the requested samples are not yet acquired.

    I guess that one I did most of the research is the counting of edge. It is continuous samples because I need to monitor the flow rate at the time rather than only to count the edges of time 0 until I stop the VI. So there are different ways to treat this error include changing the timeout value, something to do with 'samples to read' and 'sample rate', and then that it seems to me that I have to do: since the buffered continuous one requires an external clock, which is specified in the tab "Advanced Timing" of the menu properties DAQassist I have a lot of things to choose from. It seems/I/SampleClock or/ao/SampleClock is the thing to choose, but then several Web pages continue to say to make sure that the external clock is actually "run", or any word in this sense. So I tell myself, my external clock isn't doing anything and that's why reading isn't acquire samples. But really, I'm just lost. Then...

    Question 1:

    Is what I'm working on the best/right way to go about doing this?

    Question 2:

    How can ensure me that this external clock done everything what it is supposed to do so that I can get samples still for edge counting?

    Well, my ignorance is exposed, please fire away. I have attached the .vi, although I don't think it will tell you anything other than I know how to click the mouse button when running LabView.

    County Board is time since you don't have a sample clock.  You can provide one from many sources, but in your case I suggest sticking to a task of frequency measurement I won't go into it now.

    The frequency could be time for a number of possible reasons:

    1. the external signal is not connected to the right Terminal (the default IS terminal your meter chosen if you not him have not overridden with a property DAQmx node which is not possible in the DAQ Assistant).  For the 9422:

    2. the signal may be connected to the right Terminal, but perhaps, it does not meet the specifications of the 9422 to be detected)<5V low,="" 11-60v="" high).=""  you="" can="" verify="" whether="" or="" not="" the="" signal="" is="" being="" detected="" using="" a="" test="" panel="" (counter="" edge="" counting="" to="" determine="" if="" the="" signal="" is="" present)="" in="" measurement="" and="" automation="">

    3 tasks of frequency are sampled off the input signal - so if the input signal does not switch when you start the program or if there is a long break (longer), you will receive the time-out error when the reading function blocks for more than your specified time-out.  You should be able to just 'manage' the time-out error so that if it happens you can report a frequency of 0, ignore the error and try to read it again.  There are also other approaches such as using events DAQmx or samples available to read to vote, but none of them are available through the DAQ Assistant (the idea is that you avoid making DAQmx Read blocking call until you know there are samples to read).

    Configure a task of frequency is a better option for you, because it will give more precise (although you can set a task of County of edge to behave similarly to a frequency measurement task, this is trickier and you can also use the DAQ assistant).  You can start out by setting 1 sample (on request) for the synchronization mode - this will return a single sample as soon as it is available.  If you put the DAQ Assistant, in a loop, you will get a new sample at each iteration (or if your input signal goes, the samples will stop coming in and you'll get time-out errors instead).  The downside is that you will not receive a sample on each side - entry task is reset by software and during this downtime between the samples will take no new data.  This should be good for the case of the use you described (the frequency of a continuous square wave periodically monitoring).

    So, make sure that the external signal conforms to the specifications of the 9422, and it is connected to the correct terminal (the PFI line which is equivalent to the DOOR of your meter by default).  If your external signal is less than 0.2 Hz (1 sample every 5 seconds) you will need to move away from the DAQ assistant, as it seems that it is not possible to set the timeout of read using the DAQ Assistant (surprisingly).  You might want to look in the API of DAQmx lower level anyway - here is a simple example to help you get started in the affirmative.  It's really not too complicated and once you get used to it will be less heavy than using the DAQ Assistant.

    Best regards

  • HSDIO 6556 loses the lock on the external clock

    Hello

    I'm encountring a strange problem. I use my 6556 HSDIO to generate some model using and external clock (around 20 MHz and 50 ohms impedance). This clock is provided by an MCU and the entire application does not work well. However, when I tried to cool the MCU (up to-10 °) the HSDIO loses the lock and tries to re - lock again (the Red turned led active). When this happens, I can see a new phase shift between the data generated and the external clock, within the scope that is fatal for my application. L ' other, I inspected the data generated looking for a glitch or gigue appearing at low temperatures... Notice anything special... I tried to heat the MCU upward at 100 °, HSDIO does not lock...

    What can I do? 6556 HSDIO is apparently too sensitive...

    Mar1

    Hi Mar1,

    Datasheet public for the chip used in the States of SMU - overclocking 6556 a typical tolerance of jitter of 20 000 ppm, with minimum of 5,000 ppm. For a 20 MHz clock, this corresponds to 1 ns of jitter typical and 250 ps in the worst case. That being said, we cannot guarantee the specifications that are not included in the specifications NEITHER SMU-6555/6556 document because it is not updated with the production trial.

    Best regards

  • [ADF, JDev 12.1.3] How to hide menu items based on the logged in user

    Hallo,

    When the user logs on successfully, the applitacions led him to the main.jspx page.

    The main.jspx page has a menu bar that contains all of the available menus, submenus and menu items.

    After the connection, when the main.jspx page loads I would hide all the menus, submenus and menu items that the user is not qualified to see/use (I read the database).

    You kindly tell me which is the way the cleaner to achieve?

    Thank you

    Federico

    user10709360 wrote:

    Hello rohanwalia,

    Sorry, but I need more help

    I guess that the solution is to create a method in the AM who - reading form the database - returns a structure that indicates for each menu item should be visible or hidden.

    • How can I use the data returned by this method?
    • I call in a managed bean specifically dedicated to the management of the menu? Can I also use the already existing media bean, I created for the page?
    • What scope should have the bean?
    • Don't you think that it is better to define a 'visible' variable Boolean (initilized depending on the result of the AM method) for each menu item and how to bind the Visible property of each menu item to the variable respective in the bean in the bean?
    • Or I can loop the result of the method AM setting the Visible property of the menu items? In this case, I guess that all the menu items must be mapped into the bean by user interface variable. Am I wrong?
    • Is it not possible to write a method which, of the AM directly, hide the menus not necessary on the page (so without using a bean)?
    • In general, which are the correct always to hide menu items:
      • (1) before the page is sent to the browser (as "I can do it with PHP);
      • (2) once the page is loaded in the browser (as I can do it with JavaScript)?

    If you could give me some more detailed advice... I would be very happy.

    Thank you

    Federico

    (1) its best to make the treatment inside the method. You can return the parameters as normal java method.

    (2) Yes, you can use bean already exists in the project. But better to create a separate bean for this task of menu.

    (3) scope should be request unless you need to persist the attributes between requests.

    (4) Yes it is possible. You can define and initialize a Boolean variable with the results you get from the table based on the menu items should be made visible.

    (5) If you use the approach to point 4, then also you have to loop through the table menu items and set Boolean variables of bean. Yes you are right for the second part.

    (6) I'm not sure about this approach. How will you map it to your menu mode. It takes research.

    (7) before the page is loaded. I share with you links in above post with which you can do this.

    I hope this helps.

    Thank you

  • How to create a document based on the name of a file in the file system?

    Hello

    With lots of photos, I like to have a database to collect information on these photos.

    First question is how to generate a record based on a file in the file system?
    for example, the images are "c:\fotos\2009\01\disc_001.jpg" to "c:\foto\2009\01\dis_98.jpg".
    now, I want to create folders with as one of the attributes of the name of the image (not the image itself). How to create these records (based on information from line-telephony). that is the number of records must be the same as the number of photos.

    any suggestions?
    any response will be appreciated.

    Leo

    Link to create the directory

    http://www.adp-GmbH.ch/ora/SQL/create_directory.html

    You can create a list of files in the directory and read the list of files in this directory.

    [Documentation UTL_FILE | http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10802/u_file.htm#996728]

    [Solution using Java | http://asktom.oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:439619916584]

    SS

  • Read VeriStand channel from inside the custom device that are not part of the custom device?

    Is it possible to read VeriStand channels from within a custom device VeriStand (RT Driver) that are not part of this custom device?

    For example, suppose I want to be able to configure a channel in my custom device to always be twice the value of a string of material that my user selects (I know, better/more simple ways to do this, but this is just a simple example ).  Can I do this from the device custom without programmatically create a mapping of the system? (I've done this before and it is messy and VERY prone to error of the user).

    Thank you!

    good point

    the channel ID (U64s) are not the same in the engine config of vs. Instead, you must set 'references to dependent item' in the config and then get these references in the engine.

    See the source jarrod linked, which makes it

  • How to read a counter value for the separation of the two edge before meter is stopped by the second edge (6602 Council)?

    I use a timer/counter with DAQmx 6602. I use the separation of two - available via DAQmx cash edge. Count between the two edges works properly, however I do not know how to read the value of the counter during the counting operation (i.e. after the first edge triggered the beginning of the count, but before the second edge triggered the end of the counting). I'll have to wait for the second goes off the edge of the end of the countdown until I can get a counter value. I need to be able to access the current value of the County during the count operation. This was possible in traditional DAQ. How can it be accomplished using DAQmx?

    Ah shoot - I was afraid that this might be the case (for what it's worth, my series of X returned intermediate values, but the material and the underlying driver are quite different)...

    You just need to take one measure at a time or you are buffer several measures of separation of the two edges at the same time?  So just to take one measure at a time, you can set a task of edges of count using the database internal time as the source using an arm start trigger (first edge) and a sample of clock (second Board) to work around the problem.

    Best regards

  • read only channel number and the number

    I have "COM4" of my I/O.  How could read number 4 only?

    Thank you

    Like the picture as an attachment you can try 'n' in various ways

  • How to display multiple channels on several plots

    I use a USB-6009 to capture data on three separate channels. However, the way I put it up now, I see the three channels on a plot. I'd like to see each channel on a separate parcel, but I don't know how I'd do. Thanks for your help.

    Hi Aparker,

    Here's a quick picture of what you could do with the Index of Array function to separate your parcels on separate graphs.

  • How to add dynamic items based on the results of a dynamic query?

    Hi all

    I'm quite new to ofa, here's my problem.

    I have a table 'interventions', each intervention have actions stored in the table "actions".

    I want to show the actions of an intervention in a list, based on the id of the intervention. the response ID value is dynamic, so does not know the number of shares that you want to display in the list.

    Can someone tell me the steps to create a region that has dynamic elements to display names of action?

    Thank you

    Kind regards

    Afaf

    Afaf,.

    Take a look on the link below to see how to create dynamic VO:

    Blog of Anil Oracle Application Framework: create VO when running at the controller or dynamically created VO

    You could add messageStyled text like the code below:

    OAMessageStyledTextBean newMessageBean = (OAMessageStyledTextBean) createWebBean (pageContext, MESSAGE_STYLED_TEXT_BEAN, null,"" ");

    Links to dynamically create elements below:

    Add columns to the table advanced in OA Framework Programatically by Extension

    OPS KNOWLEDGE HELPER

    Let us know if you get any errors when creating.

    See you soon

    AJ

  • Extract part of channels based on the positions

    Hello

    My requirement is simple. I get the data from the source below file.

    My data looks like this. Sometimes, I have a space, a tab space, space two tab. It is ambiguous.

    FIRSTWORD SECONDWORD THIRDWORD QUATRIÈME (o/p = FIRSTWORD SECONDWORD THIRDWORD)
    FIRSTWORD SECONDWORD THIRD WORD (o/p = FIRSTWORD SECONDWORD THIRD)


    If it's something thing fixed, I can write using SUBSTR and INSTR and it worked. But how we deal with several cases at the same time.

    Thanks in advance
    KVB

    Maybe something like this...

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select 'FIRSTWORD SECONDWORD  THIRDWORD FOURTHWORD' as txt from dual union all
      2             select 'FIRSTWORD       SECONDWORD THIRDWORD       FOURTHWORD' from dual)
      3  --
      4  -- end of data containing single or multiple spaces and/or tabs
      5  --
      6  select regexp_substr(txt, '[^ ]+', 1, 1) as first
      7        ,regexp_substr(txt, '[^ ]+', 1, 2) as second
      8        ,regexp_substr(txt, '[^ ]+', 1, 3) as third
      9        ,regexp_substr(txt, '[^ ]+', 1, 4) as fourth
     10* from (select regexp_replace(txt,'[[:space:]+]',' ') as txt from t)
    SQL> /
    
    FIRST           SECOND          THIRD           FOURTH
    --------------- --------------- --------------- ---------------
    FIRSTWORD       SECONDWORD      THIRDWORD       FOURTHWORD
    FIRSTWORD       SECONDWORD      THIRDWORD       FOURTHWORD
    

Maybe you are looking for