Triggering event for different loop

Hi all

I'm working on an application that uses the architecture of producer/consumer.

In the loop of producer I collect the data of my H/W, and in the loop of consumer, I did it.

the loop of producer has structure of the event which can also be triggered using buttons on the front panel.

Now, he has a record button on the front panel that will begin to record incoming data in the file. and the Structure of the event by taking care of recording loop of producer.

Now how can I raise the event Record in the loop of the producer of the loop of consumer?

Thank you

Ritesh

Or, you can just write the Value property (signage) for the button (assuming that it is the event that you treat a user pressing the button).

Tags: NI Software

Similar Questions

  • event handler programmatically for different loop than the event itself

    Hello

    I'm driving a car of mine using compactDAQ in labview. I have two parallel looping using queues. One is for the tips - READ LOOP playback engine - (running more often), and the other for writing to the engine in bits - LOOP to WRITE.

    When I shoot a little some (by CAR), the motor starts to move with a pre-defined pace and to a predefined position. So far so good. Thus, when the engine starts, it replaces two bits:

    -sets bit BUSY (indicating the movement)

    -Disable INP bit, which indicates that the motor is not in a position

    As soon as the engine reaches its final destination the BUSY bit is cleared and the bit of the INP is set.

    The question is: How can I sign up for the BUSY bit (INP or both) goes high (or low) in LOOP WRITE, given that the bit is read LOOP read? Is it possible to do using queues? I read something about the events, but I don't know exactly how incorporating them in line-ups. Is this OK same design for the engine management?

    I have attached some of my code, where I have a structure of the event, where a condition is the change of the busy flag that is updated in LOOP READ. However the structure of the event will never run.

    I would like my RTO case run once and then expects busy go upstairs, and then again for INP to go UP and after that the next case is running (stop or other).

    I know that my code is not perfect, but I'm pretty new to labview...

    Thanks for any information that can help

    User events are just another way to communicate between the 2 loops.  Queues are also used to communicate between two loops.  If you already have a queue from one loop at the other, you could just keep using that.  I have recommended the user events due to the structure of the event you have included in your loop of producer.  User events can be triggered at any time you want.  You can have the code in your block diagram that uses the Event.vi user generate causes the structure of the event with the other loop turns off.  Event structures are usually turns off when a Panel before its value control has changed, but they can also be configured for these user events.

    You can really make this communication between your two loops in different ways.  If you use a LabVIEW 2012 I strongly recommended to take a look at the producer/consumer model, which is available for you to look at this common architecture and compare it to what you have now.  If you have not 2012 try to look at the example in my last post on the producer/consumer with user events.  You will find more success using architectures such as these.

  • triggering event for the time of day

    I'm trying to put in place a system that requires taking several samples per day at the fire time (at irregular intervals) and then repeat it every day for a week or two. So far, I have tried to use a TimeStamp control array, but I'm not getting much. Does anyone has any ideas on how to do it, or can point me to an example that I missed in my research.

    Thank you

    So what I would do, is create a loop of events with a single event - a timeout. Conduct of this event would be a picture of the time when an action should be performed. The loop starts, remove the first item and subtract the current time of the time goal. This will give you the time in seconds before the event. Multiply by 1000 to get the number of milliseconds before the time runs out. Feeding this value for the time-out. Then each timeout event fires of time, of the index to the next item and calculate a new delay.

    Mike...

  • Event inside the loop 'for' confusion

    Hi all

    I have an event inside a N = 2 for the loop, which generates an array of 2 elements (auto-index mode). The first value is a first event, the second of the second round. The events are the mouse clicks on a front panel with many buttons control.

    Am I able to access the i counter inside the front loop of 2 elements output table? He does not appear.

    Maybe I want just 2 events in the order I should put two copies of this event in a sequence of 2 image... but it creates the need to set up the event twice... a concern, because it contains many possible sources.

    Ive tried everything in loops, by the way I like a local variable, tunnels, shift... registers but I don't seem to be able to access I have during the loop.

    Can anyone suggest a method or a better structure/approach for this issue.

    In any case, it seems that the program is blocked waiting for the second round, so I can't do anything with the value anyway?

    I want to take action after the first test and before that I'm waiting for the second event.

    Thank you

    Carloman

    OK, you're much too complicated things dong.

    • Use a unique event for all low Boolean mice, then use the ctrlref of output event to detect only one. For Boolean values, you can use an array of Boolean instead of all these individual buttons.
    • Don't do the "table of cluster... unbundle" songs and dances. It's just ridiculous! 'array Index' is sufficient.
    • You need an event for the stop button.
    • The structure of your outdoor sequence has no purpose.
    • The coloring is registered with VI, no need to recolor with each race.
    • Do not reproduce any of this code. Your internal matter differs only in a constant of the diagram, it's everything that belongs inside the case. The "subset of table to replace" belongs to the outside.
    • Now, simply do the processing in a new event and ignore if the State isn't fair. Modify if needed.
  • event for broadcasting images of TCP/IP

    Hi all

    My request has currently 2 devices using TCP/IP on stream of framework to 100ms and 50ms data refresh to a PC. I would like to change the polling for data to generate an event when the data arrives, but I'm not sure how to proceed. I have currently 2 devices streaming via TCP/IP to a routine of labview with 2 loops and they seem to work as expected but I must question currently. The situation is not ideal and will not improve once I have 5 or 6 devices TCP/IP all managers of production at different rates.

    I previously used visa for data series and fell on the function of the event for the series that has greatly improved my behavior of codes once I got rid of my quick polling loop.

    I searched for a solution, but so far I can only find the VISA > advanced > range of event management that seems to support most of the types of communications except TCP/IP (I hope I'm wrong). I also vaguely remember a conversation where the queues or the declarant could be configured to provide the equivalent of an event for the recovery of the data.

    I guess that theres a certain many other means to produce something that looks like an event.

    Advice appreciated.

    Concerning

    Chris

    I don't know of anyway to raise an event when the TCP data arrives, but I don't know why you need to do. No need to question the TCP connection, just to set a long (or even infinite) time and wait for the data to come to you. Keep a copy of the refnum of connection TCP somewhere else, so if you need to kill TCP playback, you can do so by closing the TCP connection (which can cause the TCP Read return an error).

    If you want to generate an event of this, you could feed the chain you read TCP read in a user event.

    If you need to handle an unknown number of connections and you want not to loop through all, mark, each of them, you can instead create a reentrant VI and launch a new instance of it for each TCP connection. That said, I've never had a problem with the run-up to the election on several connections, and I have used this template a bit.

  • How can I order a calendar with information for different countries

    In the past, I was able to create a calendar and then order different versions of information for different countries. I can't find this option now. It has been deleted? If this is not the case, how can I do?

    Hey oldcelt,.

    I understand that you want to add information to another country. Let's see what options are available for your calendar.

    You can view the holidays from a specific country. To do this, open the calendar in the calendar settings button settings button of the toolbar and you will see a section for "national holidays of the show. Make your selection and you will be ready to go. For more details, take a look at the information below.

    Change the date of a calendar information
    http://help.Apple.com/photos/Mac/1.1/#/phtb94d9019

    Change the date of a calendar information

    You can easily change the settings of date and your calendar at any time. You can also have your calendar displays events in your calendar application, the national holidays of many countries and anniversaries that you saved in Contacts.

    1. Click project on the toolbar, and then double-click the calendar.

    2. Click the calendar settings on the toolbar.

    3. Do one of the following:

      • Choose a fresh start, month, or year: Use the pop-up menus at the top of the settings pane.

      • Change the number of months in the calendar: Pick a number on the shortcut menu.

      • Display the national holidays of the country: Click the menu drop-down "show national holidays ' and choose the desired country. To stop the display of national holidays, choose None.

      • Display the calendar events: Check the box next to each calendar that you want to display.

        Note: The calendars that you see listed here are the ones you have set up in the calendar application on your Mac.

      • Show the birthdays you have saved in contacts: Select "show Contacts birthdays."

    Take it easy

  • Two time of different loop and each FPGA implementation

    Hi, experts LV!

    I wondered that two different loops in the FPGA are possible to implement with the speed of each loop.

    Ex) SCTL and While loop in a same FPGA VI

    SCTL = 1 vs tick while loop graduations 43 (execution of the loop)

    Also, is it possible to transfer the T/F of SCTL signal any loop in a same FPGA VI via a local variable, even if they run different as loop above speeds?

    Yes you can.  Rather than ask, you might have just tried.  It would have been much faster for you.

  • Why loops run after that assignment of processors for timed loops?

    I have 256 call loops of two frames in my code. When I execute the code without affecting processors only 128 call loop runs at the same time, however when I attribute a different processor to each of them (0-255) then only 4 runs at the same time. Why is this? How can I make all run simultaneously?

    Attached: two snapshots of the code. 1 shows a small portion of the call loops, and the other is the part of code that communicates with an FPGA VI which controls the status of the outputs (using a CRio-9066.) For call loops, the small Sun icon is a Subvi, which generates values for the time delay dt call loops.

    doug333 wrote:

    They run on the computer VI and I don't know how many processors available I!

    Windows?  If this is the case, don't bother with call loops.  They add overhead and you're very unlikely to get something from him.  Even basic affinity rarely helps.  Normal just use While loop with a ms funtion in here waiting.

  • Structure of the event inside while loop

    I'm still fairly new to Labview and this may seem a simple question.  I'm doing a Subvi to display, edit, and create configuration files.  I use a ListBox to list all sections of a config file and structure of the event to update the values in each section, when they are clicked.  The problem is that the structure of the event seems to be a break the while loop so that the buttons do not work until the event has executed.  What I would like is the while loop to run continuously and the event to run only when I click in the listbox control.  I hope this makes sense.  There is a peak in the diagram below. Thank you

    There are a number of issues with your code that could cause problems:

    1. You must use the FP. Open method to open the front panel of a VI and of the public Service. Close method to close. I don't remember exactly the problem, but starting with the 7 worm nor indicated that these methods were the preferred way to perform these tasks.
    2. Based on what seems to be the code, the event for the control of Presets of wood should be a change the value - not a mouse down event. After changing the type of event, use the event data NewVal to drive the indexer table index entry.
    3. The buttons Ok and cancel them should be handled in their own events to change the value. The value change event Cancel would exit the loop, while passing the output error (which indicates that cancel was pressed) and default values for the other 4 outputs. The change of the value Ok event would leave the loop by passing the values that the operator had concluded the 4 controls on the front panel.
    4. An event of timeout with a very short time (1 msec) would stop loop if an error has occurred, or the output of the gate AND is set to true.
    5. The wait function is not necessary, as is the case outside the loop structure.

    Mike...

  • your user profile was not loaded correctly! you have been logged on with a temporary profile. Changes to this profile will be lost when you log out. Please, check your log of events for more information or contact your administrator

    Desperately need help.  I'm supposed to use my computer to type a HUGE Affidavit today and its buggered! Oh no.! Get started with my kids have been playing on my computer and install different games.  So I thought that I do the big thing non-technical MOM and start cleaning up the programs!  Well I accidently deleted NIVIDA and probably something else (I think) and totally messed up my computer!  I have re-uploaded NIVIDA and now my computer "looks like" back to normal, but it throws this error message

    "your user profile was not loaded correctly! you have been logged on with a temporary profile. Changes to this profile will be lost when you log out. Please, check your log of events for more information or contact your administrator"

    and now I can't save anything or find my pictures that I'm desperate for! Can someone please give me a helping hand.  Not technically minded, to take me on as a challenge!  Thanks bunch :) Sarah

    Desperately need help.  I'm supposed to use my computer to type a HUGE Affidavit today and its buggered! Oh no.! Get started with my kids have been playing on my computer and install different games.  So I thought that I do the big thing non-technical MOM and start cleaning up the programs!  Well I accidently deleted NIVIDA and probably something else (I think) and totally messed up my computer!  I have re-uploaded NIVIDA and now my computer "looks like" back to normal, but it throws this error message

    "your user profile was not loaded correctly! you have been logged on with a temporary profile. Changes to this profile will be lost when you log out. Please, check your log of events for more information or contact your administrator"

    and now I can't save anything or find my pictures that I'm desperate for! Can someone please give me a helping hand.  Not technically minded, to take me on as a challenge!  Thanks bunch :) Sarah

    Here is the tutorial to solve this problem. It is very involving. Please read the step by step.
    http://www.Vistax64.com/tutorials/135858-user-profile-error-logged-temporary-profile.html

    t-4-2

  • Adding key event to different parts of a pie chart

    Hi, I'm working on a Blackberry app I need to create pie chart from an array of integers. Unfortunately I could not find any graphics APIs for Blackberry (is there really one?), so I've implemented using the method (graphics.fillArc).

    Here's my PieChart class:

    public class PieChart extends Field
    {
        //declaring private variables to store data
        private int[] percentage;
        private int[] angles;
        private int totalRecords;
    
        //declaring colors to be used in pie chart
        private final static int[] availableColors = { 0x00CDCD, 0xFF0000, 0xFF00FF, 0xCC9900, 0x9900FF, 0x990000, 0x66FF00, 0x6600FF, 0x3300FF, 0x0000FF};
        private final static int totalAvailableColors = 10;
    
        //assuming 250 for chart width and height
        private int chartWidth = 250;
        private int chartHeight = 250;
    
        public PieChart (int[] marks)
        {
            //calculating percentages and angles covered by each record
            totalRecords = marks.length;
            int sum = 0;
            for (int i = 0; i < totalRecords; i ++)
                sum += marks[i];
            percentage = new int[totalRecords];
            angles = new int[totalRecords];
            for (int i = 0; i < totalRecords; i ++)
            {
                double percent = marks[i] * 100 / sum;
                percentage[i] = (int) percent;
                angles[i] = (int) (percent * 3.6);
            }
        }
    
        protected void layout(int width, int height)
        {
            //setting the field to cover the whole width of display
            setExtent (Display.getWidth(), chartHeight);
        }
    
        protected void paint(Graphics graphics)
        {
            //generating a random color from predefined colors
            Random random = new Random();
            int lastAngle = 0;
            int previousColorIndex = -1;
            int startColorIndex = random.nextInt(totalAvailableColors);
            int currentColorIndex = startColorIndex;
    
            //adding offset to create the chart at center of the screen
            int offset = (Display.getWidth() - chartWidth)/ 2;
    
            for (int i = 0; i < totalRecords; i ++)
            {
                //if last record, cover the remaining area of the circle
                int finishAngle = i == totalRecords - 1 ? 360 - lastAngle : angles[i];
    
                //drawing the arc
                graphics.setColor(availableColors[currentColorIndex]);
                graphics.fillArc(offset, 0, chartWidth, chartHeight, lastAngle, finishAngle);
    
                //calculating text position to print the percentage
                int txtX = (int) (125 + 75 * Math.cos(Math.PI * (lastAngle + angles[i] / 2)/180));
                int txtY = (int) (125 - 75 * Math.sin(Math.PI * (lastAngle + angles[i] / 2)/180));
                txtX -= graphics.getFont().getAdvance(String.valueOf(percentage[i] + "%")) / 2;
    
                //drawing the percentage over the respective section
                graphics.setColor(Color.WHITE);
                graphics.drawText(String.valueOf(percentage[i] + "%"), txtX + offset, txtY);
                previousColorIndex = currentColorIndex;
    
                //tracking total angle used so far
                lastAngle += angles[i];
    
                //checking if color generated is previous color or starting color, if it is the last of the record
                do
                {
                    currentColorIndex = random.nextInt(totalAvailableColors);
                }
                while ((i == totalRecords - 1 && currentColorIndex == startColorIndex) || currentColorIndex == previousColorIndex);
            }
    
        }
    
    }
    

    Now, when the user touches a any part of the generated pie chart, I need to show him the details of this particular section, which is different for different parts of the chart (for example. Say that if brands of students is used, during the click on an article I have need to display information about the marker). From my understanding, different parts of the pie chart must be different fields to contain the touch individual events. However, it seems there is no way to create irregular fields, and I can't reach camembert if I use fields rectangular for different parts of the chart (such as it's going to tear the pie! ).

    Any suggestions?

    BTW I develop for BB OS 6.0 (Blackberry Torch).

    The word dreaded no programmer doesn't want to hear: math. You'll just have to figure out where all of your divisions are based off of their percentages, determine where the touch and then discover what segment is in.

    In fact, I don't think it's going to be too bad, just refresh you on geometry.

  • Can I reuse fields to event for various events?

    Hello

    Can I reuse fields to event for various events?

    Thank you

    Hello

    Yes, you can reuse these Email fields in different events as long as they are the same field names. Data are populated based on the field for the event.

    Thank you

    edynamic expert Eloqua

  • syntax for a loop

    Hey people,

    I've heard for loops is the best way to accomplish what I need. With my level of coding, I try to have that when all checkbox States are true, then a specific image.  the question is when I was using earphones of events within each of the mouse click events, this would trigger the click on the ninth all the conditions would be met. The syntax for a loop seems daunting, is it possible to run my function, so it is always "listening" or will run eimmeidatley if the conditions are met?

    OFbandSEVENclose.addEventListener (MouseEvent.CLICK, OnFRYERbandSEVENclose);

    function OnFRYERbandSEVENclose (e: MouseEvent): void

    {

    gotoAndPlay (1);

    }

    OFbandSEVENcheckONE.visible = false;

    OFbandSEVENcheckTWO.visible = false;

    OFbandSEVENcheckTHREE.visible = false;

    OFbandSEVENcheckFOUR.visible = false;

    OFbandSEVENcheckFIVE.visible = false;

    OFbandSEVENcheckSIX.visible = false;

    OFbandSEVENcheckSEVEN.visible = false;

    OFbandSEVENcheckEIGHT.visible = false;

    OFbandSEVENcheckBUTTON1.addEventListener (MouseEvent.CLICK, checkbuttonONE, false, 0, true);

    function checkbuttonONE(e:Event):void

    {

    If (OFbandSEVENcheckONE.visible == true) {}

    OFbandSEVENcheckONE.visible = false;

    } else {}

    OFbandSEVENcheckONE.visible = true;

    }

    }

    OFbandSEVENcheckBUTTON2.addEventListener (MouseEvent.CLICK, checkbuttonTWO, false, 0, true);

    function checkbuttonTWO(e:Event):void

    {

    If (OFbandSEVENcheckTWO.visible == true) {}

    OFbandSEVENcheckTWO.visible = false;

    } else {}

    OFbandSEVENcheckTWO.visible = true;

    }

    }

    OFbandSEVENcheckBUTTON3.addEventListener (MouseEvent.CLICK, checkbuttonTHREE, false, 0, true);

    function checkbuttonTHREE(e:Event):void

    {

    If (OFbandSEVENcheckTHREE.visible == true) {}

    OFbandSEVENcheckTHREE.visible = false;

    } else {}

    OFbandSEVENcheckTHREE.visible = true;

    }

    }

    OFbandSEVENcheckBUTTON4.addEventListener (MouseEvent.CLICK, checkbuttonFOUR, false, 0, true);

    function checkbuttonFOUR(e:Event):void

    {

    If (OFbandSEVENcheckFOUR.visible == true) {}

    OFbandSEVENcheckFOUR.visible = false;

    } else {}

    OFbandSEVENcheckFOUR.visible = true;

    }

    }

    OFbandSEVENcheckBUTTON5.addEventListener (MouseEvent.CLICK, checkbuttonFIVE, false, 0, true);

    function checkbuttonFIVE(e:Event):void

    {

    If (OFbandSEVENcheckFIVE.visible == true) {}

    OFbandSEVENcheckFIVE.visible = false;

    } else {}

    OFbandSEVENcheckFIVE.visible = true;

    }

    }

    OFbandSEVENcheckBUTTON6.addEventListener (MouseEvent.CLICK, checkbuttonSIX, false, 0, true);

    function checkbuttonSIX(e:Event):void

    {

    If (OFbandSEVENcheckSIX.visible == true) {}

    OFbandSEVENcheckSIX.visible = false;

    } else {}

    OFbandSEVENcheckSIX.visible = true;

    }

    }

    OFbandSEVENcheckBUTTON7.addEventListener (MouseEvent.CLICK, checkbuttonSEVEN, false, 0, true);

    function checkbuttonSEVEN(e:Event):void

    {

    If (OFbandSEVENcheckSEVEN.visible == true) {}

    OFbandSEVENcheckSEVEN.visible = false;

    } else {}

    OFbandSEVENcheckSEVEN.visible = true;

    }

    }

    OFbandSEVENcheckBUTTON8.addEventListener (MouseEvent.CLICK, checkbuttonEIGHT, false, 0, true);

    function checkbuttonEIGHT(e:Event):void

    {

    If (OFbandSEVENcheckEIGHT.visible == true) {}

    OFbandSEVENcheckEIGHT.visible = false;

    } else {}

    OFbandSEVENcheckEIGHT.visible = true;

    }

    }

    THE FINAL SCREEN =.

    function OFbandSEVENCOMPLETE(e:Event):void

    {

    If (OFbandSEVENcheckONE.visible == true & & OFbandSEVENcheckTWO.visible == true & & OFbandSEVENcheckTHREE.visible == true & & OFbandSEVENcheckFOUR.visible == true & & OFbandSEVENcheckFIVE.visible == true & & OFbandSEVENcheckSIX.visible == true & & OFbandSEVENcheckSEVEN.visible == true & & OFbandSEVENcheckEIGHT.visible == true) {}

    gotoAndPlay (12);

    }

    }

    Stop();

    I see the problem:

    check .visble [n-1] =! check .visible [n-1];

    must be visible not folded down

  • is their an order for a loop. something like sym.loop("") or this. Sound.Loop(""). I especially need this

    is their an order for a loop. something like sym.loop("") or this. Sound.Loop(""). I especially need for two work to complete an audio file.

    Thank you.

    Hey, sabermaster -.

    Not at the moment, but you can create your own effects loop using triggers on the timeline.  What specific features do you want?

    -Elaine

  • for crazy loop

    Ive got this loop for, but for some strange reason, it fails:

    -by the outbreak, runs an infinite time.

    -It only fires when segmenten1 or segmenten3 are 0, which is weird, because it should also work when segmenten0 and 2 and 4 correspond to 0...

    Here is the equivalent for:

    stage.addEventListener (Event.ENTER_FRAME, addmetaal);
    function addmetaal (evt:Event) {}
    for (var animteller = 0; animteller < 5; animteller ++) {}
    If (this ["segments" + animteller] == 0) {}
    trace ("Segments" + animteller)
    for (var teller6 = 0; teller6 < 4; teller6 ++) {}
    var enzym_mc:EnzymAnim1 = new EnzymAnim1();
    var metaal_mc:MetaalAnim1 = new MetaalAnim1();
    Vijanden.push (enzym_mc);
    Vijanden.push (metaal_mc);
    metaal_mc.rotation is enzym_mc.rotation = Math.Random () * 360;.
    metaal_mc.x = enzym_mc.x = XCO [animteller];
    metaal_mc.y = enzym_mc.y = yco [animteller];
    addChildAt (enzym_mc, numChildren-90);
    addChildAt (metaal_mc, numChildren-90);
    }
    }
    }
    }

    do you know why it works poorly?

    It seems to me like this when all variables segments hits 0, it should trigger the 2nd loop for and repeat 4 times.

    the xco yco arrays that store values for the x and are coordinated to spwaning the addchilds, it works fine.

    the segments variables are declared as follows:

    var segmenten1:Number = 17, segmenten2:Number = 17, segmenten3:Number = 17, segmenten4:Number = 17, segmenten0:Number = 17;

    Please help me out here

    loops for are in a loop enterframe, the outer loop must run repeatedly.

Maybe you are looking for

  • measurement of voltage longer distant

    Hello Forum, I have a very important question. I want to measure the voltage difference between two locations on a surface which are location 100 meters. So I'm going to use long cables. The sensors are reference electrodes. What connection mode will

  • Create an exe to LAUNCH AN INSPECTION in VBAI

    Good day again NI Experts. I would like to ask for a solution to a small problem of mine in VBAI. By default, after you have saved a project VBAI, a file EXE will create for this project. When we re - open the EXE file, we will be directed straight t

  • My power button is normal?

    I just upgraded to the Razr Maxx from old droid device and power button on my old unit was pretty solid. However, the power button on my Maxx has a few odd wiggle abilities. (It oscillates up and down). I'm just afraid that he could jump off when I g

  • I can't find a game of msn that I bought and downloaded. I played and cannot go home now. __

    I bought the game bejeweled 2 download on my msn games site. I went all through the procedure. It all started to the top of my game. I played it for 2 hours. in the middle of play it stop working. the screen went black. When the screen came back, he

  • While I was on facebook I was thrown ut and now I get certificate error

    original title: certificate errorsWhile I was on facebook, I've been thrown ut and now I get certificate error. Is this harmful to my computer and how do I fix this