Daq counter using gate input

In our lab, we have a DAQ 6259 card. previously someone made a c++ programme. Now , i want to use labview to counter . but even i use the example(count digital edge), i cannot get the counts . So i tred it on test panels. only if the edge source is gate input(PFI9), it works. I am wondering what is the problem. could you give me some suggestion?

hi, yao yong, you should read about the configuration you are choosing, the only situation i have seen about using a gate terminal as a input pin is when you signal is too slow and you're measuring frequency, you should try what Kwok How says about try counter input 0 or try daq assistant.vi
Kwok How, i want to ask you or someone else if edge count or frequency measurement recognize every edge ( like noise-generated edges ) or just edges between 0 and 5 volts
best regards
.:. Pedro Rivera .:.
i love to work and develop on labview, this is real fun!!!

Similar Messages

  • Encoder edge counter using analog input

    I have using an 9215A USB (4AI).
    2 AI are logging data in to a txt-file and the other 2AI will be used for counting the edges from a quadrature encoder (A and B pulse train).
    Every edge falling or rising I will write a line in the txt-file also show a egde counter in the VI (total edges read).
    I'm a beginner so I need some help to find out how to do.
    BR
    Johan

    the 9215A do 20kSam/s  , that not too much, so .... your encoder should change state 10k/s max.
    first approach: continious read  (with max speed) with two buffers, while one buffer is filled by the DAQ, analyse the data of the other. Three independend loops : first wait for and read buffer-> send data via queue to second analyse loop -> send data via second queue to third loop that does the file handling.
    second approach: create a trigger so the second loop can be avoided. The DAQmx/Hardware does  might not support the trigger on both edges on two channels, but additional hardware like LS7084 o. HCTL2022 can help you to create the trigger signal. These little bugs are designed for incremental encoders and create a pulse for every change in the A B lines
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

  • How do i develop code in LabVIEW 7.1 for configuring and performing gated edge counting using NI-DAQmx

    Hi,
    My application requires DAQ counter channel to count the rising edge of the input signal connected to the source pin of the counter. This counting has to take place only when there is a high pulse in gate pin of the same counter.This can be developed easily using traditional daq vis.
    Please let me know how to develop code using DAQ mx.
    Thanks,
    Sudha

    There is an example that demontrates how to do this in DAQmx called "Count Digital Events-Pause Trig.vi".
    gus....

  • How to trigger a counter with AI input

    Hi,I have a question on how to trigger a counter with AI input.We are using a DAQ board with two counters(counter 0 & 1),and we have an external synchronization signal input at a frequency of 50 Hz or so.The counter is set to event counting mode.Now we want to trigger one of the counters so that the counter starts a new counting process each time it detects a rising/falling edge from the sync signal.Can anybody kindly show me how to achieve this?Thanks a lot.
    Regards
    Verdi

    Verdi,
    I think that the behavior you are looking for can be achieved by configuring the counter for buffered period measurement. The counter starts counting from some initial value with each rising or falling edge on the gate. You could also use buffered event counting, but the count value will not reset with each edge on the gate. I don't know what you're using to program the board, but you could start by looking at the counter examples that are installed with NI-DAQ.
    Hope this helps,
    Erin

  • Gated-event counting using analog triggers?

    I'd like to software trigger gated-event counting with analog signals. eg. Use a comparison to check analog input levels to a 6024E card, once a trigger level is reached send a digital out from the 6024E to a 6601 gate to commence and terminate a counter of the 6601 card.
    I have found that the counter on the 6024E card is not stable enough for this application, but the NI-TIO cards work reliably.
    Any tips greatly appreciated,
    Alan

    Alan;
    In case you want to trigger a finite pulse train generation of an analog hardware trigger, you can still accomplish that with an e-series board only.
    You will need to use both general purpose counters available on the DAQ device though. The first counter needs to be configured as retriggerable pulse generation, having its gate being routed to the AI Start Trigger pulse of the Analog Input task. With that done, the counter will generate a pulse at its output at every time the Analog Trigger level is met. You, then, configure the second counter to execute a continuous pulse train and route the first counter output to the second counter gate input. That will make the second counter to generate a pulse train that will be "enabled" by the first counter. The p
    ulse train will be generated while the output of the first counter is on its high state level.
    Knowing that, you can configure the pulse width of the first counter to be as wide as you need the second counter to generate the pulse train.
    Hope this helps.
    Filipe A.
    Applications Engineer
    National Instruments

  • How to use counter using PCI 6259

    Hello, users,
    I have a PCI 6259 board and use Labview 7.1.
    I'd like to repetitively count the photon signals at 10ms integration time. I want cumulative counts in every 1 sec (1000ms) (or 1 min (60000ms)) And I want to save counts into txt.file which is open in excel program.
    I am a beginner to use counter using PCI 6259 board.
    1. Could you explain default NI-DAQmx counter terminals, i.e., CTR 0 SRC, CTR 0 GATE, CTR 0 AUX, and CTR 0 OUT?
    2. How do I use them or how can I connect to count TTL pulse using PCI 6259?
    3. As I mention my purpose above, which example is the first step to start working my purpose?
    4. If you know good example, could you tell me about that?
    5. If anyone has labview example which is similar to my aim, could you give me some tips or your examples?
    Any hint, comment or advice would be appreciated.
    Thank you so much for your response.
    Leek2

    I have never used the PCI 6259 but have used counters many times with labview, the coding should be the same independent of the board.  What you want to do is finite buffered edge counting using a internal clock.  The best way to do this is to look at the examples programs and use the express vi to get started, then you can use this code to customize your program exactly as you need.
    To address your questions:
    1. CTR0 means "counter 0" the name of the physical resource sometimes listed at GPCTR0.  Each counter has 4 connections to the outside world:
    source "src"(for counting input TTL signals),
    gate (for synchronizing to external clocks and edges),
    out (for pulse-train out operations)
    and aux (specialty operations such as up/down counting and encoding)
    2.For event counting with internal clocking you will only use the src this is the input from the signal you wish to count (ie PMT discriminator for photon counting).
    3,4,5. Look at the count edge examples, there isn't one that does exactly what you want but I have done this with a 6602 (it has e counters) where I use one set of counters to set up a finite pulse train in your case 1000Hz with 1000 pulses, and another counter to edge count on an external pulse, with the source of this pulse routed from the out of the other counter.  Then you can start the task and read when 1000 samples are in the buffer (about 1 second later).
    Hope this helps,
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • Invalid values for negative counts using DAQmxReadCounterF64 for edge counting

    I am seeing this issue with using DAQmxReadCounterF64 with
    simple edge counting. If the counter reads a negative count value, it
    returns a number that looks like an unsigned 32-bit number rolled over
    (~4294967295).
    I am using DAQmx v8.9.5. PXI-6602 with Windows XP, programming in C++.
    Is this a bug in the driver?

    Hi Mroche,
    You're correct that the number you are seeing is the rollover of an unsigned 32-bit integer.  Newer DAQ products use a 32-bit count register (e.g. M Series, TIO, X Series).  In this register, the value -1 is represented the same as 232-1. 
    I wouldn't call this a bug exactly.  The value you are reading is what is in the count register, and I don't think it makes sense to necessarily assume that 4294967295 should be scaled to -1 for all cases.  Making this assumption would result in undesired behavior for anybody trying to count to 231 or higher (at which point the count would roll over to -231).
    Having said that... position measurements are treated differently starting in DAQmx 9.0 due to the behavior reported on another thread which was in fact deemed a bug (which I notice you have seen already).  The driver casts the raw count to I32 before scaling it to a position.
    Now, I'm not so sure it makes sense to treat the two measurement types differently, but I think the reasoning behind the decision was that negative values make sense when talking about position, but for counting edges not quite as much (what exactly is a negative number of edges?).  In the count edges case, I think it makes the most sense for DAQmx to allow the user to handle rollovers himself.  At the end of the day, all the driver can do is change where the rollover occurs (either at 0 = 232 or 231 = -231).
    In your case, if you want to read (-) values on your count edges task, the easiest way to accomplish this is to read the data back as U32 (DAQmxReadCounterU32) then type cast it to I32.  This will give the result that I think you are looking for.
    If you have any suggestions to help improve usability, please feel free to post to the DAQ Idea Exchange.  Some preliminary ideas to make this experience a little more intuitive might include a property node to set how the data is cast, or perhaps have the driver cast the data to I32 if the Count Direction is set to anything other than Count Up.  Although, the 2nd idea has the potential to break existing applications so it might not be as viable of an option.
    Best Regards,
    John Passiak

  • Losing counts using asynchrono​us reads

    Hi guys,
    I have been working on an application to allow me to do imaging on a microscope. Using an external clock source I need to "bin" photons coming from my sample for a set period of time.
    To do these measurements I devised an APD object in C#. The code to this opject is attached.
    When I want to measure I call the following code to instantiate the APDs I need;
    Identifier (Not Daq related, used by my code elsewhere),
    Channel number (Not Daq related, used by my code elsewhere),
    Device (a 6601 or 6602),
    The counter delimiting bintime,
    Timebase (20 or 80),
    The line taking in triggers,
    The counter counting photons,
    The line taking in the actual photon TTLs
     this.m_apdAPD1 = new KUL.MDS.Hardware.APD("APD1", 0, "Dev1", "Ctr2", "80MHzTimebase", "PFI27", "Ctr1", "PFI39");
     this.m_apdAPD2 = new KUL.MDS.Hardware.APD("APD2", 1, "Dev1", "Ctr4", "80MHzTimebase", "PFI31", "Ctr3", "PFI35");
    Where "this" is the form that hosts my APDs.
    I start actual measurement like so: 
    this.m_apdAPD1.StartAPDAcquisition(2, 128*128, 128);
    Meaning that I will bin photons for a 2 ms period, that my image consists of 128*128 pixels and that I will read those pixels line per line. Once this method is called on the APDs they will sit around and wait until triggers come in on PFI27 or PFI31 (indicating a new position of the sample reached) and then they will count photon TTLs coming in from either PFI39 or 35...
    Internally the APD object uses BeginRead and EndRead sets to read the actual photon counts. TheStartAPDAcquisition is called on the UI thread and for the Reader I set SynchronizeCallbacks = true; Therefore, also the CallBack is fired on the UI thread, which means all measured variables are updated on the UI thread (not that I think it matters here, but still).
    All this works fine most of the time, however, in a seemingly random fashion it will happen that APD1 does not register all triggers coming in on PFI27 and thus never collects all 128*128 pixels (and thus times out). What is strange is that if I switch around PFI27 and PFI31 like so:
     this.m_apdAPD1 = new KUL.MDS.Hardware.APD("APD1", 0, "Dev1", "Ctr2", "80MHzTimebase", "PFI31", "Ctr1", "PFI39");
     this.m_apdAPD2 = new KUL.MDS.Hardware.APD("APD2", 1, "Dev1", "Ctr4", "80MHzTimebase", "PFI27", "Ctr3", "PFI35");
    it is  still the first APD that will time out.
    Furthermore, I am 100% certain the triggers are indeed coming in on these lines from my external source. Also, when I was using my APD objects synchronously in a previous version of the code (or rather, when they relied on Synchronous Reads internally), all counts also registered perfectly. Sadly enough I cannot keep working synchronously for various reasons.
    The randomness of the issue makes me suspect I might be suffering from a bug related to threading/async operations where things happen in the expected order most of the time, yet not always.
    This issue is a big showstopper for me so any help would be greatly appreciated!
    Message Edited by KrisJa on 09-21-2009 05:01 AM
    Attachments:
    APD.cs ‏17 KB

    Hi Dan,
    Thanks already for the interest. First off, I tweaked the code for my APD class just a little bit (commented out some stuff I think was superfluous and explicitly start one of my tasks). The new version is attached, together with the source to PhotoDiode, another detector class that also suffers from the problem.
    I attached a scheme for the triggering/timing as well, I hope it is somewhat clear, if not I can provide more detailed info.
    The APDs are instantiated on a form like so;
    // Board, Binpulsegen, Timebase, Triggerline, TTLCounter, Inputline
    this.m_apdAPD1 = new KUL.MDS.Hardware.APD("APD1", 0, "Dev1", "Ctr6", "80MHzTimebase", "PFI31", "Ctr5", "PFI39");
    this.m_apdAPD2 = new KUL.MDS.Hardware.APD("APD2", 1, "Dev1", "Ctr4", "80MHzTimebase", "PFI27", "Ctr3", "PFI35");
    Subsequently, their events are hooked up and they are started;
    this.m_apdAPD1.StartAPDAcquisition(
                        _docDocument.TimePPixel,                          ​                   // For example 2, indicating 2 ms
                        _docDocument.PixelCount,                          ​                   // For example 128 * 128                   
                        _docDocument.PixelCount / _docDocument.ImageWidthPx); // Mostly 128, to read in 128 value chunks but can be -1 also this.m_apdAPD2.StartAPDAcquisition(
                        _docDocument.TimePPixel,
                        _docDocument.PixelCount,
                        _docDocument.PixelCount / _docDocument.ImageWidthPx);
    When they are started they will sit and wait for triggers coming in from an external Piezo controller (see attached scheme). They will timeout after 5 second.
    The eventhandler for the BufferUpdated event is;
     private void det_BufferUpdated(object __oSender, EventArgs __evargsE)
                KUL.MDS.Hardware.IDetector _idetDetector = (KUL.MDS.Hardware.IDetector)__oSender;    // Get to props/methods of the sender
                ScanDocument _docDocument = this.Document as ScanDocument;                                 // Class that holds data
                if (_idetDetector.Type == DetectorType.APD)
                    //_docDocument.StoreChannelData(1, this.m_apdAPD2.APDBuffer);
                    _docDocument.StoreChannelData(_idetDetector.Channe​l, ((APD)_idetDetector).APDBuffer);
                if (_idetDetector.Type == DetectorType.PD)
                   // PhotoDiodes get treated differently, this eventhandler is used by all IDetectors...
    The AcquisitionDone event is currently not used...
     Finally, my form also holds a Forms.Timer that ticks every 800ms, the Tick handler is as follows;
    private void m_tmrUITimer_Tick(object __oSender, EventArgs __evargsE)
                PaintToScreen();                                  ​                     // Paint the recorded images from both APDs to screen
                UpdateUI();
                if (this.m_apdAPD2.IsDone & this.m_apdAPD1.IsDone)
                    if (this.m_Stage.IsScanning)
                        this.m_Stage.Stop();
                    this.m_tmrUITimer.Stop();
                    this.m_Stage.Home();
                    // Handle auto-save, omitted for clarity.              
                    // Enable all controls again.
                    EnableCtrls();
                    UpdateUI();
                    // Unhook some events here... deleted for clarity.
    I attached the code for the form where all this happens for completeness, it is more messy than my other source files though, because I am constantly tinkering it.
    Finally, what I mean by missed counts is that in 8 out of ten cases, when I set out to record a 128*128 image both APDs actually accumulate 128*128 pulsewidth measurements (=photon counts for every pixel) as expected. However, every so often APD1 (the one that is started first in code) fails to accumulate the full amount of points. After 5 seconds it obviously times out.
    I did a number of tests;
    I disabled each of the APD's one at a time in code and used Measurement and Automation to check if the piezo controller was actually feeding the correct amount of triggers to the terminals used by the disabled APD. As far as I could tell (I tried 10 times for each APD) this was always the case, so the problem is not with actual missing HW triggers
    I changed the counters and PFI's used by each instance of my APD class. This also had no effect. 8 out of 10 measurements were ok butevery so often APD1 failed ( so again the instance that was started first ) even though it was now hooked up to collect the signals that were previously going to the APD2 instance (I hope this makes sense).
    I set the APD's up to do -1 reads (all samples available) and the amount of lost pixels is way less than 128 and appears random.
    So in conclusion, the bug is quite random. Mostly my app works fine, but sometimes it does not. AFAIK the HW is fine. The randomness of it all makes my suspect something to do with concurrency (in the async calls???) but I do not see how... This is a really frustrating issue!!
    Anyway, I hope my ramblings make sense to you! If you need info, please let me know!
    Attachments:
    Imaging Timing Implementation.pdf ‏66 KB
    APD.cs ‏17 KB
    PhotoDiode.cs ‏16 KB

  • Measure rpm and PWM signals using digital input of NI9401 module

    Hi, is there a simple way how measure rpm (to 5000 rpm) and PWM (about f=3kHz) signals using digital input of NI9401 (ultrahigh-speed digital I/O)  module plugged in NI 9172 ?  I will wellcome any suggestions and VI examples (bether still). I'm begginer using LView 8.2. I apologize for my poor English. Many thanks.

    Hi CUA,
    Since you have already the right tools, you just need to get started with the software. The NI-9401 will give you access to the counters that are inside the cDAQ chassis 9172.
    You need to place the module in slots 5 or 6. You can read in how they work and how to configure them in the counters section of the user guide found here.
    Now to measure rpm, you can either measure the period of the signal (seconds) and multiply by 60 to have minutes and the number of ticks per revolution. You can find a shipped example to read period called “Meas Dig Freq-Buffered-Cont-Large Range 2 Ctr.vi” found under Hardware Input and Output » DAQmx » Counter Mesurements
    To measure PWM, it is similar procedure and you can read the semiperiod (high time or low time). There is also a shipped example called “Meas Semi-Period.vi” found under the same location.
    There is great information for these kind of task at this page or just post back if you need to.
    Hope this helps.
    Gerardo O.
    RF Systems Engineering
    National Instruments

  • Count of records input via MM01

    How can we do count of records input via MM01?
    Thanks,
    AP

    Hi,
    it depends of using MM01.
    MARA, MARC, MARD, MVKE etc.
    regards, Dieter

  • Losing counts using asynchronous reads

    Hi guys, I have been working on an application to allow me to do imaging on a microscope. Using an external clock source I need to "bin" photons coming from my sample for a set period of time. To do these measurements I devised an APD object in C#. The code to this opject is attached. When I want to measure I call the following code to instantiate the APDs I need; Identifier (Not Daq related, used by my code elsewhere), Channel number (Not Daq related, used by my code elsewhere), Device (a 6601 or 6602), The counter delimiting bintime, Timebase (20 or 80), The line taking in triggers, The counter counting photons, The line taking in the actual photon TTLs  this.m_apdAPD1 = new KUL.MDS.Hardware.APD("APD1", 0, "Dev1", "Ctr2", "80MHzTimebase", "PFI27", "Ctr1", "PFI39");
     this.m_apdAPD2 = new KUL.MDS.Hardware.APD("APD2", 1, "Dev1", "Ctr4", "80MHzTimebase", "PFI31", "Ctr3", "PFI35");  Where "this" is the form that hosts my APDs. I start actual measurement like so:  this.m_apdAPD1.StartAPDAcquisition(2, 128*128, 128);  Meaning that I will bin photons for a 2 ms period, that my image consists of 128*128 pixels and that I will read those pixels line per line. Once this method is called on the APDs they will sit around and wait until triggers come in on PFI27 or PFI31 (indicating a new position of the sample reached) and then they will count photon TTLs coming in from either PFI39 or 35...  Internally the APD object uses BeginRead and EndRead sets to read the actual photon counts. TheStartAPDAcquisition is called on the UI thread and for the Reader I set SynchronizeCallbacks = true; Therefore, also the CallBack is fired on the UI thread, which means all measured variables are updated on the UI thread (not that I think it matters here, but still). All this works fine most of the time, however, in a seemingly random fashion it will happen that APD1 does not register all triggers coming in on PFI27 and thus never collects all 128*128 pixels (and thus times out). What is strange is that if I switch around PFI27 and PFI31 like so:  this.m_apdAPD1 = new KUL.MDS.Hardware.APD("APD1", 0, "Dev1", "Ctr2", "80MHzTimebase", "PFI31", "Ctr1", "PFI39");
     this.m_apdAPD2 = new KUL.MDS.Hardware.APD("APD2", 1, "Dev1", "Ctr4", "80MHzTimebase", "PFI27", "Ctr3", "PFI35");  it is  still the first APD that will time out. Furthermore, I am 100% certain the triggers are indeed coming in on these lines from my external source. Also, when I was using my APD objects synchronously in a previous version of the code (or rather, when they relied on Synchronous Reads internally), all counts also registered perfectly. Sadly enough I cannot keep working synchronously for various reasons. The randomness of the issue makes me suspect I might be suffering from a bug related to threading/async operations where things happen in the expected order most of the time, yet not always. This issue is a big showstopper for me so any help would be greatly appreciated! Message Edited by KrisJa on 09-21-2009 05:01 AM

    Hi Dan, Thanks already for the interest. First off, I tweaked the code for my APD class just a little bit (commented out some stuff I think was superfluous and explicitly start one of my tasks). The new version is attached, together with the source to PhotoDiode, another detector class that also suffers from the problem.  I attached a scheme for the triggering/timing as well, I hope it is somewhat clear, if not I can provide more detailed info. The APDs are instantiated on a form like so; // Board, Binpulsegen, Timebase, Triggerline, TTLCounter, Inputline
    this.m_apdAPD1 = new KUL.MDS.Hardware.APD("APD1", 0, "Dev1", "Ctr6", "80MHzTimebase", "PFI31", "Ctr5", "PFI39");
    this.m_apdAPD2 = new KUL.MDS.Hardware.APD("APD2", 1, "Dev1", "Ctr4", "80MHzTimebase", "PFI27", "Ctr3", "PFI35");  Subsequently, their events are hooked up and they are started; this.m_apdAPD1.StartAPDAcquisition(
                        _docDocument.TimePPixel,                                             // For example 2, indicating 2 ms
                        _docDocument.PixelCount,                                             // For example 128 * 128                                       _docDocument.PixelCount / _docDocument.ImageWidthPx); // Mostly 128, to read in 128 value chunks but can be -1 also this.m_apdAPD2.StartAPDAcquisition(
                        _docDocument.TimePPixel,
                        _docDocument.PixelCount,
                        _docDocument.PixelCount / _docDocument.ImageWidthPx);  When they are started they will sit and wait for triggers coming in from an external Piezo controller (see attached scheme). They will timeout after 5 second. The eventhandler for the BufferUpdated event is;  private void det_BufferUpdated(object __oSender, EventArgs __evargsE)
                KUL.MDS.Hardware.IDetector _idetDetector = (KUL.MDS.Hardware.IDetector)__oSender;    // Get to props/methods of the sender
                ScanDocument _docDocument = this.Document as ScanDocument;                                 // Class that holds data
                if (_idetDetector.Type == DetectorType.APD)
                    //_docDocument.StoreChannelData(1, this.m_apdAPD2.APDBuffer);
                    _docDocument.StoreChannelData(_idetDetector.Channel, ((APD)_idetDetector).APDBuffer);
                if (_idetDetector.Type == DetectorType.PD)
                   // PhotoDiodes get treated differently, this eventhandler is used by all IDetectors...
            } The AcquisitionDone event is currently not used...  Finally, my form also holds a Forms.Timer that ticks every 800ms, the Tick handler is as follows; private void m_tmrUITimer_Tick(object __oSender, EventArgs __evargsE)
                PaintToScreen();                                                       // Paint the recorded images from both APDs to screen            UpdateUI();
                 if (this.m_apdAPD2.IsDone & this.m_apdAPD1.IsDone)
                    if (this.m_Stage.IsScanning)
                        this.m_Stage.Stop();
                    this.m_tmrUITimer.Stop();
                    this.m_Stage.Home();
                    // Handle auto-save, omitted for clarity.              
                    // Enable all controls again.
                    EnableCtrls();
                    UpdateUI();
                    // Unhook some events here... deleted for clarity.
            }  I attached the code for the form where all this happens for completeness, it is more messy than my other source files though, because I am constantly tinkering it.  Finally, what I mean by missed counts is that in 8 out of ten cases, when I set out to record a 128*128 image both APDs actually accumulate 128*128 pulsewidth measurements (=photon counts for every pixel) as expected. However, every so often APD1 (the one that is started first in code) fails to accumulate the full amount of points. After 5 seconds it obviously times out. I did a number of tests; I disabled each of the APD's one at a time in code and used Measurement and Automation to check if the piezo controller was actually feeding the correct amount of triggers to the terminals used by the disabled APD. As far as I could tell (I tried 10 times for each APD) this was always the case, so the problem is not with actual missing HW triggersI changed the counters and PFI's used by each instance of my APD class. This also had no effect. 8 out of 10 measurements were ok butevery so often APD1 failed ( so again the instance that was started first ) even though it was now hooked up to collect the signals that were previously going to the APD2 instance (I hope this makes sense).I set the APD's up to do -1 reads (all samples available) and the amount of lost pixels is way less than 128 and appears random.So in conclusion, the bug is quite random. Mostly my app works fine, but sometimes it does not. AFAIK the HW is fine. The randomness of it all makes my suspect something to do with concurrency (in the async calls???) but I do not see how... This is a really frustrating issue!! Anyway, I hope my ramblings make sense to you! If you need info, please let me know!  

  • Event counter using USB-6210 analog

    Hi,
    Any suggestions or directions where to look to generate a VI that would record event from a magnetic counter of a mouse wheel. I would like to record up to 16 wheels using the USB-6210 device. Thanks!
    VO2max

    Thanks for the extra information.
    The 6210 actually has two counters, so you could count the edges (on two of the wheels) if the signals are TTL compatible.  You can use the Count Digital Events.vi example to help you get started.  From LabVIEW, it can be found at:
    Help » Find Examples... » Hardware Input and Output » DAQmx » Counter Measurements » Count Digital Events
    If your signals are TTL compatible, I would highly recommend purchasing a PCI-6602 and using this method for all 8 channels.  You could modify the example code by increasing the delay (software-timed sample rate) to a larger value (say 1 minute), and logging the results to a file as you run.  Doing this would log the value of the event counter every minute, and would keep the file size relatively small (about 15kB if you run for 8 hours).
    If you must use a single 6210 and require all 8 channels, the only option would be to use continuous analog inputs.  You would have to sample at a high enough rate to not skip the pulses (I am not sure what that is without knowing more about the signal), and then process the digitized signal in software to determine the information that you need.  I would use the Producer/Consumer design template in conjunction with a continuous analog input example to get started.  In the consumer loop, you would have to implement the functionality of the counter in software.
    Using a hardware counter would be preferrable to using analog inputs.  The counter is made for exactly this type of task, and implementing it in software can be complicated as well as processor intensive.  If you have any questions let me know, I'm happy to help you out.  You can always try out the counter task on the 6210 for two wheels to see how it will work before deciding whether or not to purchase a new board.
    -John 
    P.S. After your first post I had assumed that you were testing computer peripherals, but it looks like you actually have eight rodents.  We had a good laugh over here over my confusion.
    John Passiak

  • Sound Remover - use external input source?

    I'm wondering if Sound Remover can use an input sound file to analyze and then remove sound from the main file?
    I have file A (vocal mic with drum bleed) and file B (drums).  I'd like to remove or minimize the drums in the vocal mic.  Seems ideal to use the drum mix file to analyze and remove drums from the vocal mic.
    I'll try the old school time-align, eq match, inverse mix method and see what I get, but it would be so cool if there was some Audition magic to help.
    Thanks for any info!
    - Jance

    If the two files are of the same sample rate and channel count, you can capture the sound model from one file and apply the effect to the other.  You can also save the profile selection to disk and load it from within the Sound Remover effect.

  • How do i use an input file with Asian characters(Unicode)?

    /* Ardor
    * Illiteraminator.java
    * Version beta 1.0
    * December 7, 2007
    * Main interfacing class
    import java.io.*;
    import java.util.*;
    public class Illiteraminator{
      public static void main (String [] args){
      //  ArrayList<Word> dictionary = new ArrayList<Word>();
        String fileName = "Mandrin.txt";
        String character= "",definition = "",inputLine;
        try{
          Scanner fileScan = new Scanner (new File (fileName));
          while (fileScan.hasNext()){
            inputLine = fileScan.nextLine();
            Scanner sc = new Scanner(inputLine);
            character = sc.next();
            while (sc.hasNext()){
              definition = definition + " " + sc.next();
            }//end while sc
           // dictionary.add(new Word(character, definition));
            //definition = "";
            //character = "";
          }//end while fileScan
        } catch (FileNotFoundException e){
          System.out.println("File not found, dig around for Mandrin.txt");
          System.exit(1);
        }//end catch
        System.out.println(character);
        System.out.println(definition);
      }//end main
    }//end class IlliteraminatorHi, i'm a first time programmer. Never touched programming until i took a Java class in university last semester. I am currently attempting to write a program to help me move away from my illiteracy in Mandrin. So, that's my code, and i am using Dr.Java while writing it. When i tested it out the output looked something like this v
    A p p l e
    M o n k e y C a t D o n k e y
    My input file is saved in Unicode. It contains letters that cannot be saved in ANSI. I tried UTF-8, but the interactions section showed no output...
    Is this just a problem with Dr.Java? Will i encounter a similar problem when i turn this into a GUI?
    The following is a copy and pasted version of the txt file i used as input. It is saved in the Unicode format.
    &#30340;[de] <grammatical particle marking genitive as well as simple and composed adjectives>; &#25105;* w&#466;de my; &#39640;* g&#257;ode high, tall; &#26159;* sh�de that's it, that's right; &#26159;...* sh�...de one who...; &#20182;&#26159;&#35828;&#27721;&#35821;*. T&#257; sh� shu&#333; H�ny&#468;de. He is one who speaks Chinese. [d�] &#30446;* m�d� goal [d�] true, real; *&#30830; d�qu� certainly
    &#19968;(A&#22777;)     [y&#299;] one, a little; &#31532;* d�-y&#299; first, primary; &#30475;*&#30475; k�ny&#299;k�n have a (quick) look at [y�] (used before tone #4); *&#20010;&#20154; y� g� r�n one person; *&#23450; y�d�ng certain; *&#26679; y�y�ng same; *&#26376;y�yu� January [y�] (used before tones #2 and #3); *&#28857;&#20799; y�di&#462;nr a little; *&#20123; y�xi&#275; some {Compare with &#24186;(F&#20040;) y&#257;o, which also means "one"}
    &#26159;     [sh�] to be, *&#19981;*? sh�bush�? is (it) or is (it) not?; *&#21542; sh�f&#466;u whether or not, is (it) or is (it) not?

    Sorry, but i do not understand this post at all... Can anyone explain it to me? Is he saying my IDE is running on something other than Unicode?
    PS: I tried one of the Scanner constructors that takes a charset parameter. That fixed the odd output! However, every Chinese character has been replaced with a question mark. (It was a series of weird characters before i used the constructor with a charset parameter.)

  • How to create a counter using Oracle SQL Developer?

    Is there any way to create a counter using Oracle SQL Developer to create the below scenario. Meaning it will recorded down the name of user and ID and time and the date they login.
    Library portal home statistics shows how many users (outside and within the campus) visit the library portal.
    Page Access statistics is recorded on an hourly basis. Users may select the statistics by
    yearly (statistics displayed by all months in the selected year)
    monthly (statistics displayed by all days in the selected month)
    daily (statistics displayed by all hours in the selected day)

    I'm giving here one basic post - hope this will solve your problem --
    SQL>
    SQL>
    SQL> create table audit_info
      2   (
      3     usr        varchar2(50),
      4     log_time   timestamp(6)
      5    );
    Table created.
    SQL>
    SQL>
    SQL>  create table err_log
      2     (
      3       log_cd      varchar2(20),
      4       log_desc    varchar2(500)
      5     );
    Table created.
    SQL>
    SQL>
    SQL>   create or replace procedure ins_err(errcd   in  varchar2,
      2                                        errnm   in  varchar2)
      3    is
      4      pragma autonomous_transaction;
      5    begin
      6      insert into err_log values(errcd,errnm);
      7      commit;
      8    end;
      9  /
    Procedure created.
    SQL>
    SQL>
    SQL>   create or replace procedure ins_aud(ud   in varchar2,
      2                                        unm  in varchar2)
      3    is
      4      pragma autonomous_transaction;
      5    begin
      6      insert into audit_info values(ud,unm);
      7      commit;
      8    exception
      9      when others then
    10        ins_err(sqlcode,sqlerrm);
    11    end;
    12  /
    Procedure created.
    SQL>
    SQL>
    SQL>
    SQL> create or replace trigger log_odsuser1
      2   after logon on odsuser1.schema
      3   begin
      4     ins_aud('ODSUSER1',sysdate);
      5   exception
      6     when others then
      7       ins_err(sqlcode,sqlerrm);
      8   end;
      9  /
    Trigger created.
    SQL>
    SQL*Plus: Release 9.2.0.1.0 - Production on Tue Jun 12 12:21:09 2007
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.6.0 - Production
    SQL>
    SQL>
    SQL>
    SQL> set serveroutput on
    SQL>
    SQL>
    SQL> select * from audit_info;
    USR
    LOG_TIME
    ODSUSER1
    12-JUN-07 12.00.00.00000000 AMHope this will solve your purpose.
    Regards.
    Satyaki De.

Maybe you are looking for