Consumer for different frequencies

Hello,
what is the proposed architecture for consumer that muxes multiple producers with different frequencies ?
Example: DEV1 goes 100 Hz, DEV2 goes 50 Hz. You need to mux the data together in order to get 1 list to simplify programming further and boost searching performance and so on. The cluster contains DEV1,DEV2 , when there is no new DEV2 you keep the last value there.
I am deciding between multi-queue and functionalglobal. The queues seem better option to me.
Let me know your opinions. Thank you !

Dear Bublina!
You are correct, queues are generally a safer and more reliable way of transmitting data between loops.
The way I would do it is to have one single queue for all the producers with two items stored in the queue: 1 enumerated type and 1 variant. The ENUM can tell the consumer from which producer loop the data is coming from, and the variant can contain all the data sent. You can store the latest values of DEV1 and DEV2 in a shift register, and overwrite the one that was sent.
Please tell me what you think.
Regards:
Andrew Valko
NI Hungary
Andrew Valko
National Instruments Hungary

Similar Messages

  • Producer Consumer simultaneous operations at different frequencies

    My goal is to do two operations simultaneously.
    The desired end result is:
    1)      Produce an output signal which oscillates at a specified frequency (1 to 10 hz)(using DIO NI-9403). This signal will cause a solenoid to vibrate at different frequencies.
    2)      Monitor voltage on 3 lines in real-time (using analog input NI-9201). This will monitor system response to vibration.
    3)      Produce an output signal which oscillates at a different frequency from (1) – producing 1-second HI values 5 seconds apart. This will cause the system to “pulse”; system response will be monitored.
    4)      Have a front-panel user interface where: the signals in (2) can be monitored; frequency of (1) can be monitored and changed; and the output on (3) can be monitored and changed.
    My efforts so far have been to build a producer-consumer structure. This is my first time using this structure so I may be completely misunderstanding its use. Feel free to correct me if I’m way off target.
    The issue I have is the solenoid in the consumer loop (which handles item (1)) is not operating at the desired frequency. It is too slow. I used a 10ms timer for this loop, but instead it is operating about 1 cycle per second.
    There may be a much better way to approach this, or maybe my program only needs some minor tweaks. Either way, thanks in advance for your help.
    Attachments:
    ProdComsLoop Pulser 2-27-14.vi ‏65 KB

    Hi BradleyDDC,
    It seems from your program that you don't need a producer consumer loop. The only thing you are feeding from one loop to another can be put in one loop, I mean the simulator on button.
    The timer does not determine how fast the loop runs in real time. To get more precise timings, we recommend hardware timed operations as opposed to the software timed ones.
    Instead of using a digital output signal, you can use a counter output task, here is a knowledgebase, which has an example of what you may want.
    Paolo F.
    National Instruments
    Applications Engineer

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

    I'm using the MHDDK for analog out/in with the PXIe 6341 DAQ card.
    The examples, e.g. aoex5, show a single Timer  (outTimerHelper::loadUI method), but the example shows DMA data loaded with the same vector size.
    There is a comment in the outTimerHelper:rogramUpdateCount call which implies that different buffer sizes per channel can be used.
       (the comment is: Switching between different buffer sizes will not be used)
    Does anyone know what the format of the DMA buffer should be for data for multiple channels with different frequencies ?
    For example, say we want a0 with a 1Khz Sine wave and a1 with a 1.5Khz sine wave.  What does the DMA buffer look like ?
    With the same frequency for each channel, the data is interleaved, e.g.  (ao0#0, ao1#0; ao0#1, ao1#1, ...), but when the frequencies for each channel is different, what does the buffer look like ?

    Hello Kenstern,
    The data is always interleaved because each card only has a single timing engine for each subsystem.
    For AO you must specify the number of samples that AO will output. You also specify the number of channels. Because there is only one timing engine for AO, each AO will channel will get updated at the same time tick of the update clock. The data will be arranged interleaved exactly as the example shows because each AO channel needs data to output at each tick of the update clock. The data itself can change based on the frequency you want to output.
    kenstern wrote:
    For example, say we want a0 with a 1Khz Sine wave and a1 with a 1.5Khz sine wave.  What does the DMA buffer look like ?
    With the same frequency for each channel, the data is interleaved, e.g.  (ao0#0, ao1#0; ao0#1, ao1#1, ...), but when the frequencies for each channel is different, what does the buffer look like ?
    In your example, you need to come up with an update rate that works for both waveforms (1 KHz and 1.5 KHz sine waves). To get a good representation of a sine wave, you need to update more than 10x as fast as your fastest frequency...I would recommend 100x if possible.
    Update Frequency: 150 KHz
    Channels: 2
    Then you create buffers that include full cycles of each waveform you want to output based on the update frequency. These buffers must also be the same size.
    Buffer 1: Contains data for the 1 KHz sine wave, 300 points, 2 sine wave cycles
    Buffer 2: Contains data for the 1.5 KHz sine wave, 300 points, 3 sine wave cycles
    You then interleave them as before. When the data is run through the ADC, they are outputting different sine waves even though the AO channels are updating at the same rate.

  • 2 analog output channels with different frequencies

    Hi,
    hope that somebody can help me:
    I created two physical tasks, analog output channels.
    I should give signals (triangle signals) to a scanner. The problem ist that I need these triangle signals with two different frequencies.
    I can create the signal with each of the task, but not together. Can I solve this problem somehow?
    Ah, and of course the 2 tasks should start together...
    Thanks for your help!!
    Telly

    You didn't mention the type of device you're using, so I'll assume it's a standard MIO. A typical MIO only has one AO timing engine, so you'll have to create one task for both channels and use a single update rate for the task. You will have to make the output frequencies different by passing different data for both channels.
    For example, let's say your update rate is 1KHz. The data for channel 0 is 1000 data points of a single cycle of a triangle wave. The data for channel 1 is 1000 data point of two cycles of a triangle wave. When you run the task, you will get a 1Hz triangle wave on channel 0 and a 2Hz triangle wave on channel 1.
    Good luck,
    Joe

  • AI/AO at different frequency

    Hi,
    As a newbie, I met a problem when I tried to input and output analog signal at different frequency.
    I followed PID-control-Multichannel.vi to build a control program, so input/output can be synchronized. However, the project requires that the AI frequency to be ten times of the AO. I could rewrite the while loop to make the output value constant for 9 of 10 cycles. However, I believe there is more straight forward way to do it.
    Could anybody provide an example?
    Thank you in advance.
    Sincerely yours
    Ming 
    Solved!
    Go to Solution.

    lmuri wrote:
    Hi,
    As a newbie, I met a problem when I tried to input and output analog signal at different frequency.
    I followed PID-control-Multichannel.vi to build a control program, so input/output can be synchronized. However, the project requires that the AI frequency to be ten times of the AO. I could rewrite the while loop to make the output value constant for 9 of 10 cycles. However, I believe there is more straight forward way to do it.
    Could anybody provide an example?
    Thank you in advance.
    Sincerely yours
    Ming 
    Hello Ming!
    Thank you for using the NI Forums. You'll be glad to know that DAQmx allows I/O tasks such as these to be ran not only concurrently but also at different rates.
    The problem with the solution you've devised is that this implementation will remove the delegation of the tasks down to the hardware level and your program would become software driven; this becomes problematic when running data acquisition tasks at very high speeds as you become limited to the output speed of your Operating System (OS).
    You can co-ordinate your tasks to operate synchronously and perform output and acquisition at different rates by creating a task master. This generally means that you configure a task through DAQmx that maintains a clock frequency and you create tasks which use this clock frequency, or a division of it, to operate at their own individual frequency. This will ease not only the implementation of synchronous DAQmx tasks but also provide an entirely hardware driven solution to maximimse performance.
    Through LabVIEW, if you go to Help > Find Examples to open the NI Example Finder. If you browse through Hardware Input and Output > DAQmx > Synchronization > Multi-Function > Multi-Function-Synch Dig Read Write With Counter.vi, you will find an example of how to configure a Counter as a task master to control the operation of both a Read and Write operation. (This example shows a digital implementation but may be easily replaced with analogue.)
    By setting the counter rate to the maximum frequency that you will require for your task (In this case, the speed at which you want to output values) and applying it to the output task SampleClock, you will drive the output task clock with the Counter as the clock source. You can then use the Counter as the source for the SampleClock for the input task, however set the rate to whatever division of the driving frequency you want. In the case of your example, you can set the input rate to 0.1 times the Counter Frequency to acquire at a 10th of the rate.
    If you wanted to acquire at the same rate but only retrieve values at the 10th of the speed, this same solution could be configured to instead produce a trigger to return a buffered acquisition. With a master clocking task, the opportunities are endless!
    I hope that you find this helpful, and if you need any more clarifcation don't hesitate to let me know. Have fun with your DAQ!
    Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

  • Cost of Spotify Premium for different countries in relation to USD.

    Cost of Spotify Premium for different countries converted to USD.
    Australian dollar $11.99  = $12.5
    Euro 9.99€  = $12.5
    Swiss franc 12.95 = $13.5
    Swedish kronor 99 =  $15
    British pound 9.99 = $15.8
    Danish krone 99 = $16.64
    Norwegian krone 99 = $17
    Price for Spotify premium in the US: $9.99
    I could come up with several different reasons why this is how it is, however I would like someone who actually works at spotify to state the reasons why the price for spotify premium differs so much between countries. And why it would be cheapest in the USA.
    Thank you.
    Tvspotify1

    Yes, but when you're buying a jacket.. or a DVD (a lot of jurisdictions, it's not illegal to have a region free player, only to circumvent copy protection - copy protection and region locking being distinct concepts that often vendors will attempt to intertwine but are distinct as aims).. or a CD, you can import it from that cheaper market - in some cases still cheaper with shipping than if you bought it locally even factoring in local consumption taxes. Sure, it might have some different promotional tracks, or different "extra features", or different language options in the subtitles... but the core content's generally going to be the same.
    Case in point. I have an Android phone. I needed an MHL adaptor. I checked local retailer ... $40AUD
    I checked a retailer online.. $30AUD - shipped..
    It took a week to arrive, but arrive it did.
    With digitally distributed, geo-IP locked content - you lose that ability to shop across markets. To me, it sends the wrong signals to charge one group of people one price, and another group of people another price for the mostly the same content when it's available on the same global network. In essence, you're punishing people who you're trying to ween off the "internet is free" mentality into the world of subscriptions and micropayments.
    Don't get me wrong, I don't hate spotify in and of itself - I've been using it a lot at work of late and a lot of friends, both in Australia and internationally have given it a go. It's totally awesome to be able to hear something on the radio or in a movie or on TV.. tag it with Shazam or Google Music Search.. and then to key it into Spotify and hear it play on demand. It's also totally awesome that there's a linux client available - which although in alpha - works.. stably.. (one reason you'll never find me buying an Apple product is the whole 'thalt shall use iTunes' mantra)... and ok, maybe I'm not your average consumer (running Linux on the desktop, stock Android on my phone with root access, bearded and a system administrator - living stereotype much?).. but I'm interested in doing the right thing, and I know content has to move to pay with advertising revenues falling and content, well, more generally intellectual property, increasingly becoming a new and renewable commodity in a world where consumption of physical resources needs to be curtailed.
    I know the local record companies probably play into the mix.. and that by taking a segmented market approach as opposed to a global market approach, there's probably a certain "flagfall" cost in smaller markets that means a higher cost as the smaller markets won't be able to match the economies of scale that would enable larger markets to charge a lower price per user but still make more by having more room to play with the margins. I guess it just grinds my gears that the price for the same 1s and 0s is higher.
    I guess we'll see what happens if/when spotify considers mobile provider partnerships (especially in countries like Australia where unlimited data often has many asterisks/T&Cs, doesn't exist or costs a lot), and if the AUD should fall against the USD (we're holding above parity for awhile now)... if the price will rise then or hold?
    I'll probably succumb when my advertising supported listening is cut back to 2.5 hours a week if I'm still working in a business that allows employees to stream :) .. I guess it's just being so familiar with what the currency's doing and initially being very interested in mobile streaming - and having heard things on US sites talking about the price - to find out, "no, you actually pay more".. well.. it kinda dulled the shine a bit.
    I hope you find my post (although perhaps a bit long winded) polite. I believe such conversations are always best dealt with in an even tone.. and again FWIW, I do thoroughly enjoy and congratulate you on providing a working linux client... and in an apt repository at that!

  • Finite pulse train with different frequency

    Hello,
    I'm trying to modify the labview example "generate finite pulse train" to generate a finite pluse train with different frequencies. Each freq will run 400 pulses. The freqs are stored in an array, which is being fed into a for loop. Thus ramp up the freq each iteration. However the program only generate 400 pluse at first given freq. I'm fairly new to daqmx and not sure what is wrong. Anyone have some idea how to fix it?  
    Attachments:
    pulse train finite mod.vi ‏38 KB

    The best "fix" will depend a bit on the needs of your app.
    Is it ok to have a fraction of a second without any pulses each time you change frequencies?  If so, then there's a pretty simple solution:
    1. Outside the loop you'd create a DAQmx virtual channel and configure for Finite Sampling (# samples = 400) using DAQmx Timing.vi.  
    2. Inside the loop you'd chain together a DAQmx Channel property node where you set the pulse frequency property, then perform a DAQmx Start, a DAQmx "Wait for Task Complete", and a DAQmx Stop.
    3. So for each freq in your array, you'll program the counter for that frequency, start the generation of pulsetrains, and then stop the task after 400 pulses have been generated.
    If you must change frequency on-the-fly, producing *exactly* 400 pulses at each freq setpoint will be tricky, and maybe even impossible to do reliably.  Some techniques will get you closer than others though, so post back if you need to do this.
    -Kevin P.

  • PIR should not consume for the SubReq

    Hi Guru's,
    Please help me how to configure the planning strategy for my below requirement.
    Currently i am procuring a HALB material thru subcontracting. This HALB is having BOM components. I need to send the BOM components to the vendor for assembly.
    The BOM components will be used in some other HALB also. My requirement is, the BOM components should not consume for the subcontracting requirements, it needs to consume for in house production only.
    The subcon requirement needs to generate the dependent requirements only, it should consume the PIR.
    Currently i am using the planning strategy 70, requirement type VSFB. In this, PIR is consuming for the SubReq.
    Please suggest me the suitable planning strategy for this scenario.
    Thanks & Regards,
    V. Suresh

    Suresh,
    I am curious why you would not want SubReq. It is also a different kind of dependent requirement. Also it seems yo are supplying the components to your vendor. So it makes sense that your forecast is consumed by dependent requirements so that planning is effective.
    If for any reason you do not want to supply components to vendor then it would be best to mark such components as vendor provided. In such cases it would not consume your forecast (PIR). Hope this gives some new perspective.
    Thanks,
    Ram

  • Reservation of Stock for different business processes

    Hi
    We have a scenario  like two types of sales processes are there
    1. Direct Sales
    2. E-sales
    From Plant-A  both sales will happen, but while creating sales order for   direct sales 70% of the plant capacity  and E-sales 30% of the plant capacity.
    plant capacity we are mapping with planned orders
    how can we acheve this.
    reagrds
    rajendra

    I doubt that Reservation of Stock is possible for different business processes. Based on Sales Orders, the stock will be consumed.
    Regards,
    Rajesh Banka

  • Simultaneous AO generation at different frequencies

    Is it possible to run two sine waves simultaneously from the same board, at different frequencies?
    example:
    Dev0/ao0...sine wave with amplitude = 10, freq = 1
    Dev0/ao1...sine wave with amplitude = 1, freq 100
    thanks for any replies.
    dave

    why not just set up 2 sine waveforms at the different parameters and send it to the AO write:
    Creat Channel->Timing (use waveform)->AO Write (using array of waveforms)->Start
    LV 7 example attached (uses DAQmx).
    2006 Ultimate LabVIEW G-eek.
    Attachments:
    simusine.vi ‏71 KB

  • Extending material master for different sales org/plant combination

    hi ,
    1 ) a material can be sold from one plant by many sales organisations. so we map this scenario in enterprise structure by the config step "assign sales org--dist channel--
    plant ". (let's say sales org A and B  selling from plant 1 and also sales org A selling from plant 2)
    when we have defined the above config step, then why we need to have material master extended for different combination of sales org and plant as in stpe 1 ?. we can just create one material master with one plant and sales org combination and based on config as in step one, we can sell material from any sales org from a plant  ?
    2) we can extend  material master for any combination of sales org/plant .....is it also possible to extend material master to different storage locations !
    regds
    pamela
    Edited by: Pamela79 on Feb 15, 2011 11:02 AM

    There are several reasons why you should extend the materails to different sales organizations and plants.
    a. The materials are normally valuated at the plant level. So, you can have different valuations at different plants.
    b. You can have different quantity stored in different plants. How do you know which plant has what quantity.
    c. You can have materail not to be sold from one plant, but you can have the same materail sold from the other, how do you block it? at the plant and materail combination, you can do it.
    d. For different sales organizations, you may want the cost and the price to be posted to different GL accounts. You can control it at sales org level of the materail.
    e. You may just want the material to be purchased but not sold, then you may not even create a sales org view for the material. But say, in future you will like to only purchase a materail from a plant and consume it for some other purpose but not sales (which u did previously), then you can block it at sales org and dbr level.
    So, these are a few reasons. But there could be many. You can have a look at the fields in the material master at sales org level and plant level and you can find it for yourself howmany parameters are there to control...
    Hope this helps...
    Regards,
    Mukund S

  • Does anyone know how much energy is consumed for charging a iphone?

    Hi, does anyone know how much energy is consumed for charging a iphone???
    4W? how much does it cost??
    Is there anyway I can test and check how much electricity I have been used for charging a iphone?
    Thanks a lot!

    Thank you very much for all your replies.
    I am wondering if there is any application for iphone which can alarm or help me to know how much energy I have been consuming while charging, or using different applications. or even, if there is possibility of designing one with that function?
    I am currently working on a project which is about the energy consumption of iphone applications. I have been working on my iphone (a 2 years old iphone 3G) and tried to find out the top 100 applications which consume the most electricity. Any suggestions or ideas?
    If anyone is interested in this, you are all welcome to participate and send suggestions!

  • Are iPads built with different configurations for different countries?

    Are iPads built with different configurations for different countries?

    deebeeque wrote:
    I live in the U.S. but am moving to Brazil. I would like to purchase an iPad here in the U.S. but want to have it set up for Brazil, ie: language, operation, WiFi. Can all of this be done by selecting the country specific configuration at the setup stage?
    You can certainly chose the language when you set it up. WiFi is an international standard, no difference between US and Brazil. You can further go into Settings - General - International and select language, as well as keyboards and region format.
    Also, Is it possible to order the iPad (to be shipped to me in the U.S.) with packaging material (ie: operation manual, etc.) in the Brazilian Portuguese language?
    There is no operation manual included - English, Portuguese, or any other language. You can find the one you need at http://support.apple.com/pt_BR/manuals/.
    Additionally, does Brazil have 4G?
    I'm not sure, but as of now the only countries where the iPad 4G will work are the US and Canada - other countries that have 4G use different frequencies.

  • Using multiple apple id's for different purposes

    We are a family of 4 with numerous devices. Here's the setup we've been using to manage different aspects of our apple life!
    Each of us has an individual apple id, which we use on our individual devices for storage/backup, photo stream, facetime, calendar etc
    We have one apple id, used on all devices for all app store/itunes purchases
    We entered this id on each device with everything turned off except "find my iphone". This way we could be logged into the find my iphone app with one id and be able to see all our devices.
    This has worked really well for us as a family. Well, yesterday my kids updated their phones (one 5 and one 4s) to ios 7. I have not done it yet. It does not seem to allow for the above setup, specifically where "find my iphone" is concerned. When I enter in that specific apple id as an additional icloud account, it doesn't offer the option of find my iphone. My ios 6 device says "only your main account can use photo stream, documents & data, and backup". Their device adds "find my iphone" to this list.
    Does anyone know if this is a specific change apple made, or something that went wrong when initially setting up their updated phones.
    TIA!

    Thanks for your reply. But what I don't understand is, can I no longer have multiple icloud accounts, to be used for different purposes? Like I said, we have been using one apple id/icloud for storage etc and one for find my iphone.

  • [SOLVED] how to use diffrent iptables rules for different ppp account?

    x86 plantform run arch linux system , have two network interface etn1 eth0 .eth1 connect to internet. eth0 connect to other terminals through switch. want use different iptables rules for different pppoe account .also want to know how to forbidden more than one terminals established pppoe link use same account at the same time .
    Last edited by linuxsir (2013-09-26 06:48:01)

    (You establish PPPoE sessions over the local network to the Arch machine? Which then routes the traffic?)
    first question ,yes that is exactly what i am done. second question i also have a small  scripts on windows pc to solve routes traffic problem
    route -p delete 0.0.0.0
    route -p add 192.168.9.0 mask 255.255.255.0 192.168.9.1
    route -p add 0.0.0.0 mask 0.0.0.0 192.168.22.0
    but after a while i found scripts is not necessary because windows always attempt to use PPPoE sessions as default internet connection local connection is also ok
    and use  -i pppX in my iptables rules dose not  solve my problem , because same account start PPPoE session could be marked as ppp0 or ppp1. it is hard to identified which account start session.

Maybe you are looking for

  • HT2534 My Apple ID is not working.....plz help

    My Apple ID is not working I made it yesterday using my PC .......plz help.......

  • Xml file to table script

    Hi all, I would be thanks you and greatful if someone can help me to create a table script. I have an XML file with PK and FK relationship. I also have a DTD file. I want to create tables in Oracle Database from XML or DTD file. Thanks in Advance Saa

  • How can I get my embeded video to play on the IPAD?

    Hi, I added a video to my PDF by clicking interactive objects > Video.  I then needed to convert the video using Adobe media encoder which I did successfully to a .f4v file and now it will not play on my Iphone/Ipad.  What sort of player to I need to

  • Highlight the selected Tree Node

    Hello Everyone, Can someone plz tell me how to highlight the selected tree node ? After selection, user should be able to see which node was last selected. Thanks

  • Converting from low-res to high-res

    I have read that there are ways to convert low res files to higher res upon export with Lightroom (perhaps via interpolation).  Can anyone tell me how to accomplish this?   Thanks!