Question on the example code 8253eventcount.c

Hi.
I saw the example code 8253eventcount.c before in the NI-DAQ6.9.x. That is very useful.But i still confuse that "Do i need to set up each clock pulse duration?". From the program, it seems that the counting process solely depends on the function NIDAQDelay(sec).....
By the way, if i am now using an old version of NI-DAQ6.8.5, How can i update some calculated voltages for each 1ms. Although i have read and followed the procedures in the user mannual of lab-pc+,but, i am still not sure how to program the counterA2 with appropriate update interval. Could anyone give me an example code? It seems that no examples are given in the version of NI-DAQ6.8.5.
I am now using lab-pc+ with Ni-daq6.8.5 by using c++ and win
dows95 as my working platform.Please help me in anyway! Thanks!
Attachments:
Lab_PC+_AO.cpp ‏2 KB

The NIDAQDelay() is only in there to control how often the program checks the current count on the counter. If it is set to 1 seconds, it will read the counter every one second and return how many counts have been read since the start. If you take that function out, the program will check the counter as fast as it can which will tie up your CPU.
As to your question about calculated voltages, can you be more specific as to what your application is and what you are trying to do, I'm a little confused.
Brian

Similar Messages

  • I want the example code for Calendar() and TimeZone() in java

    Hi,
    I want the example code for the TimeZone() and Calendar() class in java
    because i new to java, i am not able to understand the concepts properly.
    Thanks...

    Hi Paolo Dema.
    What are the exact spefications of your computer?
    Also did you computer come with 10.6 ot 10.5?.
    You may try entering the MPN (marketing part number) Format: M*****/**
    The MPN can be found on the product packaging or the System Profiler.

  • A question about the example "Filter"

    Hi,
    I have a question about the example "Filter (The Filter example illustrates how to filter data using a butterworth filter)" in the measurement studio reference now, it is one of the analysis examples.
    I load this example in Vc++, but when I compile it, the error messages are:
    "'ButterworthHighPass' : is not a member of 'CNiMath'" ,
    "'ButterworthHighPass' : undeclared identifier",
    "'ButterworthLowPass' : is not a member of 'CNiMath'" ,
    "'ButterworthLowPass' : undeclared identifier",
    "'WhiteNoiseWave' : is not a member of 'CNiMath'" ,
    "'WhiteNoiseWave' : undeclared identifier",
    Can you tell me what is matter? and how can I solve it?
    Thanks!

    Hi,
    I was hoping that you could tell me what version and edition you have of Measurement Studio. I also need to know if you are using .NET or 6.0. For example, "I am using Mesurement Studio Enterprise edition 7.1 for Visual Studio .NET."
    Depending on the version that you have, different functions and controls are included. I believe that you may have an edition that does not include the Butterworth filter. Let me know and we can go from there.
    Thanks,
    Caroline
    National Instruments
    Thanks,
    Caroline Tipton
    Data Management Product Manager
    National Instruments

  • Can you give me the example codes for DaqCard-12​00 at register-l​evel programmin​g

    Where could I find some example code in DaqCard-1200 Register_level programming Manual

    This forum is for discussion of Measurement Studio for Visual C++. You can post questions about DAQ to the Multifunction I/O secition here.
    Best Regards,
    Chris Matthews
    National Instruments

  • Do I have to use an external clock with a cDAQ-9188 and NI 9401 to read a linear encoder? I'm seeing error message that implies that but the example code doesn't show it.

    We can set up a task that works on demand but when we go to continuous sampleing we see Error -200303, which claims an external sample clock source must be specified for this application.  However, some of the NI linear encoder example code doesn't show that (uses the cDAQ 80 Mhz clock) and the documentation didn't mention that. 

    It's mentioned in the 918x user manual:
    Unlike analog input, analog output, digital input, and digital output, the cDAQ chassis counters do not have the ability to divide down a timebase to produce an internal counter sample clock.  For sample clocked operations, an external signal must be provided to supply a clock source.  The source can be any of the following signals:
    AI Sample Clock
    AI Start Trigger
    AI Reference Trigger
    AO Sample Clock
    DI Sample Clock
    DI Start Trigger
    DO Sample Clock
    CTR n Internal Output
    Freq Out
    PFI
    Change Detection Event
    Analog Comparison Event
    Assuming you have at least one available counter (there are 4 on the backplane), I would suggest to configure a continuous counter output task and use its internal output as the sample clock.  Specify the internal counter using an "_" for example "cDAQ1/_ctr0".  The terminal to use for the sample clock source would be for example "/cDAQ1/Ctr0InternalOutput".
    Which example uses the 80 MHz timebase as a sample clock?  It is far too fast for a sample clock on the 9188 according to the throughput benchmarks (80 MHz * 4 byte samples = 320 MB/s).  There is also no direct route between the 80 MHz timebase and the sample clock terminal for the counters--making this route would use a second counter anyway.
    Best Regards,
    John Passiak

  • Reading TDMS files in Matlab - problems with the example code

    I want to use the TDMS files to store data and do offline analysis in Matlab, version 2009b (either on Mac OS10.6 or Windows XP).
    To test the data import in Matlab I tried the example from http://digital.ni.com/public.nsf/allkb/0EEADA99DC7D00A4862572E30037C3A2 , but without success.
    I tried either with and without the path definition (as explained on the page I referred to before) at the start, and got back the following errors:
    with:
    ??? Error using ==> loadlibrary>deltempfiles at 559
    nilibddc_m.i.
    Error in ==> loadlibrary at 452
        deltempfiles(delfiles);
    Error in ==> Read_TDMData at 7loadlibrary([examplePath '\nilibddc'], hfile);
    without: 
    ??? Error using ==> loadlibrary>deltempfiles at 559
    nilibddc_m.i.
    Error in ==> loadlibrary at 452
        deltempfiles(delfiles);
    Error in ==> Read_TDMData at 36loadlibrary(NI_TDM_DLL_Path,NI_TDM_H_Path); 
    I found a few messages on the issue, dating from 2006 and 2007, that didn't lead to a satisfying solution and was hoping that, by now, there would be a solution to my problem.
    Thanks a lot
    Remco   
    Solved!
    Go to Solution.

    Hi Musk,
    Thanks for your answer. 
    Unfortunately it didn't help as my problem is not discussed there. I have a problem with this line:
    loadlibrary(NI_TDM_DLL_Path,NI_TDM_H_Path);
    I said before that I was using 2009b, but I was mistaken, I have R2008a, but the 'loadlibrary' is opened in a 2008b editor (no idea why). On the Mac I have 2009b installed.
    Thanks
    Remco 

  • Question about the example hfm sdk project HfmEAExtractSample

    I am trying to open the hfm sdk sample project hfmeaextractsample,which is a vb.net project to call the extended analytic functions in vb.
    it referenced several hfm dll, including Hsvmetadata.dll,Hsvsession.dll,Hsvstarschemaacm.dll and hsxserver.exe, from the guide it said I need to install the hfm client, I did, after that I found out these files were llocated at server, so I copied them to local pc. and tried to reference them in this vb project. I was able to reference the hsvmetadata.dll and hsvsession.dll, but the reference of the hsvstarschemaacm.dll and hsxserver.exe failed, anybody has idea how can I get this fixed?
    maybe some of you has the experience to use this sample project.
    thanks

    I just tried to call the api to extract security file but failed. Investigated for some time and finally worked it out. Remember to do the following steps:
    1. Copy the "Server" folder from the server in the install directory for referencing the related libraries e.g. HsvSession.dll, HsxServer.exe
    2. Enable DCOM in the Financial Management Configuration Utility
    Hope it helps

  • API & Example Code License Question

    Note: This is a repost from this thread on Forum Nokia. I was referred here by Ron Liechty, a Forum Nokia Online Community manager. Please keep that in mind to avoid circular bureaucracy. Thanks
    tl;dr: I want to use Nokia PC Connectivity API 3.2 example code as base for an open source project.
    I am considering to spend some time on implementing that long overdue sync solution between Nokia PC Suite and Mozilla Sunbird/Lightning (making this a Windows-only solution, but thats what i, and probably a few other people, need). My current plan would be to write a plugin for Sunbird, and a C++ glue code .dll that is [scriptable] via the Mozilla XPConnect interface and heavily based on the PIMNavigator example application packaged with the Nokia PC Connectivity API 3.2. Nokia has placed the following license on this piece of source code:
    Copyright (c) 2007 Nokia Corporation.
    This material, including but not limited to documentation and any related
    computer programs, is protected by intellectual property rights of Nokia
    Corporation and/or its licensors.
    All rights are reserved. Reproducing, modifying, translating, or
    distributing any or all of this material requires the prior written consent
    of Nokia Corporation. Nokia Corporation retains the right to make changes
    to this material at any time without notice. A copyright license is hereby
    granted to download and print a copy of this material for personal use only.
    No other license to any other intellectual property rights is granted. 
    Since this would require me to, err, print out all the code in that very handy Visual Studio project and start coding from scratch, I would like to request a writ of consent from Nokia to use the example code as base for my work.
    If I go ahead with it, I will release my product as open source and free of charge (not forgoing a Paypal donate button, but still), so the license I'd like to request is to a private person and for developing a non-profit product. After looking around on Forum Nokia, I haven't been able to locate the right place to apply for this kind of license, thus I'm asking for pointers from the community here. Replies from Nokia officials are highly appreciated as well, of course
    I had a brief chat with a german Nokia support callcenter agent, who was convinced that Forum Nokia would be the place to go to with questions of this type. If that is indeed the case, I would very much like to be directed to a specific person / email address, if possible.
    Message Edited by krugar on 06-Aug-2009 02:22 PM

    Hi,
    have you tried to search in SDN for "mdm api example". I found this: <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/2d18d355-0601-0010-fdbb-d8b143420f49">Introduction to the SAP Master Data Management Java API - Presentation</a>.
    Regards
    Gregor

  • Has anyone got the Comsoft Profinet example code working??

    Hello!
    I have a cRIO Profinet card and I'm attempting to get the example code working.
    I have followed the instructions in GettingStarted_cRIO_PN_IO_Device.pdf
    I have created an empty project with just the 9023 and 9113 present, and copied the 3 items from the example project cRIO PN IO-Device (LV 2012) as per the documentation.
    When I try to compile I get the error shown attached.  I cannot view the error as the VI is password protected.
    In 5 years of working with cRIO using many different c-series modules from NI and 3rd parties I have never come across a password protected example Vi - this is very disappointing!  I don't see how it will be possible to use the card without being able to access this VI, and clearly it is impossible to use it without this VI as they are unwilling to share its functionality.
    Has anyone got this working on anything other than a 9104 (which the example uses?)  Does anyone know the password?  Is it possible to use the card without using this example code?
    I will be communicating with a Siemens PLC (acquiring a load of U16s and logging on the cRIO at 20ms intervals).
    Many thanks for any input, or any experiences of using this card.
    Aaron
    LabVIEW/RT/FPGA 2012
    NI-RIO 12.0.1
    cRIO 9023 controller and 9113 chassis with COMSOFT PN module in slot 1.
    Attachments:
    PN_error.png ‏44 KB
    PN_error2.png ‏20 KB

    Just for the record, I am using the CRIO-PN with cRIO-9081 and cRIO-9068 integrated chassis successfully.
    LabVIEW (RT/FPGA) 2013 SP1.
    I didn't use the higher level ComSoft example code directly, as the VIs use so many control/indicators that the FPGA usage is sky high. I rewrote them to pass the I/O data via DMA FIFOs.

  • Error 1092 happened while running the executalbe file from an example code of Simulation Interface Toolkit

    With Simulation Interface Toolkit 3.0.1 and LabVIEW 8.0, I built the example code Sine Wave.vi to be an executable file. I made no modification to the code except setting Real-Time Target to be localhost in SIT Connection Manager. Everything was OK during the building process. But when I run it, error 1092 was reported. Here is the error message.
    Error 1092 occurred at Invoke Node in sit Traverse.vi->sit Traverse for References.vi->sit Find Object By Label.vi->sit Get RPS-Control-Indicator Refs.vi->sit Init Model.vi->Sine Wave.vi (Traverse Initialization Failed)
    I cannot find out any helpful information about this error code. Can anybody help me? Thanks a lot!
    帖子被zhuang在09-13-2006 08:01 AM时编辑过了

    To my knowledge, building an EXE out of a SIT host VI is not supported.  The SIT host VI utilizes functionality in LabVIEW that is not exposed in the LabVIEW Runtime Engine (i.e., with built EXEs and DLLs).
    -D
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Help with NI-DAQ Example Code

    Hi. I've just started working with the NI ISB-6211. This is the first ACD i've ever used, so i'm farily new to this. I have quite a bit of knowledge in programming. After searching through the installation files I found some example C Code that runs in the command prompt. I've modified one quite a bit to get it to do what I want. My question is...
    Now, i'm having some issues. I'm trying to get it to print a voltage reading into the command prompt. I've hooked it all up and i've used labview to make sure everything is working as it should (Which it does!). When I compile the C program and run it, instead of returning a voltage it just aquires points, and I really have no idea what these "points" are.
    Here is the main part of the example code:
    DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
    DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai0","",DAQmx_Val_Cfg_Default,1.0,10.0,DAQmx_Val_Volts,NULL));
    DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"",10000.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,1000));
    // DAQmx Start Code
    DAQmxErrChk (DAQmxStartTask(taskHandle));
    // DAQmx Read Code
    DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,1000,10.0,DAQmx_Val_GroupByChannel,data,1000,&read,NULL));
    printf("Acquired %d points\n",read);
    Error:
     And then it just moves down to the exit clause. Is there any documentation anywhere which tells me which DAQ command I need to use to print a continuously updating voltage read out? (Just as a decimal, like 5.21V for example).
    Thank you all
    John
    Solved!
    Go to Solution.

    John,
    The data acquired by DAQmx is written into the array called 'data'.  The number of points DAQmx wrote into this array is stored in the variable 'read' which was passed in by reference.  To print the values returned, you'd need to loop over the 'data' array, and print each value.  See this help topic for an explanation of DAQmxReadAnalogF64.
    Dan

  • Ni 6111 and Single Scan mode - any example code

    Hi,
    I am using the  Measurement Hardware Driver Development Kit (MHDDK) to program an NI 6111. I just cannot work out how to get
    single scan to work. No matter what I do, I either get no conversions or a full FIFO.
    The example code does not include any Single Scan examples and I would be extremely grateful if someone could provide me with example code.
    thanks
    Russell Thamm

    Hi Russell-
    Is there a reason why you have decided to perform register-level programming with this device?  It is supported by NI-DAQmx for Windows and NI-DAQmx Base for Linux and Mac.
    Regardless, if you would like to request support for the MHDDK I would encourage you to repost your question on the DDK Forum.
    Hopefully this helps-
    Tom W
    National Instruments

  • Retriggerable AI questions for the experts

      I am using a PCI-6111 and would like to acquire 2048 points at 5 MHz triggered at 100 Hz.  I am trying to use DAQmx.
    Question 1:
     I downloaded the retriggerable pulse train generation example for analog input and it seems fine except that I need an analog trigger and the counter trigger only allows digital.  I modified the code (see attached) so that the analog input task has an analog trigger and then tried using AIStartTrigger as the source for my digital trigger for the pulse train generation.  This works sometimes, but not others.  Annoyingly when it doesn't work I receive no errors.  The check for available samples always returns 0 and I can see the counter is not triggering on a scope (well it changes level once, but never generates a pulse train).  I searched around and found another example posted (http://forums.ni.com/ni/board/message?board.id=170&message.id=189503#M189503) where a dummy analog output task is created to get an analog trigger.  Instead of using AIStartTrigger they use AnalogComparisonEvent.   Using AnalogComparisonEvent in my code instead of AIStartTrigger (but still in the AI task) seems to work fine.  Is there a reason I shouldn't be using AIStartTrigger?
    Question 2:
      It seems that if my buffer is too small I get a similar sort of problem.  That is, I receive no errors, the available samples always return 0, and the counter never triggers.   In the retrig pulse generation example there is a cryptic remark about making the buffer 1000 points bigger than you need.  I find I generally need something more like 10x points if I purposely try to slow down the system by moving a window around, for example.  My question, though, is why do I not receive an error message and/or is there something I can check that will tell me there is a problem?  I think the problem has something to do with the buffer being overwritten before the first check, but I'm not sure...
    Attachments:
    Multi-Function-Ctr Retrigg Pulse Train Generation for AI Sample Clock Mod.vi ‏182 KB

    Hello Phamton,
    To answer your questions:
    1.  I know that using the AnalogComparisonEvent is the typical way to trigger a counter off of an analog signal.  The is the generally recommended method because the AnalogComparisonEvent comes straight from the analog comparison circuitry, however, the ai/StartTrigger signal should also work to start your counter task.  If this approach was not working sometimes, I would first suspect the signal that was connected to the trigger line, and whether or not it was actually meeting the trigger condition at those times.  Have you tried connecting a scope to the analog trigger signal when your program is not working? 
    2.  I'm not sure of the exact reasoning for that comment in the example code, but even still, if you task is not starting, I would first suspect the actual analog signal that is being used as the trigger.  Connect it to a scope and make sure that it is meeting the trigger condition when you run that program.
    In any case, if your analog input task never receives the start trigger, you should get a timeout error.  Let me know if you have any further questions about this issue.
    Best regards,

  • Problem when using IRoomInfoReader/IRopomUsers in SDN example code

    Hi I am working on EP 6.0 SP2 P31, KMC 6.0 SP2 P31 and making Room development with NW Developer Studio. From https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/kmc/knowledge management and collaboration developers guide.html  I got the room extension example in com.sap.netweaver.kmc.roomextension.zip. I just add a ON_AFTER_CREATE_ROOM and code for handling this event before adding
    IRoomInfoReader roomInfo = (IRoomInfoReader)context.getValue(RoomExtensionParameter.ROOM_INFO);
    or
    IRoomUsers roomUsers = (IRoomUsers)context.getValue(RoomExtensionParameter.ROOM_INFO);
    (in order to retrieve the newly created room’s owner's id)
    The example code is working, the extensions are visible, they can be added to our room template and room can be created successfully with this template.
    After adding one of these two commands program stops just before this command line and there is no error message recorded in the log file.
    Does this KMC release version support using these two interfaces? Thanks for help.
    Best regards.
    Wang

    Hi Wang,
    as a lucky guy working on SP2, you have all logs at hand - did you check both \usr\sap\<id>\j2ee\j2ee_00\cluster\server\managers\console_logs\...error.log as well as \usr\sap\<id>\j2ee\j2ee_00\cluster\server\managers\log\portal\logs\knowledgemanagement.x.log ?!
    Did you try to log extensively? try/catch every Exception?
    Both interfaces do exist on SP2 P31.
    Did you check which class context.getValue(RoomExtensionParameter.ROOM_INFO) in fact produces?! (If not null, ask for .getClass().getName().)
    Hope it helps
    Detlev

  • Example Code for Routine at Data Target in Info Package.

    Hi,
    Can any one send the example code for writing the routines at Data Target of Info Package for Deleting the Request from Info Cube after Update.
    Thanks in Advance,
    Regards,
    srinivas

    Hi All,
    I want to know some examples for guidance in writing the Abap Routine at Data Target of Info Package for Deleting the Request from Info Cube after Update.
    In the Data Targets of Info Package for Info Cubes we can delete the previous request based on the Conditions, exceptions and also based on the Abap Routine. I just want to know how do we write the Routine.
    This option is adjacent to the Maintain to Data Target in Data Targets of Info Package and will available for Info cube only.
    Thanks in Advance,
    Regards,
    srinivas

Maybe you are looking for

  • How do i find/create a missing itunes library .itl file?

    I'm trying to transfer my itunes account from my old laptop to my new one and I have done this succesfully twice over the last couple of years but for some reason it's not working. I copy the whole itunes file to the new laptop but when I open itunes

  • Accessing External Url using Http Utility | Error when using from Weblogic on Solaris

    We are using Http Utility (http://jakarta.apache.org/commons/httpclient/) from Apache for accessing external URL. A XML string is sent as POST parameter to the URL and the response is also an XML string. The URL is accessed over HTTPS protocol. I am

  • BPM-Process as Service getting SAXException while invoking the service

    Hi Everyone, I have create a Process which contain an array element of BPM Object as output of the process, later I deployed it as Process Service. When I am invoking the service from SOAP I am getting "org.xml.sax.SAXException: WSWS3047E: Error: Can

  • SDHC internal card readers needed for school!! Help!

    This really isn't an emergency, but I do need to find out if there are any class 6 SDHC internal card readers out there or even a heavy, large device that reads P2 and SDHC cards. The reason I'm asking is that for our high school media academy, we ne

  • Problem in using LOV for validation-JHS 10.1.3

    Hi all, This problem was also noticed by Phil McDermott (Problem in using LOV for validation-JHS 10.1.3 I am following the demo and I noticed that the Use LOV for Validation functionality does not work on the browse page. However, it does work on the