Several channels with different frequencies

Hello

I use card NI USB-6221.

The C API using, I need to generate 6 digital output channels, with frequencies of diffrenet and Heavy duty.

To be more precise, the 2 are totally identical, but I need them to be reversed, and the other 4 are similar to another, but should be shifted in time (I.e. There is a delay between each of the channels).

I used the 2 channels of CO that the USB-6221 takes charge for the first two signals, and it works very well (the two signals are synchronized and are reversed).

Now I need an additional 4 channels for the other vague square.

I saw an articale NOR by JohnP web site with the title:

Generate multiple channels of digital output with different frequencies and Heavy Duty

The following example shows how to create and generate a digital with the non-regeneration wave form so that you can change the frequency and the duty cycle on the fly with the M Series DAQ hardware X.  The example uses output digital rather than counters to achieve this, so if you need more output than the available counters, it would be a good option (Note: on the materials of the M series an external sample clock must be provided, this may be caused by one of the counters if you want).

that seems to be exactly what I need, but the examples are for LabView which I did not.

Can someone explain how to do this with the C functions?

Best regards

Danny.

Hey Danny,

The important thing to note is that you can clock of arbitrary digital waveform (up to 1 MHz on the 6221).  The real data acquisition programming is pretty easy once you have the waveform.  My Example LV used LabVIEW Base generating function VIand then converted to a digital waveform to generate the signal from each channel.

The functions of LV helped tremendously with to achieve the waveforms to be updated on the fly (the basic function generator keeps track of phase for you).

If you do not need to be updated on the fly, then the construction of the waveform in C should not be too bad.  For example:

P0.0 [1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0] * 1

P0.1 [0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0] * 2

P0.2 [0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1] * 4

P0.3 [1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1] * 8

[9 9 9 9 9 3 3 3 3 3 6 6 6 6 6 12 12 12 12 12]

The table above U8 would give you 4 output waveform of 50% duty cycle at Fs/20, shifted 90 degrees to eachother.  The lines would be p0.0 by p0.3 (the bit rate of the U8 corresponds to what line goes high).

Best regards

Tags: NI Hardware

Similar Questions

  • How to structure the DMA buffer for SMU 6341 DAQ card for analog output with different frequencies on each channel

    I use the outgoing/incoming analog DDK with the DAQ 6341 SMU map.

    The examples, for example aoex5, show a single timer (method outTimerHelper::loadUI), but the example shows the DMA loaded with same size of vector data.

    There is a comment in the outTimerHelper:call rogramUpdateCount, which implies that memory sizes different pad per channel can be used.

    (the comment is: switching between the sizes of the various buffers is not used)

    Nobody knows what should be the format the DMA buffer for data from multiple channels with different frequencies?

    For example, we want a0 with a sinusoid at 1 kHz and a1 with a sine wave of 1.5 Khz.  What looks like the DMA buffer?

    With the same frequency for each channel, the data are interleaved, for example (ao0 #0, ao1 #0; ao0 ao1 #1, #1,...), but when the frequencies for each channel is different, what the stamp looks like?

    Hello Kenstern,

    Data are always intertwined since each card has only a single timing for each subsystem engine.

    To AO, you must specify the number of samples that will be released to the AO. You also specify the number of channels. Because he didn't is that a single engine timing for AO, each AO will be channel will be updated at the same time to update clock tick. Data will be interlaced exactly as shown in the example because each channel AO needs output at each tick of the clock to update. The data itself can change depending on the frequency you want to copy.

    kenstern wrote:

    For example, we want a0 with a sinusoid at 1 kHz and a1 with a sine wave of 1.5 Khz.  What looks like the DMA buffer?

    With the same frequency for each channel, the data are interleaved, for example (ao0 #0, ao1 #0; ao0 ao1 #1, #1,...), but when the frequencies for each channel is different, what the stamp looks like?

    In your example, you must come with an update rate that works for the two waveforms (sine waves of 1 and 1.5 KHz). To get a good representation of a sine wave, you need to update more than 10 x faster than your fastest frequency... I would recommend x 100 if possible.

    Update frequency: 150 KHz

    Channels: 2

    Then create you stamps that include complete cycles of each wave you want to produce based on the frequency of update. These buffers must also be of the same size.

    Buffer 1: Contains data for the sine wave of 1 KHz, 300 points 2 cycles of sine wave

    Buffer 2: Contains data for the sine wave of 1.5 KHz, 300 points, 3 cycles of sine wave

    You can Interleave them as before. When the data are performed through the ADC, they are out different sine waves, even if the AO channels are updated at the same speed.

  • DAQmx create track (I-current-Basic) 8 channels with different values of Shunt resistance

    Hello

    I want to measure 8 current channels with different values of Shunt resistance.

    Problem: The channel create DAQmx (HAVE current Basic) specifies that a value of Shunt resistance.

    How can I set the value of Shunt resistance for each channel individually?

    Concerning

    Marcel

    Hi Marcel_C,

    Take a look to get attached.

    Best regards

    Mencef

  • Synchronization of several high at different frequencies of sampling DAQ cards.

    I'm having sync problems 3 high DAQ cards with different sampling frequencies. I use 2 cards PXI-6259 nec 10,000s samples and 1 PXI-6221 Board to interface for my SCXI modules in 10 samples/second. The problem that I discovered is the time related with the waveforms of the NI PXI-6221. When I run the code on a development computer using virtual devices in MAX, it works as expected. When I run the same code on real hardware, the stopwatch turns approximately 25 X faster than normal. I enclose the code and the config that I use.

    Any ideas?

    Hi NGNN CAD.

    First of all, let me say that your code is very nice!

    The problem is that you are using the fast sample for the device that is supposed to be slow clock:

    Even if you specify the rate as 10 Hz, the clock itself is still at 10 kHz (by specifying the right rate allows the DAQmx driver determine the size of buffer etc and don't actually change your external sample clock speed - however, it changes the rate of the simulated device).

    My recommendation to synchronize devices would use the built-in PLL and lock to the reference clock 10 MHz of your PXI chassis.  Your devices would always share a trigger to start, but each would generate its own sample clock based on its time base that is locked to 10 MHz reference.

    The code should look like this:

    I hope this helps, let me know if you have any questions!

    Best regards

  • Generating analog output signals 4 with different frequencies

    Hi all

    I was trying to say to generate 4 different signals at different frequencies

    1. first waveform is a sine wave with 5000 Hz,

    2. other with 8000Hz,

    3. third, one is a square with 25 Hz waveform and

    4. fourth one with triangular waveform 50 Hz

    all waveforms must be generated simultanoeusly.

    I tried to generate with the task unique analog output and sample clock (clock rate is 100000). Cross in scope that I see only 5000 and 8000 Hz we generated correctly and the rest two waveforms show the incorrect frequency.

    I guess that's due to the frequency of high clock to sample for more low frequencies for ex 25 Hz and 50 Hz. If I reduce the clock rate to get the lower frequencies properly so I can't generate frequencies higher correctly. (there's a clsh between frequencies and the clock frequency)

    Is it possible to use DAQ board master sample clock and its magnitude downward revision (everywhere where it is necessary for each waveform separately) to generate all the signals at different frequencies at the same time in a single task?


  • I want to clone my hard drive and this clone allows you to configure a new computer, how do I do this for several PCs with different versions of XP?

    I am trying to replace 15 PCs.  They all have XP because their BONES, bought with different SPs at different times.  They all have been updated to SP3...  They have all MS 2003, upgaded to MS 2007.  I would use a clone as image.  I do not support different key codes?  Although the XP are authentic, I may not all key codes.  My predessor has not keep good records, and stickers on some had labels of Vista.  Even if the PC was bought with XP downgrade.  I need to use XP because of some other software requirements.

    What is the best way to represent all the PC so that I can get back them to my users?

    Hello

    I suggest you to refer to this link and check if it helps:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_xp-windows_install/cloning-Windows-XP-Pro-to-new-hard-drives-ready-to/b7edf501-6ae6-4bc1-94BB-39a4177d8b71

    It will be useful.

  • Updated several lines with different values

    Hello!
    I have a problem. I need to update more than 1000 lines with different values. How can I do?
    For exsample I have table:
    ID; color, date,
    1 red
    2 green
    3 white

    I need to update the date field.

    Update table
    Set date = '01.02.03'
    where id = 1

    Update table
    Set date = '01.03.03'
    where id = 2


    Maybe it's how to update multiple rows in a single request?

    Sorry for my bad English.
    Thank you!

    Hello

    You can try this

    UPDATE TABLE SET DATE = CASE
                        WHEN ID = 1 THEN TO_DATE('01-02-03','DD-MM-RR')
                        WHEN ID = 2 THEN TO_DATE('01-03-03','DD-MM-RR')
                        END
    

    see you soon

    VT

  • several circle (with different diameters) on graph xy

    Hi, I'm looking for a solution to the problem posted above. I did searches and returns results using "Draw Circle by radius.vi" but I like it to be shown on an XY graph that has many circles with a different RADIUS (a bit like a fly).

    I also found an alternative with the loop for which a "PI" multiply with the iteration of loop divided by 50 and the values are passed through Sine and cosine with it functions delivered to be broadcast on graph XY. But I have no idea how to do to control the RADIUS to make it smaller or larger.

    Help please

    The outputs of the sine and cosine will give you a circle of RADIUS 1.  If you want a different RADIUS, then you must multiply the output of your desired RADIUS.

  • Several channels with the launch of unique digital dashboard

    I have a simple vi where the two analog channels is read in and stored simultaneously in a file of lvm and plotted on a graph of a waveform. I need a numerical advantage to post trigger data for both channels.

    I can get this vi to work with one analog channel and the onset of digital edge very well.

    When I remove the digital edge trigger, I can get the vi to work with two analog channels. The two signals of ground on a waveform graph and record nicely in the file of lvm.

    The question is how do I set up the digital triggering (see table).  The program never enters the while loop. Where I'm going wrong?

    Chassis: cDAQ-9172

    Analog card: NI 9205 (Source PFI0 the shutter button)

    LabView: 8.6

    OS: Windows XP


  • Generate 2 Trains of pulses with different frequencies and Heavy duty with a PCI-MIO-16XE-10

    Hello

    I use a Board PEAK-MIO-16XE-10 DAQmx with LabView 8.6 to run a door for a piece of equipment controller. I need to create 2 separate, all pulse trains both trigger simultaneously, each with their own cycle frequency and duty. So far, I can create 1 pulse train and it works exactly as I need, however, whenever I try to enable the second train (called a door in this VI), I get an error saying: "the specified resourse is resevered," even though the first door is configured to use counter 1 and the second must be set to use counter 0. As I understand it, this map contains 2 separate counter/timer modules, so this should be possible. A large part of the rest seen in the attached VI's preparation for the signal processing and other controls that I use that I finished this VI.

    Thank you

    <><>

    Hi Eric - you forgot to attach your VI.  I did what you're trying to do with a similar card, but who has been using NOR-traditional DAQ (before DAQmx).  It should be possible with DAQmx as well.  A quick search on the forums turns up these two links, which suggests that your problem is that you try to create two tasks separate DAQmx, one for each counter.  What you need to do is create a single task DAQmx which includes the two counters, then together, that their frequency and duty cycle regardless.

    http://forums.NI.com/NI/board/message?board.ID=170&message.ID=241602

    Causes of error NEITHER-DAQmx-50103

  • Export to JPG format several times with different resolution

    Hello world

    I want to export my document of jpg files in different resolutions - an overview and a thumbnail image. I use this code, I found here in the forum for export:


    function exportPages (_dpi, _destFilename) {}

    try {}

    app.jpegExportPreferences.exportResolution = _dpi;

    app.jpegExportPreferences.jpegQuality = JPEGOptionsQuality.LOW;

    app.jpegExportPreferences.jpegExportRange = ExportRangeOrAllPages.EXPORT_ALL;

    app.scriptPreferences.version = "7.0".

    app.jpegExportPreferences.jpegColorSpace = JpegColorSpaceEnum.RGB;

    app.scriptPreferences.version = "6.0".

    app.activeDocument.sections.everyItem () .includeSectionPrefix = false;

    var f = file (_destFilename);

    app.activeDocument.exportFile (ExportFormat.jpg, f);

    } catch (err) {}

    Alert (err.message);

    }

    }


    and I call you


    exportPages (96, "~ / jdExport.jpg");

    exportPages (30, "~ / jdExportThumbnail.jpg");


    This should create images with 96 DPI and dpi 30. But after the first call the app.jpegExportPreferences.exportResolution is not defined. I can swap function calls - first works, second fails.


    No idea why I can't export twice?


    Thank you

    Klaus


    He finds myself - there the

    app.scriptPreferences.version = "6.0".

    I shouldn't use copy & paste the code from the forum without understanding

  • Make the same comp several times with different text

    Hello!

    I'm looking for a way to make my 100 + times with a different text in two layers. I thought batch replicate this model and then batch change text layers, but I've been Googling autour and found no solutions.

    I need is ready solution, just a direction on an approach I take to perform this task. Told me on another forum to ask here and there are a few scripts that are just what I need assistance excellent file as data. You could point me to them?

    Thank you!

    This is an old thread from Creative Cow that deals with a way to do what you want using a file text and Expressions:

    CreativeCOW

    There are also some commercial script tools that automate the process very well:

    CompsFromSpreadsheet 5 - aescripts + aeplugins - aescripts.com

    Templater - aescripts + aeplugins - Rig aescripts.com

  • I have several screens with different resolutions, how can I make work stations match from the bottom rather than the top?

    I have 2 screens at 1920 x 1200 pixels and one in the middle with 2560 x 1600.  When I move the cursor from one screen to the other, the cursor jumps (of course), but in this case, the vertices of the monitors are (it moves from the top of a monitor to the top of the other) and I would like the background to match (to the top of the Middle monitor space with no corresponding areas on the other two).

    As the two side monitors are physically smaller and shorter that the Middle it's jarring to see the cursor jumps 3 inches upward when I switch from one to the other.

    Is it possible to adjust the display settings so that they justify bottom instead of the top?

    To be clear: I want to be able to move my cursor along the bottom one down the next and having the high bit to space rather than being able to move the cursor along the top with the bottom being the extra space.

    Thank you
    Trish

    In the window display settings, where it shows the monitors, click and drag them to the bottom of all monitors line up horizontally. Boulder computer Maven
    Most Microsoft Valuable Professional

  • question of xsd. several records with different values.

    I need help in the creation of xsd.

    My data from the file will be as Fallows.

    Sample data file

    AB xxxx yyyy zzz ttttt

    BBB hhh ddd ddd

    BBB hhh ddd ddd

    BBB hhh ddd ddd

    BC xxxx yyyy zzz ttttt

    CCC hhh ddd ddd

    CCC hhh ddd ddd

    CCC hhh ddd ddd

    CD xxxx yyyy zzz ttttt

    Hhh ddd ddd DDD

    Hhh ddd ddd DDD

    Hhh ddd ddd DDD

    My xsd is as Fallows:


    < xsd: element name = "Root Element" >

    < xsd: complexType >

    < xsd: SEQUENCE >

    < xsd: element name = "Element" type = "tns: mainelement" minOccurs = "0" maxOccurs = "unbounded" / >

    < / xsd: SEQUENCE >

    < / xsd: complexType >

    < / xsd: element >

    < xsd: complexType name = "mainelement" >

    < xsd: SEQUENCE >

    < xsd: element name = "Header" type = "tns:HeaderType" maxOccurs = "1" / >

    < xsd: element name = "lineitem1" type = "tns:lineitemrecord1" minOccurs = "0" maxOccurs = "unbounded" nxsd:lookAhead = "0" nxsd:lookFor = "" / >

    < / xsd: SEQUENCE >

    < / xsd: complexType >

    < xsd: complexType name = "HeaderTyep" >

    < xsd: SEQUENCE >

    < xsd: element name = "HeaderData" type = "xsd: String" nxsd:style = "fixedLength.

    nxsd:length = "2528" / >

    < / xsd: SEQUENCE >

    < / xsd: complexType >

    < xsd: complexType name = "lineitemrecord1" >

    < xsd: SEQUENCE >

    < xsd: element name = "RecordData" type = "xsd: String" nxsd:style = "fixedLength" nxsd:length = "161" / >

    < / xsd: SEQUENCE >

    < / xsd: complexType >

    How can differentiate the values in the starting header field by [AB, BC, CD] and record data fields starting with [bbb, ccc, ddd]

    I can't use nxsd: lookahead and nxd:lookFor.

    Required inputs to process the file. What alteration is suitable for the xsd to run.

    Is there a parent - child relationship kind of thing in your file structure?

    Row containing sales, purchases etc. is the parent and the tracking records are the child records, until we meet any record type 'Bill of sales, purchases',? In addition, tried to use "conditionValue" and "startsWith" and it did not work... Is it?

  • VCenter: User in several groups with different permissions, smaller approvals

    Hello

    We finally hit the use of our VCenter setup where we need to begin to use permissions group instead of the individual user's permissions.  I have set up several groups (QA, automation, App, VCenter users and administrators) for our users.  However - I ran into a problem where a user must be in QA Automation and administrators, and I put the appropriate permissions on a pool of resources (QA - unalterable, automation and administrators full control).

    When you connect as long as user is as VCenter uses by default the * least * permissions for the object being verified and the user has only read-only for the resource pool (and spread points).  Is this expected authorizations and vcenter behavior?  I guess the user must get the permissions for all the groups, they are in.

    Thank you

    Ben

    If you set permissions in vCenter level, then Yes, you need to uncheck spread it to child objects.  What you can do then is add permissions on each individual resource pool.

    Is the ultimate goal only allow these members to have access to resource pools, any VI?

Maybe you are looking for