Internal clock for the counter

Hello everyone,
I am new to NIDAQmx and I am doing angular position measurement. I found provided sample for the counter, 
it says that I need to use external sample clock. Could someone provide me sample, that uses external clock that was generated by one task
and another task which uses that generated clock and reads encoder input! I am doing it in C++.
Thank you!!!

Hello Khassan,
Here is a link to a Developer Zone article that describes how to implement two tasks that share a clock, The example covers how to implement this with Analog input and output. You can work with it to fit it to your application: http://zone.ni.com/devzone/cda/epd/p/id/2352
Reagards,
-Travis E
National Instruments
Applications Engineer

Similar Messages

  • How to Read the internal table for the data download from the spool

    HI all,
    I have one issue regarding the spool ,we are getting the correct output as per requirement of  user but when we send the same to the user in pdf format they did notget the same.
    they are telling that the due date is missing from the pdf.
    Please advice me how to track the internal  table for the spool data converted intopdf in a readable format.
    the FM used for the above task is : 
    call function 'CONVERT_OTFSPOOLJOB_2_PDF'
    Please reply if any one worked on the same.
    Thanks in advance.
    Gaurav,

    Hi Wang,
    Please let me know how you solved your question.
    Points will be rewarded.
    Thanks,
    Arun.

  • After using the internal mic for the first time I am getting a buzzing feedback from my audio output

    After using the internal mic for the first time I am getting a buzzing feedback from my audio output

    Go to System Preferences Sound Input and adjust the volume level down by dragging the slider to the left. With an audio app like Logic there is an option for input monitoring when recording so there might be a feedback loop if the volume is set too high. Garage Band works in a similar way. Always be careful when using headphones as the noise can be frightful and cause hearing damage. 

  • Can DAQmxRegisterEveryNSamplesEvent function be used for the Counter Input Channels

    Hi, All,
    I have an application to count the digitial pulse number. I want to know the time of the coming pulses which start from 1 and increased 4 later, like 1, 5, 9, 13..... The time interval between each pulse is not a fixed value. So I tried to use  DAQmxRegisterEveryNSamplesEvent and DAQmxCreateCICountEdgesChan functions. But afterI called the DAQmxStartTask function, it always failed.  The board I used is the NI-PCIe-6320. Here is part of my code.
    DAQmxErrChk (DAQmxCreateTask("",&m_taskhandle));
    DAQmxErrChk (DAQmxCreateCICountEdgesChan(m_taskhandle,"Dev1/ctr0","",DAQmx_Val_Rising, 0, DAQmx_Val_CountUp));
    DAQmxErrChk(DAQmxRegisterEveryNSamplesEvent(m_taskhandle, DAQmx_Val_Acquired_Into_Buffer, 4, 0, EveryNSamplesCallback, this) );
    DAQmxErrChk (DAQmxStartTask(m_taskhandle));
    I don't know the reason. Can Anyone give me some help. Thanks.
    Yang
    Solved!
    Go to Solution.

    Hi, John,
    What's I what to do is that I have an external digital signal, when the signal goes from low to high, I need do some operations. So I just want to know the time when the digital signal goes from low to high.  The frequency of the digital signal is from 0 - 20000Hz. My first plan is to use a counter to count the pulse rising edges. When the number of edge increases one, I do the designed operations. In this method, I can't guarantee I can catch each pulse rising point. Because sometimes the counter will increase more than one in the on-demand mode. For example, the previous content of the counter is xxxx4, but the next reading the content may become xxxx6.
    After I learned some ANSI C  codes, I found that the ChangeDetectionEvent can help me found time when the signal goes from low to high. So I wrote the following code: (I set the digital signal to P0.0)
    DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
    DAQmxErrChk (DAQmxCreateDIChan(taskHandle,"Dev1/port0/line0","",DAQmx_Val_ChanPerLine));
    DAQmxErrChk (DAQmxCfgChangeDetectionTiming(taskHandle,"Dev1/port0/line0","",DAQmx_Val_ContSamps, 1));
    DAQmxErrChk (DAQmxRegisterSignalEvent (taskHandle, DAQmx_Val_ChangeDetectionEvent, 0, Callback , dialog));
    DAQmxErrChk (DAQmxStartTask(taskHandle));
    int32 CVICALLBACK Callback (TaskHandle taskHandle, int32 signalID, void *callbackData){
    CNIPCIE6320Dlg* dialog = static_cast<CNIPCIE6320Dlg*>(callbackData);
    dialog->m_event_num++;  // Here is to calculate how many events has been triggered
    return 0;
    Yesterday I used this method to get the pulse rising time. I found the m_event_num is close to the ground truth (In the simulation, I know how may rising pulse I generated).  In one two hours test, the offset is almost 400 pulses. But today I did the same tests again. I found the m_event_num got a big difference from the ground truth. The voltage of the whole system today maybe smaller than yesterday, because today the power is from an invertor while yesterday the power is from the electricity supply. So will the lower voltage supply will causing some event missing. Or if PC system became busy will ignore some callings of the event callback function? That's two possible reason will affact the final result. I am not sure. Do you have any experience about this problem.  Or do you have some better suggestion to get the pulse rising time. Thanks again.
    Regards,
    Yang 

  • Internal table for the result area

    hey
    where do the result area data stored in after the search? is it in internal table??. If so is there any possibility of finding the internal table?
    thanks in advance

    Hi Shailaja,
    You can check as pointed by Vijay, which is at the Framework Level.
    For Application Level (specific to your PCUI Appl), the QEURY method of your class (assigned to Search Area screen) returns the list of found object keys (based on the search query) to the READ method. The READ method now queries the backend, for the supplied object keys and stores all the result data in export parameter ET_SCREEN_SRTUCTURE.
    Now the Framework with the help of One Order Interaction Layer, pumps the data to the Data Context Layer as pointed by Vijay.
    So in order to do any data massaging, you can do it at internal table et_screen_structure.
    But whatever changes you do in et_screen_structure, will not be commited to backend, without touching the MODIFY method.
    Thanks
    Harsh

  • Whats the sweet spot for the count of Photos per Library?

    1) How many photos should be there in a Library at max. to have iPhoto perform efficiently?
    2) Does the iPhoto Library database performance depend on the size of the photo or the count of photo?
    I have a collection of some 7000+ photos of 2.5MB on average.
    Should i put all of them in a library or different library?
    Also if i have to set up different library i want to have backup of them in a DVD for each library. So, technically my library should not exceed 4.5GB
    Now my confusion is:
    If i have say 3GB of original photos in the library then technically i'll have around 3-6GB of photos in both Original and Modified folders.
    Going through the forum I have found that there are 2 ways of backing up photos:
    1) Through "Export" to a Folder and writing the folder the a media.
    2) By Copying the Library Folder completely to backup media.
    If my assumption is right then,
    1) in case of "Export" method, i'll be having a collection of the total number of photos i have. i.e. if i have 3000 photos then the exported folder will contain 3000 photos.
    2) in case of "Copying" then i'll be copying the OriginalModified+Datadatabase, and i could restore them as a library when needed.
    Please let me know if my assumption is right or wrong.
    Thanks,
    Sapam
    Message was edited by: sapam

    sapam
    1) How many photos should be there in a Library at max. to have iPhoto perform efficiently?
    iPhoto is rated to 250,000 pics. After that there is no right answer based on iPhoto. What you need to take into account after that is Hardware. The max for an efficiently perfoming iPhoto will be very different for a Mini with 512MB of RAM and a MacPro with 8 Gigs of RAM. Other factors include the size of the disk and the amount of free space on it.
    2) Does the iPhoto Library database performance depend on the size of the photo or the count of photo?
    The count of the photos - and then some. The files are stored in the Finder. So a 1 MB file takes the same amount of space in the iPhoto database as a 10MB file. However, what does impact on the size of the library file are things like the number of albums, books, slideshows etc., Smart albums, in particular, can slow down the app launching. So, it's not just the number of photos but the organisation as well.
    So, what's your Hardware and what do you mean by efficiently? I have a 15k image library that's some 40gigs in size on my iMac with 2 gigs of RAM. I'm very happy with it's performance.
    Going through the forum I have found that there are 2 ways of backing up photos:
    1) Through "Export" to a Folder and writing the folder the a media.
    2) By Copying the Library Folder completely to backup media.
    Close.
    Think of it this way:
    Want to save the current versions of your pics only? Select the pics in the iPhoto Window and go File -> Export. Export them to a folder on the desktop. Burn that with the finder. Now you have the up-to-date versions of your pics. pop that disk in any computer and there they are.
    Want to save your Library - that is Originals, Modifieds, database files etc?
    1. Copy the iPhoto Library Folder to an external HD or burn it to DVD
    or
    2. Use the Share -> Burn command. This will burn a disc that will mount into another iPhoto, and pics can be dragged to the new iPhoto from it. You can burn your entire library, or break it into albums and burn in groups of albums if your DVD isn't big enough.
    Regards
    TD
    Message was edited by: Terence Devlin

  • Can you still get internal HDs for the G4 PB 12"?

    I still use my trusty 12" Powerbook G4 for my hobby of freelance writing and photography. Indeed, the ONLY thing currently 'wrong' wih it - for what I need from it these days - is that the internal 40Gb hard drive is now way to small for all the stuff I want to keep on it.
    Is it still possible to get compatible internal hard drives for it? If I can get a 500Gb internal hard drive, it'll save me the expense of having to buy a whole new laptop. Which seems a bit silly as the Powerbook G4 is still more than adequate in every other way!
    (I know I could get an external drive, but an internal one woould be a whole lot better!)
    Can anybody help, please?

    Robin:
    As noted, yes, PATA drives are still available for your computer. Here is a list of available drives for your computer at OWC. You do have a lot of tiny screws to deal with, but it can be managed. The most troublesome are two tiny screws on each side of the case. Be very careful not to damage the heads of the screws. You will also discover that the 1.5 GHz version does not have an EMI finger to be removed, as noted in the step by step directions. In addition to the step by step directions from iFixit here are few tips you may find helpful:
    • Print out the ifixit directions as well as the screw guide ahead of time.
    • Be sure you have the right tools. You don't want to damage the screw heads or you may never get them out. And the Torx screw driver is critical. For a spudge I use the handle of an old toothbrush (choose one made of hard plastic), cut off the brush and bevelled the handle end like a flat blade screw driver). For some spudge jobs a credit card will do the trick.
    • Picking up on one user’s suggestion, I clicked on the pages of each step which involved removing screws to enlarge, then printed out the pages. I poked holes in the paper where the screws were removed, poked the screws in the holes and stacked the pages in order in which the screws were removed. Reassembling was a lot easier. No cups to tip over and spill. No guessing. Each screw was exactly in the right place. You can use an ice cube tray, egg carton, dixie cups etc. I previously used small medicine cups one for the screws in each step. I nested them so that the last ones out and the first to go back in are on top. (Some users report cutting up the screw guide and placing the applicable section in each container.)
    • Be very careful pulling out leads. Hold the lead as close to the plug as possible and wiggle (the plug ) to loosen its grip. Don’t hold the wires and pull as that can damage the cable, or worse, in some instances pull the wires out of the plug. Indeed, some users have pulled the socket off the logic board! Use needle nose pliers or tweezers if you can access the plug, or nudge the plug with a small instrument to help loosen its grip.
    • Use force gently in removing parts. Separating upper and lower case takes some doing. Use a plastic tool (spudge) so as not to mar the case.
    • Refer to the screw guide when reassembling computer. Putting longer screws in the wrong place can perforate the circuit board.
    Please do post back with further questions or comments.
    cornelius

  • How do I select the 80 Mhz internal source for the PCI-6602?

    The user manual says the PCI-6602 counter/timer has
    an internal 80Mhz as well as 20Mhz source. I'm trying
    to select the 80Mhz source using the ni-daq function
    GPCTR_Change_Parameter() in Visual C++, the header
    file nidaqcns.h supports 20Mhz but not 80Mhz.

    Hi, this is a simple program in C as requested that measures the time between two pulses (buffered).
    I'm working with the PC-6602, and it doesn't work with an internal 80Mhz source.
    The errormessage is "C:\Frederik\gecord\oscillator\bufferperiodtest.cpp(87) : error C2065: 'ND_INTERNAL_80_MHZ' : undeclared identifier
    Error executing cl.exe." after compiling. When I use "ND_INTERNAL_MAX_TIMEBASE" it does work, but on 20 MHz, not on 80.
    Does anyone know what i have to do?
    Thanks
    (Ps: working together with "mtytgat")
    Attachments:
    bufferperiodtest.cpp ‏2 KB

  • Ultra 10 down for the count

    I mistakenly switched off my Ultra 10 as it was starting the boot process. Now it won't boot, even respond to Stop-A, or anything else. Just a blank screen after the keyboard is acknowledged. No OpenBoot, anything.
    Any ideas?
    U10 w/ Solaris 10
    Peter
    It is now running after being without power most of the day.
    Thanks.

    Hello Peter,
    <b>ultra 10 remote access</b>
    did you obtain the USB-Serial adapter for your notebook or have another system with a serial port available?
    I would suggest that you attach to the serial port of the Ultra 10 and review the output.
    <i>Just a blank screen after the keyboard is acknowledged</i>
    Maybe the system is running full-diagnostics. Check if the keyboard is properly attached.
    If a serial console ist still not available, use the <b>Power-On Self Test (POST) / Keyboard LEDs</b> from the following document.
    http://docs.sun.com/app/docs/doc/800-6358-11/6hne6kjq2?l=en& amp;a=view#z40001bb1511
    Michael

  • All sql is working fine except for the COUNT statement ... ?

    This piece of code using taglib
    <%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
    <sql:query var="aantalantw" scope="session">
              SELECT COUNT(*) FROM antwoorden
    </sql:query>
    <c:out value="${aantalantw}"/>
    This result should be something like 12 or some other number of course
    but i seem to get this :
    org.apache.taglibs.standard.tag.common.sql.ResultImpl@fbcb70
    Ideas ?

    Sorry, I made a mistake. The right code is:
    <sql:query var="aantalantw" scope="session">
    SELECT COUNT(*) AS count FROM antwoorden
    </sql:query>
    <c:forEach var="aantalantw_row" items="aantalantw.rows">
    <c:out value="${aantalantw_row.count}"/>
    </c:forEach>

  • Can you get a digital clock for the nano?

    Cant find it anywhere!

    Not at this time.  You can provide feedback to Apple for it using this link.
    http://www.apple.com/feedback/ipodnano.html
    B-rock

  • Why is my fone doing international call for the number 0033 685587441

    Does anyone know or have any similar case like this?

    iMessage and Facetime, when activated, use SMS to contact a number in the UK in order to activate the service. But they usually warn you before doing so via an onscreen message.
    That is all I can think of. Are you using an iPhone supported carrier in Portugal?

  • How is the counter clock chosen?

    I understand the the DAQCard6036 has
    two clocks for the counter, one is 20 MHz and the other is 100 kHz.
    When asking for a pulse train in terms of pulse width and frequency,
    how is the clock determined? Is this something I must specify, or does
    it happen automatically when using something like Generate Pulse
    Train.vi?
    Thanks,
    Peg

    Hello Peg,
    When performing a pulse train output, the timebase used is determined by NI-DAQmx automatically.  You do not have to explicitly set it.  If you would like to know what NI-DAQmx chooses for the master timebase and/or rate, you can use a property node.  It is a DAQmx Channel Property Node, and the properties are: Counter Output>>General Properties>>Counter Timebase>>Source, and Counter Output>>General Properties>>Counter Timebase>>Rate.
    -Alan A.

  • Using External Clock to write counter value to buffer

    Using CTR mode config which input controls at what frequency the counter value gets written to the buffer? How do I set it up so the counter value is written to the buffer at the same time Anologue inputs are written to a buffer, without using the other counter.

    Hello,
    Could you please explain what type of counter operation are you interested in doing? That would help me in suggesting something.
    But if I roughly understand what you are saying here, you can use a same clock to provide as scan clock for analog input and then use that clock for the counter. But depending on what counter operation you are trying to do will decide whether that clock be provided as source or Gate.
    You may take a look at examples provided at the following location too :
    Measurement Hardware
    Sincerely
    Sastry V
    Applications Engineer
    National Instruments

  • I'd like to buy an iPhone 4S in France directly from the Apple Store, not from the operators. But, I will go back to my country, Thailand. So, I'm wondering to know that there is an INTERNATIONAL warranty for iPhone, and is it valid in Thailand (warranty)

    I'd like to buy an iPhone 4S in France directly from the Apple Store, not from the operators. But, I will go back to my country, Thailand. So, I'm wondering to know that there is an INTERNATIONAL warranty for iPhone, and is it valid in Thailand (warranty). Would it be able to be claimed at the iStudio in Thailand?

    There is NO International Warranty for the iPhone.  Your best bet is to purchase one in Thailand.  If you purchase a phone in France, you will NOT get warranty service on it in Thailand and will have to return it to France (or any EU country) for warranty service.

Maybe you are looking for

  • File adapter: how to change filename

    Hi all, In my scenario I need to add specific time stamp (current date actually) to filename when it's copied to target system. In the properties of file adapter there is an option to add time stamp, but I need it to be in format YYMMDD.hhmm, while X

  • FrameMaker and ArborText

    Can two groups within the same company, one using FrameMaker and the other using ArborText, open and edit each other's documents and then bring them back into the original program? Thanks! Lisa

  • Function Module Required

    Hi I have to convert the Date(Select-Options) filed to display in ALV in Month format. The date can be in range or current date,accoring to the user.Can you tell me if any FM exit there in SAP or plz tell me the code, than it will be a great help. Ev

  • What does the class CL_EXITHANDLER do ? What the significance of this class

    what does the class CL_EXITHANDLER do ? What the significance of this class,

  • Kernel Trap on Macbook. What is this?

    I started getting this on my MacBook recently when playing World of Warcraft and using Ventrilo. Anyone have any idea what the heck this is and what might be causing it? Error is below. Thanks! Jeffrey Visgaitis Fri Feb 22 23:33:11 2008 panic(cpu 1 c