best way to handle this situation of producer-consumer

It is, I know a common thing, however, I never really thought about before. I can't post my VI so a description will have to do. It goes without saying, but again, it's producer-consumer architecture. Let's say you have a generator of signals and all the controls that are in a cluster. A value is changed, an event in the loop producer and you compare the old and new values to determine which button has changed the lights. Cool, all good. While I have the tail a State front reading in my loop prodcuer who is corresponding in my loop of consumer. The State of reading front load all the new values in a cluster that is then introduced into a shift register be accessible from anywhere in my code (see here).

Now my question is, what would my next state that I have the tail? If I have a single "send commands to the gen GIS", in my loop of consumer I have again to determine the value that has changed in order to know what order to be sent (because the initial determination of what has changed in the loop of the producer). However, if I have an individual for each order state that I want to send, my business structure will get very large, very fast.

Last option is to have a send order status and just write all the data on the only value of a control change, whether it is new or not (which seems an exaggeration).

Suggestions please?

For situations of this kind, I would not send a 'State' to the consumer.  I send a '' command. ''   When the consumer receives a command, it determines if this command is executed immediately, or if he completes the task of process and then manages the new command.

With the command I send one or the parameters.  For your signal generator parameters would probably be something like a bunch of 'control ID' and 'value '.  Control ID would probably be a typedefed enum and value a DBL.

What ever you decide, think, plan and document before code you.

Lynn

Tags: NI Software

Similar Questions

  • What is the best way to read this binary file?

    I wrote a program that acquires data from a card DAQmx and he writes on a binary file (attached file and photo). The data I'm acquisition comes 2.5ms, 8-channel / s for at least 5 seconds. What is the best way to read this binary file, knowing that:

    -I'll need it also on the graphic (after acquisition)

    -J' I need also to see these values and use them later in Matlab.

    I tried the 'chain of array to worksheet', but LabView goes out of memory (even if I don't use all 8 channels, but only 1).

    LabView 8.6

    I think that access to data is just as fast, what happens to a TDMS file which is an index generated in the TDMS file that says 'the byte positions xxxx data written yyyy' which is the only overload for TDMS files as far as I know.

    We never had issues with data storage. Data acquisition, analysis and storage with > 500 kech. / s, the questions you get are normally most of the time a result of bad programming styles.

    Tone

  • I'm moving my files to workspaces to cloud.adobe.  What is the best way to achieve this?

    I'm moving my files to workspaces to cloud.adobe.  What is the best way to achieve this?

    Hi Traci,

    So big that you get ready for the transition to cloud.acrobat.com! Please see that the specified item was not found. For more detailed information on downloading your files.

    When you open a session workspaces, however, you will see a big red box at the bottom left. Click this box, and your files will be packed to the top for you. You will receive an email with the instructions when the packaged files are ready for you.

    Best,

    Sara

  • I have an After Effects project and I want to re-do edge animate. What is the best way work for this?

    I have an After Effects project and I want to re-do edge animate. What is the best way work for this?

    Hello

    Sorry, but you will probably need to rebuild everything in Animate. Although their timelines are similar in some ways, there is no interoperability between After Effects and animate dashboard.

    Kind regards

    Joe

  • Best way to film this scene, stitch together plates or green screen?

    I have a call where I walk past a player with him framed on the right of the screen, ' actor A. ' then on the shoulder 'Actor A' (on the left side of the screen) another character is in sight, "actor B." at the end of shooting the camera move to stop and I want at the speed of the actor 'A' of the ramp so that it revolves around very quickly While the 'B' actor maintains a normal speed (which is him walking toward the camera as well). Is the best way to do this shoot with two plates separate and assemble them (if if, what is the best way to assemble the shots)? Or is - this green screen actor 'A' or 'B' and add them in? Remember, the camera moves to the rear while the actor 'A' heading, when moving player 'B' is also in the shot. Ramp speed of the actor 'A' occurs once it stops (it will whisk around extremely fast), how the camera will also be stopped.

    You have a few options. Usually, I start a VFX shot by the thought of the movement of the camera. If I move the camera what are the problems that will result?

    According to your description, you have a dolly with two actors. Tracks camera, the first actor as the second player enters the scene, then the unit stops and the second actor continues to his notes at normal speed while the first actor is accelerating. Two shooting plates will give control the moment where the first actor, but, in view of the camera move, requires you to simulate accurately the moment where two follow-up plans so the point of view between actors is consistent. It doesn't matter if the photos are on a green background. For the view between the two actors to match the camera moves must be identical to the camera angle and the speed of follow up.

    If, however, you shoot all the action in a single pass while you can use rotoscoping to separate into two pieces shooting where the camera stops moving and then adjust the time where the first actor. This works easily if you make sure that you don't move the camera at all once the track ends.

    If the players do not overlap so the second option is a piece of cake because your roto can be a very simple rough mask. If the players overlap in the framework then your roto work will have to be very precise when the players overlap, and you may need to perform a few background replacement to fill in the holes.

    If you decide to do with two plates, then you will probably need to track movement. stabilisation and re-synchronization of two shots to make them at the height. If the camera is moving when you accelerate the first actor, you will have to keep track of movement.

    A final option is to pull the first actor on a green screen and the second player as a bottom plate and then follow and stabilize the two shots to try to combine them. Here again, if the speed and angle of the two plans that you combine are not identical or at least nearby enough that you can easily fix them you'll be in a lot of tweaking to than the shots work.

    If it were my project, I shoot the two actors in a single plug and then divided take it there where should be the first actor have the speed change and make a few roto work. That seems to be the most straightforward approach.

  • I'll do a clean install on a blank hard drive upgrade but want to keep my Firefox settings - what is the best way to do this?

    I'll do an upgrade from Windows XP to Windows 7. I will be installing Windows 7 on a new empty hard drive. I want to keep my bookmarks Firefox and Ad Ons. What is the best way to do it. Thank you for your help.

    Hello

    The best thing for you to do is to make a backup of your Firefox profile. It is a folder that stores bookmarks and Add-ons that you can then add to the reinstalled Firefox on your new operating system.

    Learn you more about the Firefox profile folder, how to backup and restore, here.

    I hope this helps, but if not, please come back here and we can look at in another option for you.

  • I replace a website done previously before Page with a new site that I built in Dreamweaver, but wants to keep the URL address, what is the best way to achieve this?

    I replace a site is at the top with a new website that I'm building in Dreamweaver, but want to keep the same URL which is the best way to go about this?

    If you want to keep the same hosting provider, you have nothing to do. Just delete the old files of the site and download your new.

  • What is the best way to detect this text is part of the ContainerControllers without scrolling?

    Hello.

    Question

    What is the best way to detect that the text typed by the user (or added programmatically) exceeds the available space container and find where the truncated part begins? There are others (as described below) highlights the easy way to detect or to prohibit controllers to receive more characters that can be displayed in the area of publication given?

    My attempt partially (Simplified)

    For example, lets say I have a textflow editable with joints two instances of ContainerController.


    var flow:TextFlow = createSomeFlowFromGivenString(sampleText),
        firstController = new ContainerController(firstSprite, 100, 30),
        lastController = new ContainerController(secondSprite, 600, 30);
    
    
    flow.interactionManager = new EditManager(new UndoManager());
    flow.flowComposer.addController(firstController);
    flow.flowComposer.addController(lastController);
    
    flow.flowComposer.updateAllControllers();
    

    Vertical scroll policy enabled I can compare the height of the composition in the last controller with the height of the content:

    var bounds:Rectangle = lastController.getContentBounds(),
        overflow:Boolean =  lastController.compositionHeight < bounds.height;
    
    trace('Content does not fit into given area?', overflow)
    
    

    But when I change of vertical scroll policy off (lastController.verticalScrollPolicy = ScrollPolicy.OFF)-Unfortunately this does not work anymore... (In my case scroll must be disabled, since the text boxes can have only one line with narrow width)

    Use cases

    I want to create the form to fill out. Field can have one or more lines. A field could start in the middle of the page, continue in the following line, where it spreads throughout the page and put an end to the third line - long quarter of the width of the page. Text typed by the user may not exceed given the region since it could cover some static text that is located just after in below field.

    Something like ascii image below:

    --------------------------------------------
    |                <PAGE>                    |
    |                                          |
    |                                          |
    |                                          |
    |               [Field starts here........ |  
    | ........................................ |
    | ........................................ |
    | Ends here..]                             |
    |                                          |
    |                                          |
    | [Another field] xxxx  xxxx xxxxxxxx x xx |
    | xxxxxxxxxxxxxxxxxxx                      |
    |                                          |
    |                              [One more.. |
    | .....]                                   |
    |                                          |
    |                                          |
    |                                          |
    |                                          |
    |                                          |
    |                                          |
    |                                          |
    |                                          |
    --------------------------------------------
    

    Info:

     [......]  <-- form fields starts with '[' character, and ends with ']'
     xxx       <-- sample, static text
     | and _   <-- page borders
    

    If you want to detect the overflow in the final container, there is another thread discussed before.

    http://forums.Adobe.com/thread/795264

    You can detect it with lastContainerController.absoluteStart + lastContainerController.textLength «»<>

  • Best way to achieve this shadow effect?

    Im trying to recreate the shadow effect of the main content area on this site;

    http://www.CSSzengarden.com/?cssfile=196/196.CSS

    Is a filter drop shadow, the best way to do it and that I have to have 2 shadows or is it possible to make one appear on both sides?

    Thank you

    I think you want to just play with the settings of the shadow from the corner. The default angle puts the shadow to the lower right. You can move that kind of shadow is just below. Then play with the distance and the amount of fabric softener. This is a .png of Fireworks with some changed settings:

  • Best way to make this step motor control system

    The goal of my project is to have real-time data collected by a controller of Sir 158u Dataq a stepper motor.  I grappler planned on executing it with the basic stamp, but I realize that's not possible.  I have a stepper motor and a L293DNE driver.  I'll be permanently registration of data with the dataq, the form of volts and want these values to determine how the engine works.  For example, if the voltage is 0-3 volts, I want it running clockwise, 3-5 volts not turns not, and 5-8 Volt turn clockwise.

    I tried to understand this last week, searching through discussions with basic stamp, matlab and labview now.

    Is there an easy way to do this? or easier way that I'm trying to understand?

    Any help would be greatly appreciated!

    Thanks in advance.

    -Nick

    Nick,

    What I was describing, this is how you configure the motor controller to accept PWM of LabVIEW and mode locked anti-phase so you can control the direction of the motor. Much on the part of LabVIEW depends on the acquisition of data you use. For example the acquisition of your data doesn't have a counter which can generate a PWM? I did some checking everything on time and the acquisition of your data is not made by National Instruments and I couldn't locate the native LabVIEW drivers. I did however go to the MFG Dataq 158u site and found that they do not have drivers LabVIEW BUT their software (SW) should run in the background. Dataq 158u website also has a help forum, I suggest you start to understand the capacity of the 158u Dataq. Also it seems that you are not familiar with LabVIEW, until you can take on a project like this, you have to start with the LabVIEW Basics, learn how to manage the tables so you can store your results of EDA and records the use of loops and timing and movement.  NOR has a basic training FREE as the intrudction 6hr to LabVIEW, I would like to start their. Oh, and in your OP (original post) you doubted the Basic Stamp could do that, I do this type of control using the Atmel microcontrollers all the time, I'm sure that the stamp eaisily could do. Download right on one of their forums for more information. Oh and to answer your question a UPS is an IC that reverses the input signal, which you would end upward with the direction of you pines motor controller is PWM on a spindle and 180Deg off phase PWM, on the other hand.

    Alan

  • best way to write this query

    Hello

    I have a problem and I realized a simplified version of it:

     
    
    create table deals (id_prsn number, id_deal number, fragment number); 
    create table deal_values (id_prsn number, id_deal number, value_ number, date_ date); 
    
    insert into deals values(1,1,50); 
    insert into deals values(2,2,40); 
    insert into deals values(1,3,50); 
    insert into deals values(2,4,80); 
    insert into deals values(1,5,20); 
    insert into deals values(2,6,80); 
    
    insert into deal_values values(1,1,10 ,sysdate - 3); 
    insert into deal_values values(2,2,208, sysdate - 3); 
    insert into deal_values values(2,4,984, sysdate - 3); 
    insert into deal_values values(1,null,134,sysdate - 3); 
    insert into deal_values values(1,1,13, sysdate - 2); 
    insert into deal_values values(2,2,118, sysdate - 2); 
    insert into deal_values values(2,4,776, sysdate - 1); 
    insert into deal_values values(1,null,205,sysdate - 1); 
    insert into deal_values values(2,null,-5,sysdate - 1); 
    The id of the requirement to join these two tables based on:

    1.) ID_PRSN and ID_DEAL
    2.) max DATE_ grouped per person and deal
    (3.) in the case that ID_DEAL is defined in the AGREEMENTS, but not defined in the DEAL_VALUES table, I have to join this records to DEAL_VALUES based on the person where id_Deal is null.

    Number 3 gives me headache. I realized the following query:
     
    
    select *from ( 
    select a.id_prsn, 
           a.id_deal, 
           a.fragment, 
           b.value_, 
           b.date_, 
           max(b.date_) over (partition by b.id_prsn, b.id_deal) max_date 
      from deals a 
    inner join deal_values b 
        on a.id_deal = b.id_deal or b.id_deal is null 
       and not exists  (select 1 from deal_values 
                                  where id_prsn = a.id_prsn 
                                    and id_deal = a.id_deal) 
       and a.id_prsn = b.id_prsn 
    ) 
    where date_ = max_Date; 
    It returns the correct result of he,


    ID_PRSN ID_DEAL FRAGMENT VALUE_ DATE_ MAX_DATE
    1 1 50 13 16.10.2012 09:59:48 16.10.2012 09:59:48
    1 3 50 205 17.10.2012 09:59:48 17.10.2012 09:59:48 OK
    1 5 20 205 17.10.2012 09:59:48 17.10.2012 09:59:48 OK
    2 2 40 118 16.10.2012 09:59:48 16.10.2012 09:59:48
    2 4 80 776 17.10.2012 09:59:48 17.10.2012 09:59:48
    2 6 80-5 17.10.2012 09:59:48 17.10.2012 09:59:48 OK



    but the join clause:
     
    
    
        on a.id_deal = b.id_deal or b.id_deal is null 
       and not exists  (select 1 from deal_values 
                                  where id_prsn = a.id_prsn 
                                    and id_deal = a.id_deal) 
       and a.id_prsn = b.id_prsn 
    in fact the query much slower.

    I was wondering is there a different way to write this join and manage the logic.

    Thanks in advance

    Here's a different approach:

    select * from (
      select a.id_prsn, a.id_deal, a.fragment, B.value_, b.date_,
      ROW_NUMBER() over(
        partition by a.ID_PRSN, a.ID_DEAL
        order by B.ID_DEAL nulls last, B.DATE_ desc
      ) RN
      from DEALS a
      join DEAL_VALUES B
      on a.ID_PRSN = B.ID_PRSN and a.ID_DEAL = NVL(B.ID_DEAL, a.ID_DEAL)
    )
    where rn = 1
    order by 1, 2;
    

    "nulls last" is the default sort order; I just put that for clarity.

    Published by: stew Ashton on October 18, 2012 12:58

  • Best way to implement this provision?

    I have this design which is currently in the form of Flash that I would do it again in html. I try to reproduce the same exact design with the following restrictions:

    -I want the design to stay centered horizontally, regardless of the size of the browser window.

    -I don't want no scrollbars on the browser window.

    This design was initially conducted during the years there are html and I have achieved this goal by using nested framesets. Each horizontal section of the design was in a frame. Something that does not look was when making a selection (on the numeric keypad) the image page loading in the white flash image section front of load the image page. I never found a way to avoid this. I certainly don't want that. In other words, each image is selected the background in the image section should stay black.

    Any suggestions for the way better, the easiest way to achieve the final result more transparent? I guess that run html and css standards allow a better way to do this? I intend to use Highslide to zoom in on the image.

    Thank you for any input!

    layout.jpg

    This is called a Flash of unstyled content (FOUC) to edit pages.  What you need is a jQuery (JavaScript) solution that keeps everything on the same page, so there is no FOUC.

    I also recommend jQuery Fancybox2 for window modal/Lightbox effect.  See examples below.

    http://fancyapps.com/FancyBox/

    Nancy O.

  • What is the best way to create this image?

    Hi, I use Illustrator CS5 and I don't know there is a pretty easy way to create this image just steps from copy/recovery... However, I can't understand.

    Any suggestions?

    Thank you!

    wheel.jpg

    If you use a brush, you can make a model reusable and adjustable teeth. For example, you can apply it to any path of the form and can adjust the number of teeth by changing the weight of the race.

    JET

  • What is the best way to get this layout of the chapter?

    I have a document which is now a large flow of pages.

    However, there are "chapters, in this 'book'. A 'chapter' actually starts on the right page. But I want the left page to participate in the design of the spread of the beginning 'chapter '. This means that left before the start page real "chapter" is reserved in control of layout and all "chapter" before that would end on a left page, needs a right-hand page empty inserted, after which the left page of the early-'chapter' spread follows.

    Now, I can do the pages on the left of the start "chapter" start a section and to correct even a page number. That it is positioned on the left side. But when I add pages from the previous section, this means I have to change the page numbers of the beginning of all the sections that follow hand.

    Are there not a better way to do this? Somehow I don't have to worry about the numbering of the pages myself while still getting the page before the "chapter" included in the section of this "chapter"?

    (I write "chapter" because these aren't chpaters Id in an Id book, but a few sections in a single document Id).

    If the previous "chapter ends with a page of pairs (left hand), you add two pages, if it ends on the right add you a..

    Another way to do this automatically is to set an Option to keep on the paragraph style that you use for the first paragraph on the page at beginning of chapter, then it will start the section on the next odd-numbered page.

  • What is the best way to achieve this?

    What is the best to do the following?

    Form1 lists items that have a cost value

    Form2 is a form of invoice

    What is the best way to export goods of a value of cost of form1 to form2?

    A user would be making selections of point in form1 and save the form, and then send it or export data.

    Then form2 would retrieve the selections point of form1 and display cost values that I can sum up at the end of the form2.

    Thanks in advance for any advice!

    Hello

    If both forms have the same objects to the items and the same names, then export to xml of form1 and import of xml in form2 should work.

    Data in the xml file that does not match the names of the objects to form2 will be ignored.

    In both forms, objects that you want to export/import must have their liaison, the normal/name of the object value > Bindings tab.

    Niall

Maybe you are looking for