Notifier release outside of the loop of consumption

Hi all

I use a notifier to a stop button.  My stop button was not stop in one of the cases (1 error to wait on the notice in hand MTTF.vi).  I've highlighted the code and noticed that when I pressed stop, the notifier has been released prior to notifying the consumption loop.  When I published the notifier outside the loop of consumption, my error has disappeared.

Looks like a simple fix which is awesome, but ine everything I've read or seen so far, that the release was out of the loop of producer.  Is there a drawback to doing it this way?

A more common way to deal with this should treat a mistake to wait on notice as a stop condition, because the error indicates that the notifier has been released, and the only way that can happen is that the loop of the producer ended.

The way you described, you could get in a situation where the producer loop stops but the consumer does not and since the Notifier is not released until the consumer left, the loop of the consumer will never stop because he always waits for a notification that will never come (but the declarant is still valid, if it continues to wait).

Tags: NI Software

Similar Questions

  • Too much time in the queue empty in the loop of consumption

    I'm working on a VI used to screen analog converters above temperatures from room temperature to 175 C.  I have it set in place with a producer and a consumer loop.  The loop of producer makes all the measures, while consumer loop allows you to write tests that all measures in a spreadsheet file. There are 23 steps taken and recorded every second.  The test is run for about 60 minutes.

    Initially, I had trouble with data in the queue being lost when I stopped the VI.  I fixed that by ensuring that the queue was completely empty before you stop the VI.  Now my VI will continue to work long after I pressed the stop button.  I let it run for up to an hour and finally abandoned the operation and still lost a large number of measures on the end of the queue.  From my reading on the forums, it's because of the overload to write to a file of measure.  Opening and closing of the file every second is any slowdown.

    I've seen examples of creating a table of measured data and only writing every 100 samples or more.  Can someone help me see how I could implement something like this in my code?  Is there another reason, it takes so long to write all my test data?

    Thank you

    Matt

    You must use the real file i/o functions.  That made the express VI to write files to measure opens the file, writing the data and then close it.  When you do this several times, you get a really slow performance.  If you must open the file before you consumer loop and close it after the loop.  You will then be able to write as much as you want inside the loop.  But now, you need to format the data yourself.

  • hide the buttons outside of the loop for

    Hello

    I'm trying to hide listbuttons on mode full-screen. But only the last cache.

    How to hide the total buttons on mode full-screen.

    function playlistLoaded(e:Event):void {
    
              xmlPlaylist = new XML(urlLoader.data);
              //trace(xmlPlaylist.vid[0].@src);
    
        for (var i:int=0;i<xmlPlaylist.vid.length();i++) {
                                  var listbutton:Button = new Button();
                                  listbutton.x = 482;
                                  listbutton.y = i * 19 + 1;
                                  listbutton.width = 197;
                                  listbutton.height = 20;
                                  listbutton.label = xmlPlaylist.vid[i].attribute("desc");
                                  listbutton.name = xmlPlaylist.vid[i].@src+"__"+i;
                                  listbutton.addEventListener(MouseEvent.CLICK, playVidlist);
                                  addChild(listbutton);
              }
    }
    
    //==================FullScreen SetUp ========================
    //===========================================================
    
    controlBar.fullscreen_btn.addEventListener(MouseEvent.CLICK, fullscreenOnClicked);
    controlBar.normal_btn.addEventListener(MouseEvent.CLICK, fullscreenOffClicked);
    stage.addEventListener(FullScreenEvent.FULL_SCREEN, onFullscreen);
    
    function fullscreenOnClicked(e:MouseEvent):void
    {
         stage.displayState = StageDisplayState.FULL_SCREEN;
    }
    
    function fullscreenOffClicked(e:MouseEvent):void
    {
         stage.displayState = StageDisplayState.NORMAL;
    }
    
    function onFullscreen(e:FullScreenEvent):void
    {
         if (e.fullScreen)
         {
             controlBar.fullscreen_btn.visible = false;
             controlBar.normal_btn.visible = true;
             //listbutton.visible = false;
             removeChild(listbutton);
    
             controlBar.x = (Capabilities.screenResolutionX - 480) / 2;
             controlBar.y = (Capabilities.screenResolutionY - 116);
             vidDisplay.height = (Capabilities.screenResolutionY);
             vidDisplay.width = vidDisplay.height * 4 / 3;
             vidDisplay.x= (Capabilities.screenResolutionX - vidDisplay.width) / 2;
         }
         else
         {
             controlBar.fullscreen_btn.visible = true;
             controlBar.normal_btn.visible = false;
             //listbutton.visible = true;
              addChild(listbutton);
    
             controlBar.x = 0;
             controlBar.y = 244;
             vidDisplay.width = 480;
             vidDisplay.height = 360;
         }
    
    

    One way to do it would be to place all the objects button inside an object (MovieClip or Sprite) container and then make the visible/invisible container with a single line of code.

    Otherwise, just as you have used a loop to create the buttons, you need a loop to hide each of them.  If you store each button in a table that you create, then you can use this array to loop through them all and make them visible/invisible individually.

  • Release outside when the moving object

    Hello

    I have a number of tabs that can be moved around the screen... I have limited movement to a rectangle using startDrag (false, rectangleName) but when I ROLL_OUT or MOUSE_UP outside the rectangle to compel the tab does not, so set itself a new startX and startY times clcked on a second time...

    Can someone help me please! Here is my code, thanks in advance:-

    private void tabOver(event:MouseEvent):void {}
    event.currentTarget.scaleX = 1.05;
    event.currentTarget.scaleY = 1.05;
    }
    private void tabClick(event:MouseEvent):void {}
    event.currentTarget.scaleX = 1.05;
    event.currentTarget.scaleY = 1.05;
    }
    private void tabOut(event:MouseEvent):void {}
    event.currentTarget.scaleX = 1;
    event.currentTarget.scaleY = 1;
    }
    private void tabMouseDown(event:MouseEvent):void {}

    var constrainRec:Rectangle = new Rectangle (-150, 0, 912.15, 692.2);

    event.currentTarget.startDrag (false, constrainRec);
    event.currentTarget.parent.addChild (event.currentTarget);

    event.currentTarget.startX = event.currentTarget.x;
    event.currentTarget.startY = event.currentTarget.y;

    var myGlowFilter = new GlowFilter(0x000000,.5,8,8,3,3,false,false);
    event.currentTarget.filters = [myGlowFilter];

    }

    private void tabMouseUp(event:MouseEvent):void {}

    event.currentTarget.scaleX = 1;
    event.currentTarget.scaleY = 1;
    event.currentTarget.stopDrag ();
    }

    the scene has a mouseleave event, that you can use for this.

  • Cannot read every value of the loop iteration for

    Hiiii...

    I developed a front-end which reads the values of serial port and display on the front panel.

    16 channels, which is a string data value. I've separated this string to read the data of each channel, but at the end of the loop for, I can read data only one channel for an iteration, and also I have to store each value iteration in a text file.

    I'm new to labview. Help, please. I have LabVIEW 8.0.

    Attached is my application code.

    This seems quite inefficient. Why don't you use a business structure? Why don't post it your code.

    In regards to the original code, you try to run by using the run continuously? I ask because I do not see a global loop, so it was not clear whether this was intended to present itself as a simple Subvi or "on-demand". If it's supposed to run continuously until you stop, DO NOT USE CONTINUOUSLY RUN it BUTTON. Use a while loop in your VI. Do not forget to place the initialization and close outside of the loop - you don't need to initialize and close the serial port whenever you loop around.

  • then the loops end early when there is a table of cluster for several xyplot

    Hi all

    I want to order a motor (for the rotation stage), a Keithley 2450 and SR830, changing the level of step by step while measuring the VAC and Vdc continuously with changing Idc. Half size loop partially shown in the picture below is to change the degree by the stepper motor. The structure of sequence and two small inner loops is to measure the Vac-Idc-Vdc.

    What I want to do is to show the plot xy in real time during the measurement and show the multiple xyplots for different degrees (a line unique xy for a degree). So I add the disabled part and the problem comes.

    When I turn off the game and everything works fine. All Vac and Idc values measured with the vice-president Vdc range (such as-10 V ~ 10V). But when I activate the part, the two loops stops at halfway.

    I wire errorout writing on an emloie file the register shift for errorin the out more while loop, which does not work.

    I'm confused totoally. Can someone help me?

    Thank you.

    Zhu

    I see a major problem.  It is a classic example of all of the data being processed in the loop of consumption due to the lines of OR.

    If you have a loop, adding data to a queue.  You have a second loop by deleting the data.  The producer loop completes and destroys the queue.  This causes the loop of consumer to raise an error due to the line being destroyed and stop.  But what happens to all of the data still in the queue when it is destroyed?  Answer: it's GONE.  It will not be processed.

    Since you want that each piece of data, you can send an order any to the loop of consumer to let him know he turned and then allow it to stop.  Only after stop the loop of the consumer the queue must be destroyed.

    So should what command you use?  In this situation, I would send an empty array when the loop of producer ceased.  The consumer checks only data read to see if it is an empty array.  If this is the case, she stops the loop and destroys the queue.

  • The data in a loop of consumption does not evolve

    Help!

    I am reading different voltage to an interval of 500ms in a loop of producer and move to the consumption loop. However, I notice that the values in the loop of the consumer do not change even when the voltage has changed?

    What can I do?

    You're probably stuck in inner loops. Given that the value of the voltage of the capacitor is powered in from out of the loop, this value will be used only inside the selection loop until the loop stops running. Thus, if the first capacitor voltage is lower than the upper threshold voltage, then the inner loop in the load case will never end.

    You don't need the inner loops at all. You want to test against thresholds exactly once for each reading of the voltage. The lead of the comparison to a case structure. If the condition is true, write to the output channel and change the State. Otherwise, do not write and return to the same State on the next reading.

    Another thing. When you stop the program, you can set the output before close so your capacitors do not sit it loads.

    Lynn

  • How to write multiple entries with KHz sampling frequency in a file outside the loop?

    Hello

    I am able several entries of string tension using the wizard DAQ (1 sample on request) and it is placed inside a timed loop of frequency 1 KHz.

    This timed loop is placed inside an another while loop.

    Problem is with writing data to a file, although I can see 100 samples of 100 ms in the graphics cable to the out of the way, but the extent of writing to output file stores either only from 19 to 20 samples per second (when he wrote inside the timed loop) or does not store any (if placed outside the timed inner loop).

    I tried to set up producer consumer structure but in the loop of the consumer, I can't write the data in queue to a file saying data type mismatch. I placed the loop starting queue item and consumer out both loops and the element of queue inside the timed loop exit DAQ fed to the queue item.

    Can you please help me solve this problem file writing?

    I haven't looked so writing code from the top of the head, but access to the files is slow, and if you open and close the file, it is quite slow. What do you usually do it write to the file at a slower pace, for example once per second and write all the 1 k samples at a time. Try and also keep Ref file open during the test.

    /Y

  • While the loop Tunnel help

    I have a variable inside a while loop, that I want to access outside the loop, that is, in my VI, I have two indicators, one inside the loop and the other outside the loop.  The variable is incremented on each iteration.  However, I am not able to see this iteration of the loop.  I see that the last value of the variable.  Is there anyway for me to access the variable inside the loop as it is running.  In regards to my VI, is it possible for my indicator "inside" correspond to the indicator 'outside '?  Any help with this will be appreciated.  Thank you.

    Kind regards

    David

    Yes.  You must use a local variable of the 'Inside' indicator that writes to the indicator 'outside '.

    There are other ways to do so, such as pass the data via a queue or a notifier.

    The concepts of tunnels, flow of data, and that data is not available to that structure, it is finished, is all notions of LabVIEW.

  • A generated within a loop in a subvi output data can be transferred to the main program for each iteration of the loop?

    Hi LV users,.

    I have a very basic question, I have not succeeded to asnwer using basic considerations.

    I made a sub - vi that performs a scan of current-voltage using a unit of measurement-source Keithley and a loop FOR.

    The subvi outputs 2 tables with my data (essentially an array of voltage and the corresponding current table). I also defined a Terminal at the exit of a group of these 2 tables in order to plot a graph XY - output. Specifically, I indexed this cluster to update after each iteration of the loop FOR, in my sub - vi (the indicator is placed outside the loop, of course).

    My problem is that I want my main program to display the XY-graph in real time, with an update after each iteration of the loop FOR which is in my sub - vi.

    I have a problem because my sub - vi output terminals are available for the main program concluded as soon as the sub - vi has completed its own execution (which is what we expect of sub - vi to do).

    How can I use a sub - vi (because it's handy) and get in the main program in the course of its performance data that are generated from the loops of sub - vi?

    Thanks in advance for your help,

    Yoyo87

    Elements of the queue in the Subvi them put your main VI where you want to display the data and the.

    It is similar to the architecture of producer/consumer. There are examples of it in LabVIEW. The examples work with 2 parallel loops, in your case a loop (the producer) will be in the Subvi.

  • Output of MatlabScript in the matter of the loop

    Hello everyone, but long time reader first time poster, and I was wondering if I could get help to a little problem here, or... Well, more like a question and not a problem.

    I don't download the .vi because I don't think it will be necessary, in addition, ignore the rest of the image (I just play with image processing like I taught him) and go to the location of the matlab script.

    My goal is to represent the image (taken from image data) bit and in the end, it must look like to... a table of 8 columns and all the lines she might need (can't see all of the lines of course) so it will look like a matrix.

    For example, it should look a bit like this on the user Panel
    | 1. 0 | 1. 1. 0 | 1. 0 | 1. (first 8 bit value)

    | 1. 0 | 1. 1. 1. 0 | 1. 0 | (8-bit second value)

    etc...

    So for that, I use the matlab de2bi function and the release of this part is where my problem is, im putting out 8 columns representing each number comes from the image and well, im confused as to what is going out of the matlab function and the loop, as you can see in the picture I have uploaded, I put a flag in the output of 'bin '. , was automatically called Real, inside the loop and the other digital, outdoors, also, I disabled the index of the tunnel in this output. (if I activate the index, it comes out as a table)

    I thought that Real and Numeric to be showing the same thing, but when I run it, which doesn't seem to be the case, you Real shows the 1 and 0 (I guess it shows the 8 bits because it shows figures but I saw in the matlab command window and there are 8 bits stored in 'bin') and digital remains just at 0 its almost as if nothing were happening out of the loop, and because I'm not sure what it is falling I can't really find a way to show the bits as in the example, I said before.

    Read the help of de2bi, it is said that his exit is a matrix if the input is a vector, but I don't think it's a vector since due to the loop, it takes value by value, then it must go to the default (in binary) value too...

    Thanks for the help in advance, in addition, whether something else to better understand my problem please say so and I will do my best to make it easier to understand.

    I don't know why you're so obsessed on matlab, LabVIEW can do all this much simpler directly. Here's a possible solution. (LabVIEW 8.5. For other possible outputs you could reverse the Boolean array, so modify them.).

    (Your main mistake under matlab is that your output of matlab is defined as a scalar value, then it should be a vector. Your tunnel to exit of the matlab node has the wrong data type.)

  • Configuration of the loops in LabVIEW to return to the beginning under certain conditions of CRC calculation

    Hey gurus of LabVIEW,.

    Well, I recommend also move your file in writing to be inside the loop, more precisely inside the TRUE (I could bad told you before).  If the CRC was released in 0, do you all the processing, otherwise do nothing.  Then the next iteration.  By moving the file i/o inside the loop, you're avoiding accumulate huge berries (IE a lot of memory).

  • How to get the items on a loop at the same time during the execution of the loop for

    Hello

    I am a student. I would like to know how to get the outside loop counter values For in parallel so that the loop runs rather than obtaining the value finally outside the loop for future prospects for the answers.

    Thank you

    Frederick

    You already said yes, and you have said some of the different ways (registrants, locals, reference, queue, etc.). Since the information was provided to your request, the thread can be considered closed? If you want details about how to implement something, you must provide the details on what you are doing.

  • Why this disable structure encapsulating the loop for that I'm falling?

    In the middle of coding and debugging I noticed something weird... now I'm just curious.

    Here is what happened (audio WARNING may be a bit much, fans of pumping in a warehouse im in...):

    https://www.YouTube.com/watch?v=vC9BKJ0CwmY

    I'm really just curious to know why this is happening - it seems that there is the note of "make sure wire you the error" fault behind the loop that the disable struc overlapped a bit...

    Why the struc disable that first, I dropped in this video did seize all of the loop?

    -pat

    You have this decoration of the label on your block diagram behind your loop For. When you put the new business structure, he captured this label which is outside the loop For. This forces the case structure to take the loop too, since it is the only way to recover the property node and label.

  • PtbyPt filter FIR in the Loop Simulation

    Hello

    Currently, I am trying to simulate the power in my engine when I apply a voltage step for 20 MS for that I intend to use a FIR filter in the control and simulation module that simulates the other parts of the engine.

    However, I have found that the FIR filter seems to be strange behavior. When I change the order of Runge-Kutta 1 simulation to 2 of Runge-Kutta it effects the output of the filter FIR PtbyPt VI. The two attached images show how the results of the convolution of the IR and the tension, the FIR outside the simulation loop filter and FIR filter in a loop using Runge-Kutta 1 are the same. However, the second image shows that the FIR filter in the loop simulation Runge-Kutta 2, has a different answer.

    Why does this happen? As I understand it, the type of simulation should have little effect on the application of a FIR filter based on pt by pt. I have not changed the timestep or other parts of the simulation. I want to use a simulation of order higher than for other parts of Runge-Kutta 1 would be insufficient for the simulation.

    I'm using LabVIEW 2011 SP1.

    Thank you

    Rhys

    When you try to use RK-2 or higher order, the screw that dumped you inside the control and the Simulation loop, by default, they will all run in the "minor" time steps too. In your case, 'two times' which means the VI will be executed each time step.

    To properly configure these screws, you must "right click" on the VI and select "Installation of the Sub - VI node. This will bring to a Setup page that the second half you will choose in 'Type of Simulation Subvi execution' to 'remove' the "Include minor steps" box and press OK. When you do this, the Sub - VI will be annotated on the upper right with blue 'C' and when you run, it should provide a similar result as RK-1.

    Note that in this dialog box, you can also select discreet, which, in many cases, it is the right selection for 'discrete' systems

    I hope this helps...

Maybe you are looking for