Locking for a case Structure function

Hello

Need help on a solution. I have a limit of input switch on a digital line that is used to modify a case structure. The case structure True and False is for forward and back for an engine. For the moment, when the limit is triggered/high the engine starts running but once he spent the race returns to setbacks. How is it possible to keep/latch the case structure who spend only a true value of the limit will change the structure of the case.

Kind regards

It seems that you have attached to your original code because there is no feedback node in this VI?

Anyway, shown below is how to achieve what I have described using a selection instead of the structure of the case function. Note, I think you can also use an Exclusive or instead (as shown in the below screenshot, but I haven't tested that)

Tags: NI Software

Similar Questions

  • multiple control for switch case structure

    I have four process past... my first process is supposed to work for 12 hours and next three deal for 1 hour each. Since I have many variable to display I use tab control. Now my question is how use two controls for the case selector one based on the tab control where the user can see the second and individual process parameters based on time where the process should be automated according to the time it's when 12 elapsed hours that the second process continues to the next process 1 HR even 3rd and 4th. can someone help me please

    I enclose my vi

    This?

  • Constants of output for the case of Structures

    Hello

    I have a pretty basic question about the case structures in labview. As indicated in the attachment below, using the structure case I've pretty much tried to create a three position switch. I'm trying out a value for the first (in the range and Coerce) and another value to the second. If [5-0] 0, [0 0] case for case 1 and case 2 [0, 5]. However when I try to connect all the way to the top, a broken line appears.

    How can I do this without error?

    Thank you

    Justin

    Something like this maybe? You need to change the task UP as well.

  • Confusion of case Structure

    I started to do a program to monitor some measurement devices that measure permanently: flow, temperature and pressure of the water. There are many limits to the user set. For each meter (there are 3) the user can set soft limits for the 3 parameters. If the data passes above the max or below the min, the indicator box to yellow... The user also defines the hard limits, which are the same idea, but when these are exceeded, I would like the indicator box to turn red. When data are very good, I want the indicator box to be green.

    When I run the program, it seems that in response to a case structure causes blocking the program, even if it is a while loop that should only stop when I press a button. I will attach the code, and I hope that someone knows how to fix this situation.

    P.S. If you know a better way to make comparisons and change the color, I would be more than happy to hear it!

    Thank you!

    I removed the DAQ stuff because I do not have a data acquisition installed, and I put in a random number generator to create the data table.  It worked very well.  It continued until I pressed stop.  Maybe you have a DAQ error that prevents your vi.  In your code, you should include Error In and error Out.  Also, you should put a clear DAQmx at the end of your code function.  Your method to change the colors, that's what I would use.  The fact that you have so many controls adds to the code.  Instead of using upper and lower, you could simplify your code by using the function in the range and force.  You can code in a function in the scope soft limits and hard limits in another function in the range.  You need to hard limits substitute the soft limit, as you do now.

    Simlify the code, you can also create tables to contain all limits.  Pass your array to read data acquisition data in a loop of Foor with indexing enabled.  Inside the loop, you use the loop index in parallel the limits berries, then use the stove functions to determine violations of the hard and soft limits.  You would need a business structure to dictate what update indicator.  Thread index of the loop the selector of the case.  It would be dealing with one channel at a time, but its so fast that I don't think you have seen a difference.  The code would certainly smaller and easier to read.

  • event structure vs case structure

    I am developing LabVIEW: tool of control and vision. Front Panel has a lot of buttons, each button will execute a single or a group of the screws.

    I found that:

    1. event structure is good for digital change. i.e. the user change a corordinate and motors are moved.

    2. the structure cases is suitbale where such that use click "run MTF", a case structure is executed to calculate MTF.

    I tried to use the structured event to pick up button click but it isn't reliable workign, such as the user clicks too quickly and LabVIEW does not record events or LabVIEW records the event even twice

    However, I have a number of clicks functional structures. My block diagram will be uncontrollable.

    Any idea/tip/trick be greatly appreciate!

    -best

    If you understand how LabVIEW works and understand the principle of data flow, what I'm going to say the will of sense.

    The idea of a Structure of the event, it's that he's sitting there, don't take no time CPU until an event (usually a change in a Front Panel control) takes place.  Then he does everything you ask in its event arguments.  The trick is to do almost nothing in the structure of the event, but to say another loop, running in parallel, to do something.

    The key here idea is you have two loops, running in parallel, independently, at their own pace.  One, the event loop, waiting for an 'event '.  When it happens it it "sends a message" to another loop (or loops) that make treatment (which may take some time) as defined by the event loop.  The point is that it is very fast to send him the message (which is usually done via a queue), so the event loop is able to respond much more quickly that the user can push buttons on a façade.

    However, when the hands of loop event off the Message 'go do this task' another loop, the task may take longer.  If the tasks are put in a queue and then they get finished, the next task is running.  The key thing here is that the two loops, the loop «Ask» (events) and the loop ' Do ', run indepedently and at their own speed, nor dependent on the other.

    Bob Schor

  • Case structure works is not as expected

    Hello all

    I have a business structure which does not seem to work there in the State on.

    I created the circuit 1st in 1st red slice and it works each led flashes on then off in sequence, but when I try this logic in a case statement (in the 2nd red block) they are all remain lit.  What is the way in which the case statement suppose to work?  Is their a workaround solution?

    Thank you

    First of all, you have here a block diagram.  A 'circuit' is what you create in the material of electric wires and components with electronic.

    All your case structures all work as expected.  What you were doing in the upper part is different from the bottom.  In the background, each LED is located inside a special case.  This particular case only runs when something is true.  You have no way of writing a fake to the LED, because if the LED is going to be false, this case will not run.  Up there, the LEDS are always in the path of execution, so that they get a value True or False, written for them, as appropriate.

  • Case Structure range

    I have a simple application, where I use a pneumatic cylinder using the compressive force.  The user enters a set-point of load in the front panel and my LabVIEW program reads the force coming from the load cell and adjusts the current in an electric regulator to control the load to the desired value.

    I would like to have a Boolean simple of LED on the front panel to warn the user if the actual load is in about 2% of the set value that they entered.  For example, if they have 100 N entry, I want the Boolean value of LED to be green when the load is in 98 N and 102N and red when it is not.

    I thought that I would need a structure to deal with a numerical range to control the Boolean value.  The problem is that the load set point will change based on user input, so the beach in the structure of the case will change.  Is it possible to use the structure of the case where it can use the percentage of the target value of load as the limit for the beach?  Or y at - it another way to code this feature?

    Thank you

    Russell

    You can't do that with a case structure.

    You want to look In Range and force.

  • DAQ Assistant no recorded data during the case structure is false

    I try to turn it on turn off heater using intermittent relay module (some time and some free time). The program attached that do very well. Except that I also want to record the temperature of the radiator using materials DAQ Assistant and it records all the data when the case structure is false. I mean, when the relay is off. I tried to use the vi for the acquisition of data in the structure of the case. However, aparently it is not possible to call the module analog input even twice in the same program. All solutions? Thanks in advance.


  • case structure: to run once when the condition is true

    I have a case structure in my program. I use this to count the number of cycles in my experience. I have a knot of feedback (image of the program here attaced) within a box structure. I want the case structure to run only ONCE when the condition is "TRUE". Each "TRUE" represents each cycle. The problem that I'm facing here is that the box structure is permanently running as long as it is 'TRUE' instead of running once and wait for the next 'TRUE '.

    Temporaritly I use a timer inside (as you can see in the picture) to contain the program for the next 'REAL' to come. I hold as by case so I know exactly the time. Is it possible to make the case structure running only once when the condition become ' TRUE and wait for the next "REAL"?  OR is there any other loop that case structure that make this work?

    Hi aneps,

    PtByPt_BooleanCrossing is your friend!

    You really need to work on the analysis/description of your problem: you don't want to run the case as long as the entry is set to TRUE, but you want to run the case at the entrance of the past from FALSE to TRUE!

  • How to create a negative feedback on a case structure to estimate changes in speed among a range of speeds

    Hi I am new in programming with LabVIEW and I try to create a program that allows to estimate gear changes based on how fast the vehicle of support falls. The speed is measured by an OBD device and the results are saved in a spreadsheet. I created a sample program that contains a loop that reads the table of speeds of line by line. I then created a case 2 structures for example 2 speed brackets each support represents a gear (3rd 35-54 km/h, 4th gear gears 55-79 km/h). My problem is I want to count how many times the speed changes of support from one to the other to symbolize a change of speed. Right now my program will count only the number of speeds within each support the entire speed range.

    So in summary I need help, trying to create an effect of negative feedback while first gear which falls within a range of speed is counted as a speed change, but none afterwards speeds are counted until a new slice of speed came.

    I attatched the logfile and VI of suggestions would be greatly appreciated!

    Thank you

    Michael

    Hi Michael,

    I made some changes to your code

    1 replaced the 2 structures dealing with one, which displays the report.

    With the help of numerical values (instead of Boolean values) as the case selector - you can use whole; I see in the file CSV that all your speeds are integers of anyway, but I added a bit of code that allows to convert an integer, rounded down. So where logic says 35-54kph inclusive, because whatever between 54 & 55 be have been rounded down, this will also take to speeds up to 54.999999 (etc.) if need be.

    I then sent this 'current gear' variable to a shift register, so each iteration of the while loop allows to compare the report with the previous train. This case structure returns 0 if the speed is out of range (35-80).

    2. I added the code that essentially says "is the new different gear to gear for the last iteration? YES - to increment the number of variable gears. NO - do not change the number of variable changes"this variable is also passed in a shift register, it's can be passed from one iteration to iteration.

    3. I've got rid of 2 shift registers that you added, to write off the table index, because it is more effective and less code to just use the terminal of the iteration. (Don't forget iterations of loops are zero indexed).

    At present, the code I've written generates the total number of changes in speed (0-3, 0-4, 3-4, 4 - 3, 4-0, 3-0). If you only want to speed changes, there are between 3 & 4, you could put a structure affair around the section of code that I added a box of decoration autour and run that code if the current/previous gear is not = 0.

    I hope that this help - at least to give you an idea of how this can be accomplished.

    Thank you

    Amy

  • Error 200088 using the DAQmx reading VI in a case structure

    Main problem: I'm writing a VI that will read data from a data acquisition and write to a text file when I hit a button "registration". To do this, I use the VI of reading DAQmx in a while loop, which is located in a case statement (I hit the 'Save' button for the case of true), which is in another while loop. My DAQmx create Virtual channels screws are outside of the loop, so a wire goes through three structures to connect these screws to the VI DAQmx Read.

    After clicking on 'Save', my VI works until I hit the "Stop" button, how I get error 200088: ' specified is not valid or does not exist. " If anyone can help me get rid of this error, that would be greatly appreciated!

    I enclose my VI and an image of the error.

    Secondary problem: currently, I use two different DAQmx read live: one mentioned above, which lays down: after clicking 'Save' and the other who reads data continuously to display on maps. I want to combine these two, but I don't know if this is possible given the case statement.

    Thank you!

    Hi Alexwright,

    I made some quick changes to demonstrate the producer consumer loop that would be effective in your case. You want to loop of producer in the first while loop so that you use and the same closing DAQmx task. Moving a forwardthis will require some trial and effective change for your application. Please also make sure you use our debugging tools: http://www.ni.com/gettingstarted/labviewbasics/debug.htm.

    I hope this helps.

  • Synchronize the case structure with enum update

    Hi, I created a control enum initially with the "First" and "Second" values. In the block diagram, I created a node of this enum control property and it is connected to a box structure. The structure of business allows me to manage the condition "First" or "Second" correctly.

    I then modified the items in my enum so there is now a 'third party '. My problem is that structure business conditions still show as 'First' and 'second '; That is to say, I can't handle the "Third" condition My question is how to synchronize my case structure to show the updated enum values?

    VI, attached, the sample created with LabVIEW 2009 version 9.0f3 (32-bit) running on Windows 7.

    Thank you all for your help in advance.

    Michael O'Shea

    First tip: remove the value 'default' first case

    If you have done your VI pauses when you change your enum, which is a good thing.

    Now to synchronize, do a right-click on the border of the structure of the case and select 'add the case for all values', this is the option you are looking for.

    Tone

  • Get the names of all cases by programming in a case structure

    Hi all

    I have a Subvi, which is a diagram of States (some control test equipment), with many States (i.e. each "State" is a case of a business structure), a text string chooses the case. All cases are appointed.

    In this sub - is VI possible for me to get programmatically the name of text for each case of this business structure? I want to be able to recover these channels so that the main VI will be able to call the valid States.

    I have the error handling to ensure that if a State not valid is called (using the default case) that an error will be returned to my main vi, but I prefer to be able to retrieve the string to avoid any typo etc.

    Don't know if I've explained this well.

    Thank you

    DS1

    ds_1 wrote:

    [...]   The script I can watch in many it may seem a little complex [...]

    It is not too complex, but it won't work in an executable file.  This program gets a reference to the structure of the case (by searching for the text of the label) and returns a list of names of frame.

    Perhaps my plugin CaseSelect will help you with your Machine States based on a string.  You can put any valid States in string constants by double-clicking a list of cases.

  • problem of data flow in the case structures (using a state machine)

    Good day everyone.

    I'm having a problem with the flow of data between the structures of the case.

    I try to use an example of a state machine for this simple problem. but when I try to send data of a box structure to change the State of the code. It will change not in the desirable output, instead, it offers the possibility that the exit options emul.

    could someone please point what I'm doing wrong here. Any kind of help would be very appreciated.

    With a quick glance at your photos a question you have is that you use not data flow. You write your status updated in local variables value. Your State should pass through the case structures are a single wire. Playback of your order "Enum", happened in the register shift on the right side of your loop probably get running and reading before any processing occurs within the structure of your business. That's why you're reading the old value of the State and not the update. or have a classic case of a race condition in your code.

  • Keeping the count of how many times a case structure has been entered.

    I have a "Case" structure (when a button is pressed, it's "True case").

    I want to keep track of how many times the 'real deal' was seized.

    How can I do this?

    For this you need to have a shift register or a feedback node and take into account each time that the case of the case of structure runs the count will be increased to see the attached excerpt.

    Good luck

Maybe you are looking for