How do I synchronize a pulse output to a sine wave input on a pci-6602 card?

I have a sine wave from a function generator as the input on the source of a counter. Input frequencies vary from 2-60 kHz. I want to produce a pulse train at a different frequency (10 Hz), but in phase with the sine wave. I have only been using Labview 5.1 for a short time. I am using the PCI-6602 card with a SCB-68 connecting block.

Hello;
Unfortunately, you can't connect a analog sinewave to the counter source. Counters only work with digital TTL signal type. To accomplish that task, you will need a MIO board working in sync with the 6602 you already have.
Regards
Filipe A.
Applications Engineer
National Instruments

Similar Messages

  • How to measure relative phase of several sine wave inputs

    I'm using a USB-6229 to acquire 10 sine waves, and I would like to output their rms amplitudes and relative phases.  The rms amplitude is not a problem, but I wasn't sure how to go about determining the phase of one signal relative to another.  Do I need to use the Frequency Response analysis step?  Thanks.

    Hi,
    There are some functions you can use to measure the relative phase. You can either measure the phase of every signal related to another one using like you said: a frequency response function step. Using one of these to functions might do the job: “Frequency Response, Express VI” or “Frequency Response Function (Mag-Phase).vi, if you are working in LabVIEW. The first one of these functions "Frequency Response" is also found in signal express and is the one I think you are refering to.
    Although this functions is use for a stimulus response approach they will give you the relative phase of Y with respect to X, “Typically, time signal X is the stimulus, and time signal Y is the response of the system.  in signal express your options is the frequency response step.
    I would also like to point you to some references that might serve you as reference when doing spectrum analysis: An Overview of Frequency-Domain Measurements and FFT Analysis.
    Message Edited by Jaime F on 02-06-2008 11:42 AM
    Jaime Hoffiz
    National Instruments
    Product Expert
    Digital Multimeters and LCR Meters
    Attachments:
    frf.png ‏37 KB

  • Ramping a pulse signal using PCI-6602 card

    I'm controlling a stepper motor and need a continuous pulse output with variable frequency. I need to accelerate and decelerate teh motor (It can't start immediately at a high frequency but needs to be ramped up to it). I can't have any hiccups in the signal or the motor can stall. It seemed I had my own ramp program written (which gradually increased the frequency value sent to the counter) to solve this problem, but when I switched to Office2000 I started getting hiccups in my signal. I also have a PCI 1200 card and could use A/O but I think using the counter signals would be better. If I'm wrong let me know. Once I have the motor up to speed I am reading in a pulse signal to analyze with FFT.
    thanks for y
    our help.

    A few thoughts & musings, hope some of them are useful:
    1. The sequence for setting a new frequency should be to first load up the new pulse specs (use 1 & 2, not 3 & 4), then issue the "switch cycle" command to 'Counter Control.vi' You can look at NI's example program called 'Pulse Width Modulator' to verify syntax.
    2. If your frequencies are low enough and your loop time is fast enough, you may be trying to update the pulse specs before the previous specs have completed a full cycle. This has traditionally been a no-no, though I'm not 100% sure that it remains one with the latest NI-DAQ drivers.
    3. No ideas about the possible interaction with MS Windows and/or Office 2000. Haven't used either.
    4. (My own latest installment in a multi-year running gripe at NI): Wh
    en oh when will we be granted the ability to perform buffered counter OUTPUT operations? Just as in the analog world, one can acquire a signal with AI and then reproduce it with AO, it would be REALLY REALLY handy in the counter world to measure with buffered semi-periods and then reproduce the same pulse train with a buffered output.

  • "how do i synchronize between two outputs"

    Hi
    I'm using a bapi data service "po_bapi_getlist" which have two outputs :header and raws.
    When I'm connecting each output to table view, the output information is not synchronized,
    when i put the cursor on the line's header - "po nam" the cursor is not standing on the relevant "po nam" raw in raw view .
    The BAPI structure has one input and tow output ports and they are both RecordSets (table output).
    They have the same key fields PO_ number.
    i've added the info' about our system for your review \ help:
    GML version: 799.14.0027
    Client version: 700.14.0.1
    VCServer version:700.14.0.1
    Flex version:700.14.0.1
    Portal content version (HTMLBKit): 700.14.0.1
    Portal Connector version: 700.14.0.1
    Thanks ahead,
    Regards
    Eli.

    Hi Eli,
    Create dummy fields in the outputs that match the missing fields.  The dummy fields have to be the same type as the real fields they represent.  Then in the union all fields will show up.  You can then use  a goup by object to put the values together.  I have done this a few times and it works.  Hope this helps.
    Example:
    Output 1
      firstname
      lastname
      address   (dummy field)
      city           (dummy field)
    Output 2
      address
      city
      firstname  (dummy field)
      lastname   (dummy field)

  • How can I use the instrument toolbox in MATLAB 6.1 to contol the PCI-GPIB card under Linux?

    I'm trying to use the PCI-GPIB controller to control lab equipment through MATLAB 6.1 (R12.1) under Linux. MATLAB's instrument toolbox seems to integrate with NI's board, but the MATLAB documentation says it requires the installation of a driver. I've downloaded the linux gpib driver, and I'm able to run the associated utilities (ibconf, ibic, ibsta), but MATLAB cannot interface to it. For example,
    >> g=gpib('ni',0,1)
    ??? Error using ==> gpib/gpib
    The specified VENDOR adaptor could not be found.
    Where can I find a MATLAB driver and how can I install it?
    Thanks,
    Richard

    Hello-
    The knowledge base: "Can Matlab for Windows Call the National Instruments GPIB Driver?" Also applies to this question as well. This article is very extensive. Try searching on ni.com for "+matlab +gpib" for more details.
    Randy Solomonson
    Application Engineer
    National Instruments

  • How to generate 3 phase sine wave to output on ELVIS

    Hi .I need to make a star or delta connected circuit on ELVIS board.2 make this circuit I need 3 wave generator( with 120 phase shift) and one common ground
    and because the ELVIS function generator can only generate one wave I decided to generate countionuos sine wave in Labview.
    Now I can generate 2 continuis sine wave in labview and output them on the analog outputs of ELVIS.Ao-0 and A0-1
    but I dont know what to do for the third signal.the elvis board just has 2 analouge output and when I use  Ao-0 and A0-1 I cant use ELVIS function generator after that.so would u please help me on this problem.how can I output 3 contious sine wave in Elvis.I have attached my VI to this post
    Attachments:
    new.vi ‏38 KB

    Hi, I am also having some problem in generating two signals from two AO. Could you please tell me how to generate two different signals from two AO. I have attached vi which generate square wave from one AO 0. I need the inverted signal in AO 1. 
    Attachments:
    Pulse Width Modulation.vi ‏48 KB

  • Continuous pulse train generation on my PCI 6602 takes up too much of my system resources.

    I am using a PCI 6602 to generate a clock signal that is to synchronize pattern generation on two PCI 6534's. I have done this by generating a pulse train at a user defined frequency on the PCI 6602. My problem is when I generate this pulse train, the program uses all of the computer's CPU, and slows the rest of the processes down. Just to let you know, I have isolated this program to ensure it is the only thing running, and it still has the same result. The CPU usage soars to 100%(and remains constant) and the memory consumption increases (and remains constant) as well. Also, if it helps at all, the CPU consumption is completely independent of the frequency that is being gene
    rated, but the memory usage increases a little with an increase in frequency. Does anyone have any insite as to how to fix this, for I have noticed that all of the posted examples like this behave in the same manner.
    Thanks,
    Dave

    Russell,
    Thanks for the reply. Just about five minutes ago I came to the realization that the card itself was not causing this to happen. When I took a closer look, I found that my C program and all of the example programs were using the NIDAQWaitForKey() function to enable countinuous generation. So what was happening was that function was constantly polling the CPU to find a key to be pressed. So lets just say I found a way around this problem, and so everything is well. There are a handfull of things that i need to work on now, but at least I know my clock generation program is correct and I can stop banging my head against a wall trying to solve a problem that does not exist and for which there is no solution.
    Thanks Again,
    Dave

  • Counter using PCI-6602 for multi output

    Hi guys,
    currently I tried to control a linearmotor using PCI-6052E and PCI-6602.
    The questions is, how to use PCI-6602 to be a counter which will be converted to several output (multioutput):
    (1) converted to position >> 1count = ...[mm] --> position measurement
    (2) converted to voltage >> 1count = ...[mV] or [V] --> voltage measurement
    (3) converted to current >> 1count = ...[mA] or [A] --> current measurement
    (4) converted to velocity >> 1count = ...[mm/s] --> velocity measurement
    (5) converted to acceleration >> 1count = ...[mm/s^2] --> acceleration measurement
    (6) converted to force >> 1count = ...[N] or [kg.mm/s^2] --> force/load measurement
    (7) converted to frequency >> 1count=...[Hz] --> frequency measurement
    (i) Please assist me how to connect the driver's encoder (Ch. A A/ B B/ Z Z/) with PCI-6602, so I can get all informations above (7 measurements). What/which port of PCI-6602 connect to where from the driver.
    (ii) Please assist me how to connect the feedback signal to the PC. What/which port of PCI-6602 connect to PC.
    (iii) How to test those 7 measurements above using Measuremant and Automation Explorer (MAX) ver.4.4.1?
    Thank you for your kindly help and assistance.
    Best wishes,
    hendro

    Dear Jochen,
    (1) Principally, I'd like to use PCI-6602 to be a motion encoder also be a counter (Is it possible? Due to the manual, it is possible). I expect to have all information, such as position, time, velocity, etc. from that motion encoder (or at least the position and time). It is also expected of using PCI-6602 to do all measurements that I mentioned before . My meaning is, after having a signal from the counter, that 'count' will be converted to desire units under other programs. So, in this case, PCI-6602 is only used to get the 'count'.
    Simplified, the voltage command will send to the system (linear motor) through PCI-6052E (-10V to 10V). The actual position or other actual information will be catched (read) by using PCI-6602 (as a motion encoder, also as a counter). Then, this actual position will be used as a feedback, that will be compared to desired position.
    Is that also possible to use PCI-6602 be a motion controller + a counter + a frequency measurement in a same time parallely?
    I don't decide yet (I don't know) which acquisition rate will be needed/required, higher is better.
    (2) I'd like to apply an adaptive robust controller (yes, it is a closed loop system) under matlab with their feature called Real-Time-Workshop instead of using LV.
    (3) Power drive for the linear system will be driven by AC servo drive.
    Thanks for your help before,
    Warmly regards,
    hendro

  • How can I get stable Sin wave through NI 9264 ?

    Dear all,
    I would like to generate 64 analog sin wave with frequency up to 20K Hz.
    Then I bought 4 NI9264:
    25 kS/s/ch simultaneous output
    Hot-swappable operation
    Spring terminal or D-SUB connectivity options
    250 Vrms isolation (spring terminal version)
    60 VDC isolation (D-SUB version)
    .The attached is my file for the generation. when I used Osciloscope to monitor the output, I could not get any stable output.
     Could I have the reasons and suggestions for my objective please?
    Thanks!
    Zhu_nuo
    Attachments:
    64 Channel Programmatic v2.vi ‏22 KB

    Hi Zhuming,
    The VI above only provides waveform information for a single channel. In order to output data across all 64 channels in the task, we can make use of a For Loop to build an array of waveform information for each channel. In the example below, I've made use of an Auto-Indexing For Loop in order to build up a waveform output array of 64 elements. I've wired this to an NI-DAQmx Analog 1D Wfm Write VI; the 1D array's elements represents each channel in the group of selected channels for generation.
    An important thing to note is that the NI 9264 16 channel analogue output modules have a maximum sample rate of 25 kS/s/ch. This means that each channel is capable of writing 25kS/s simultaneously.
    To reliably generate a signal, we generally need to have it comprised of around 5 to 10 points of data. This allows us to represent the signal to a good degree of accuracy. For example, if I wanted to reliably output a 1Hz Sine Wave, I would need to break the 1Hz wave into ten separate points and then output them at a rate of 10Hz. In terms of the NI 9264, the maximum frequency content (Two points of information) that can be generated is 25kHz/2 = 12.5kHz wave. The maximum clear wave frequency that we could produce with the 9264 (A wave built up of ten points) is 2.5kHz simultaneously across each channel. This is all to do with Nyquist's Theorem. This should explain why the frequency appeared to drop.
    Out of interest, how are you measuring these output frequencies?
    Kind Regards,
    Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

  • How to generate a continuous sine wave for a given amount of time

    I am trying to output a continuous sine wave for a speaker, but I am having difficulty making it continuous rather than looping the signal for a given amount of time, which causes discontinuities. There is a VI in the Labview examples titles Continous Generation, but it produces a square wave. Is there a way to adapt this VI such that the amplitude and frequency can be used as inputs to create a sine wave?

    I found a VI that ships with labview(7.0)called continuous sound output. the output of this is a sine wave or you can change it to whatever you want.
    Sorry cannot help more
    Joe
    Joe.
    "NOTHING IS EVER EASY"

  • Genral How do I get syncronize​d encoders to work with a PCI-6602

    I am new to the DAQmx and need some general help writting VB code that works.
    I can get some things to work, but others don't work at all and I don't have enough knowledge of these drivers to get up the learnign curve hump.
    I wanted to post this as a follow-up
    to the thread:
    http://forums.ni.com/ni/board/message?board.id=40&​message.id=5430&query.id=215100#M5430
    But I couldn’t figure out how.  
    Anyway, my problem is that I will
    eventually have to do much the same thing as the above thread with two encoders in
    sync.
    I have a pci-6602 card, and my code
    snippet is at the bottom  The 6602 doesn't have the analog in to syncronize to like the thread above
      (yes, it is in Visual basic
    6)
    I can’t figure out the
    DAQmxCfgSampClkTiming.   Why do I want to have a sample clock at all?   (okay,
    when I have two channels synced I do – but this sample I want to get working and
    I don’t see why)?
    Can’t I just get a new counter value
    with each quadrature input change?   (That’s what the DEV/PFI39 is, the same as
    encoder channel A )
    Okay, so hopefully you tell me how
    to get that to work.
    Next question:  What can I use for
    the DAQmxCfgSampClkTiming when I am doing two channels in sync?  Nothing seems
    to work, and I have tried a bunch of things.
    Brynn
    Rogers
    DeltaTech
    Controls
    952-403-7400
    x431
    //// code that doesn't really work.   "Dev1/PFI39" is the channel A encoder input, I just want new data whenever the encoder changes (for now)
        ' DAQmx Configure
    Code
        DAQmxErrChk
    DAQmxCreateTask("count", TaskHandle)
        TaskIsRunning =
    True
        DAQmxErrChk
    DAQmxCreateCIAngEncoderChan(TaskHandle, "Dev1/ctr0", "",
    DAQmx_Val_EncoderType2_X4, 0, 0#, DAQmx_Val_EncoderZIndexPhase1_AHighBHigh,
    DAQmx_Val_AngleUnits2_Ticks, 500, 0#, "")
        DAQmxErrChk
    DAQmxCfgSampClkTiming(TaskHandle, "Dev1/PFI39", 1, DAQmx_Val_Rising,
    DAQmx_Val_AcquisitionType_FiniteSamps, samples)
        'DAQmx Start
    Code
        DAQmxErrChk
    DAQmxStartTask(TaskHandle)
        ' DAQmx Read
    Code
        DAQmxErrChk
    DAQmxReadCounterF64(TaskHandle, -1, 0.05 * samples, data(0), samples, ReadCount,
    ByVal 0&)
        ' All done!
    StopTask
        'DAQmxErrChk
    DAQmxStopTask(TaskHandle)
        'Stop task isn't needed because
    Clear Task also stops task
        DAQmxErrChk
    DAQmxClearTask(TaskHandle)
    Solved!
    Go to Solution.

    Okay,   Here is the working routine to get syncronous data from two encoders, and it seems to work okay.
       I have this working with my two 2000 CPR encoders, we'll see how it works when I get the 500,000 CPR encoders later.
    The three big problems that caused it to not work were:  
    1)   Theduty cycle argument for the createCOpulsechanfreq task needed to be between 0 and 1.  I had '50.0' before, it works when it is '0.5'
    2)   The sample timebase that I used (ctr7) needed to be started before either of my two angle encoder tasks were created
    3)   The "dev/PFI8" string needed to be changed to "/dev/PFI8".   I don't really understand why, but that was what seemed to fix it all.
    So this question has been answered...      Now I have a different problem while reading 8 PWM values at once with the Semiperiodcounter,  which I will post in a new a different thread.
    Thanks!
    ''''''''''''''''''   Working code here
    Public Sub Aquireposition(samples As Long, data0() As Double, data1() As Double)
    Dim BaseTaskHandle    As Long
    Dim encoder0TaskHandle    As Long
    Dim encoder1TaskHandle    As Long
    Dim TaskIsRunning As Boolean
    Dim ReadCount As Long
    Dim strCounterString As String
       On Error GoTo ErrorHandler
        DAQmxErrChk DAQmxCreateTask("base", BaseTaskHandle)
        DAQmxErrChk DAQmxCreateCOPulseChanFreq(BaseTaskHandle, "/Dev1/ctr7", "base", DAQmx_Val_FrequencyUnits2_Hz, DAQmx_Val_Level1_Low, 0#, 200#, 0.5)
    'Specify continuous timing
        DAQmxErrChk DAQmxCfgImplicitTiming(BaseTaskHandle, DAQmx_Val_AcquisitionType_ContSamps, 200)
         'DAQmx Start Code
        DAQmxErrChk DAQmxStartTask(BaseTaskHandle)
    ' DAQmx Configure Code
        DAQmxErrChk DAQmxCreateTask("encoder", encoder0TaskHandle)
        TaskIsRunning = True
        DAQmxErrChk DAQmxCreateCIAngEncoderChan(encoder0TaskHandle, "/Dev1/ctr0", "", DAQmx_Val_EncoderType2_X4, 0, 0#, DAQmx_Val_EncoderZIndexPhase1_AHighBHigh, DAQmx_Val_AngleUnits2_Degrees, 500, 0#, "")
        DAQmxErrChk DAQmxCfgSampClkTiming(encoder0TaskHandle, "/Dev1/PFI8", 1, DAQmx_Val_Rising, DAQmx_Val_AcquisitionType_FiniteSamps, samples)
        ' second encoder
        DAQmxErrChk DAQmxCreateTask("encoder1", encoder1TaskHandle)
        TaskIsRunning = True
        DAQmxErrChk DAQmxCreateCIAngEncoderChan(encoder1TaskHandle, "/Dev1/ctr1", "", DAQmx_Val_EncoderType2_X4, 0, 0#, DAQmx_Val_EncoderZIndexPhase1_AHighBHigh, DAQmx_Val_AngleUnits2_Degrees, 500, 0#, "")
        DAQmxErrChk DAQmxCfgSampClkTiming(encoder1TaskHandle, "/Dev1/PFI8", 1, DAQmx_Val_Rising, DAQmx_Val_AcquisitionType_FiniteSamps, samples)
        'DAQmx Start Code
        DAQmxErrChk DAQmxStartTask(encoder0TaskHandle)
        DAQmxErrChk DAQmxStartTask(encoder1TaskHandle)
        ' DAQmx Read Code
        DAQmxErrChk DAQmxReadCounterF64(encoder0TaskHandle, -1, 0.05 * samples, data0(0), samples, ReadCount, ByVal 0&)
        DAQmxErrChk DAQmxReadCounterF64(encoder1TaskHandle, -1, 0.05 * samples, data1(0), samples, ReadCount, ByVal 0&)
        ' All done! StopTask
        'DAQmxErrChk DAQmxStopTask(TaskHandle)
        'Stop task isn't needed because Clear Task also stops task
        DAQmxErrChk DAQmxClearTask(encoder0TaskHandle)
        DAQmxErrChk DAQmxClearTask(encoder1TaskHandle)
        DAQmxErrChk DAQmxClearTask(BaseTaskHandle)
        Exit Sub
    ErrorHandler:
    '   MsgBox "Error: " & Err.Number & " " & Err.Description, , "Error"
    '    mlngPWM_ErrorCount(lngChannel) = mlngPWM_ErrorCount(lngChannel) + 1
        'MainForm.PWMErrorCount = "Errors(" & lngChannel & "): " & mlngPWM_ErrorCount(lngChannel)
        Resume Next
    End Sub

  • How do I program a NI 6602 card to send trigger pulses, one at each output port, triggered by an input trigger signal, using only one counter for each output port?

    Hello,
    I have managed to program a NI 6602 card in LabView to send pulses on three different output ports, one pulse on each output port (with individually chosen delays) for each input trigger pulse coming on a separate input port. It is the DAQmx Create Channel (CO-Pulse Generation-Time)-VI that I have used for this, see attached code. However, this VI controls both pulse delay and pulse width, and therefore uses two counters for each output port (although you only specify one counter in the VI input signals), as I understand.
    In my application though, I only need to have the delay chosen, the pulse width can be arbitrarily short, and thus I should only need one counter for each output port. How do I accomplish to program this in LabView?
    Best regards,
    Claes
    Attachments:
    Configure Side Camera Flash 1 Triggering.vi ‏47 KB

    Well you're welcome to do that--it will work just fine as long as you are configuring a start trigger.
    <rant>
    However, personally I really don't like putting multiple counter outputs in the same task.  I have seen so many people assume that the counter outputs would be synchronized due to having them in the same task when this is not the case (you need to configure a start trigger in order to synchronize the counter outputs even if they are in the same task).  This is the only case I can think of where multiple channels in a DAQmx task are not automatically synchronized.
    As an example:
    Running this on my PCIe X Series gives a measured 2 edge separation of 1 ms + {7.78 us - 10.11 us}.  This would likely be much worse on a bus with more latency (e.g. USB).
    The resulting output is close enough to what you might expect that it might go unnoticed, but really these counter outputs are not synchronized and it would be easy to glance at the code and not even think twice about it.  For the small amount of extra work on my end to create a separate task for each counter, it really clears up some ambiguity about what the counters are actually doing.  For me it's worth it.
    So again, for your case there really isn't a problem with having the counters in the same task since you are using an external start trigger anyway.  I have just gotten in the habit of avoiding doing this.
    </rant>
    Best Regards,
    John Passiak

  • How can I generate synchroniz​ed pulse trains with 6602?

    Hi,
    I would like to generate multiple pulse trains with different frequencies with the 6602 TIO card. Currently I am able to generate pulse trains with different frequencies. But is there any way to synchronize all the pulse trains? For example, I'd like to have all pulse trains with their first low-to-high at the same moment.
    Thanks!
    Dan

    Dan,
    Absolutely, the NI-TIO chip on the PCI-6602 supports a start trigger. If you configure all of the counters that are generating a pulse train to use this start trigger, they will be synchronized. The example Generate Pulse Train - Start Trig (NI-TIO).vi demonstrates this process for one counter. In LabVIEW 7, this example can be found in the following location:
    Examples >> Hardware Input and Output >> Traditional DAQ >> Counters >> NI-TIO
    You will need to add code for the other counters, but this example should give you the general idea. Furthermore, this example demonstrates how you can use one of the digital lines to generate the start trigger.
    Good luck with your application.
    Spencer S.

  • How to get a pulse output at the start of a sine wave which is the input?

    i am working on a comparator that generates a pulse for the positive cycle of a sine wave.but i want to get a pulse of shorter duration at the start of a sine wave (using labview) please suggest

    Hello;
    You can synchronize one of the general purpose counters your board have to the analog input operation. By doing that, you can have your analog input starting the counter operation which will generate the desired pulse. Moreover, you can even specify the delay and width of that pulse. For more information on how to synchronize DAQ operations you can refer to an Application Note named "Advanced Synchronization Techniques for Data Acquisition" which can be found at our web site.
    Hope this helps.
    Filipe

  • How can i synchronize analog output and analog input timings to generate and measure voltage at the same time.

    how can i synchronize analog output and analog input timings to generate and measure voltage at the same time.

    Read this Tutorial
    http://zone.ni.com/devzone/cda/tut/p/id/3615#toc3
    And also refer to this link where You have repeated this question.
    PS: Please stick to one thread. That way, its easier to keep track of your query and answers

Maybe you are looking for