Timing of a case structure

I have a push button with mechanical action value until the release (to give ONE Boolean pulse for 1 second). I want to know a way to make the structure of case remains active for a specified period after that the button turns off.
Thanks in advance.


Tags: NI Software

Similar Questions

  • 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.

  • 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)

  • 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.


  • question of case structure

    I have 3 case structures in another... say I want to create a new structure of matter during all of these existing business structures. so you have real and it shows each of the structures case etc. When you go to false, all existing within the moment disappear.

    My question is, what about when you pass false, the exisiting structures arise, as sub set to true by default

    Thank you

    Right-click and duplicate the real structure, remove the additional false.

    /Y

  • Resetting a case Structure

    The goal is to fill two tanks, one after the other. When the first tank reaches 90, must emit red light, and the second reservoir begins to fill. Once the second tank reached 190, a green light, and when it reached its maximum capacity (200), the loop stops.

    I have most of the finished project, but my problen with my program, this is when the first tank ends and begins the second tank, the second tank begins where the first tank ends (90). I want red light stay lit while the second tank is filled from 0 to 200. What is the best way to get around this problem? I use the case structures and a while loop.

    Objectives

    -Fill the first tank to 90, the red light turns on

    -Second reservoir begins to fill with 0, the green indicator lights to 190

    -End of loop when second tank reached 200

    What happens if you would subtract 90 wire goes to the second tank?

    Yet, you have to rearchitect your code like a machine in good condition with levels of reservoir in the shift registers. using the iteration count is relatively rigid.

  • 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

  • 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

  • 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

  • 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.

  • In a case structure...

    In a case structure...

    If temp > 800 degrees celsius, then

    Pressure = 100 * e ^(10T)

    where t is the time varies at the rate of 100 ms.

    another pressure = 10 bar

    but t is expected to increase by century of 100ms or 0.1 sec

    It is to calculate the elapsed time. One takes time when you start the vi, one inside the loop takes at the present time and subtract it just determines the elapsed time from the start. I guess that's what you wanted.

    The double conversion (I guess) is just to avoid a point constraint .

  • Problem with several sub-groups through case structure Enum: 'the VI isn't in a State compatible with this operation.

    Hello

    I'm using LabVIEW 8.0 and I'm trying to create a subgroup of experts which shows the façade of a subvi according to the choice made by the user via the menu drop down Enum.  I wired the Enum to a case structure and apply a coding identical to each structure of individual cases with the exception of course change the source of sub - vi.  However, you receive an error "The VI isn't in a State compatible with this operation."  I have managed to make a single sub - vi work within a subgroup of experts using a true/false case structure and the same exact coding.  However, now that I use an Enum box connected to a structure of the case, I get this error.  I enclose my diagram as well.  Could someone help me as to where it is that I am wrong?

    Thanks in advance!

    If your VI runs already, when you try to run it? Which returns the error you get.

    Check the State of VI before trying to run or make an error handling.

Maybe you are looking for