Case of Structures

A case may be created in case of a decimal value or range structures? It does say 0.001.0.5?

I can create cases structure for say 1.5

I can create it for 0.001.0.5?

No, you cannot, the terminal business structure does not support decimal numbers. But if you have a hand full of range as [. 001;. 01 [, [. 01;. 1 [and [. 1;. 5 [then you could multiply and round the value of 1000 and set your range of 1.10, 10,100 and 100 to 500]]]]]

Just one quick idea, other solutions would be possible.

Tags: NI Software

Similar Questions

  • Case of Structures run a particular set of code for several conditions?

    Structures of the event may have a single case of event manage several event specifiers.

    C code supports this kind of statement 'switch ':

    Switch (EnumValue)
    {
    case a:
    case b:
    handleAOrB();
    break;

    case c:
    case d:
    e case:
    handleCOrDOrE();
    break;

    by default:
    handleOther();
    }

    How about Business Structures? Can I attach a code block to multiple values to enums? (without duplicating cases, which might be a maintenance nightmare)

    Edit: the closest thing I found is http://forums.ni.com/t5/LabVIEW/case-structure-multiple-inputs/td-p/2377132, but my original enum in another conversion is a bit rude

    You can specify multiple values enum for a particular case. Is that what you're looking for?

    For more information, see the series of weekly nuggets that I wrote on the case Structures: part 1, part 2, part 3, part 4and part 5.

  • Disable & gray a case of structure of the case

    Hello!

    I use 2 business structure to choose if I want a channel 'create' or not. I don't know if it's the best way to do it but... It s okay if I use this control type to choose the case? and... How can I disable and grey items in the not selected case?

    Thank you to

    TXL

    Yes you can do to control or indicator... Use the property node...

  • case of structure above or below

    Hello.

    I have trouble making a structure case that if a digital input is greater than a number, it does one thing and less he made another.

    Basically how do you work with structures of cases that are not Boolean, especially if a number is greater than 38 he he reassigns 0 (multiply by zero, something like that).

    Neil_Helsel wrote:

    Hello.

    I have trouble making a structure case that if a digital input is greater than a number, it does one thing and less he made another.

    Basically how do you work with structures of cases that are not Boolean, especially if a number is greater than 38 he he reassigns 0 (multiply by zero, something like that).

    You can use the range in a select case structure field. Use 38... for greater than or equal to 38... less than or equal to 38 38. You must use integers for that.

    EDIT, you can also use more operator if you have 2 possibilities.

    Ben64

  • set the number of cases cases of structure

    Is there a quick way to define say 200 cases in a structure of cases without having to manually add another case, after or before?

    Kind regards

    Hey Grant,

    who needs 200 + cases in a structure would have use a typedef enum, which connect to the entrance of the selector and select "create a case for each item.

  • Case of Structure / timer

    Hello

    I have attached a sample vi to control a serial device that takes input from 40 to turn the unit on and 41 to turn off the unit.

    I want to do is when I press start I want a 40 to send to the appliance and activate the timestamp of loop.

    Then, once the time is over, I want to end the timer to send a 41 to power off and stop the two loops.

    I think I need to add a case structure to the timing loop, but do not know how to do in this regard.

    Any suggestion would be great.

    Thank you


  • Case of Structure with three cases and a tolerance

    Hi all

    I have a variable tension that I will be integrated in a housing structure. Is it possible to put in place the structure case as follows.

    If input case is between 1,238 and 1.242, out = RIGHT

    If the case entry is less than 1,238, left = LEFT

    If the case entry is greater than 1,242, out = RIGHT

    Thank you

    Greg

    As mentioned previously, does not allow a variable to double precision as a selector of case. You will need to convert entire (digital > conversion) first

  • Case of Structure / while loop problems

    Hello

    I am trying to write a code that draws a random number whenever a key is pressed.  The chart must be a random number on the y axis and the number of times that the button is pressed on the x-axis.  I want to draw the last twenty random numbers.  I use a while loop and a box structure.  If the button is pressed, the case structure incruments the number of times where the button is pressed and generates a random number.  I'm using shift registers to track the last twenty numbers generated.  When the key not, registers to shift to day values incorrectly.  My code is associated with this issue.

    I know that the last value of the shift registers of wiring to the structure of the case will change the table across the last value when the button is not pressed.  I know what causes the problem, but I don't know how to fix it.  I would appreciate it if you have a look and give me some tips.

    Thanks in advance.

    Your problem is that the loop runs continuously and your values in the shift register are replaced when you do nothing.

    There are a few ways around this.  It would be simpler to use a Structure of the event.  Another option is to simply store your table in the shiftregister.  Use Rotate 1-d Array and replace a subset of table to update your chart.  It is a little more robust and easier to use than using the history of the shift register.

    But the absolute simplest, based only on what you told us, just use a graphic instead of a graph.  A graph keeps a history.  The length of the default history is 1024 samples, then you want to reduce that to 20.  Then you just wire your random number right in the chart, and everything is done for you.

  • case of structure on a FPGA implementation

    Have been programming in BT for many years, I am new to FPGA. In the following code, the method of bottom should normally be the right method; only the execution of the equation once instead of each iteration (100 X). But I was told that on a FPGA, two cases of the case structure run each iteration with the used appropriate output (can you please confirm or refute this?) If this is true there is essentially no difference?

    If this is true, is there a place any with a machine to States on a FPGA or all code must be written "dish"?

    Thanks for your help-

    lmd2

    Imd2,

    It is true that on each itteration the FPGA will calculate the results of these two cases. This is because the circuit is implemented in hardware parallel paths in order to not necessarily slow down execution. If you use the select block as in the example below, more it shows directly how this will be implemented on the target FPGA hardware.

    Furthur to optimize this code you can perform a single-cycle timed loop inside the loop for MAX so your speed.

    Hunter

    Supporter of LabVIEW FPGA

  • Problem with the event and the case of Structure

    Hi all,

    I get the problem in my program, I'm using the two structure one is the same and other structure box.

    In the structure of the case, I had the button as an entry to the SPL and the case structure as the output of the structure of the case.

    And in the same, then I had the two text box (num control A and B) in that I had put the event changes its value. Then, even I put the value has

    num or num B control control control this corrosponding num value will save seeing num C. Now the problem is when I click on

    the theLEB button does not blink until or if you don't put the value of one of the corrosponding num control.i didn't post my file in version 8.5 and 8.6 Please find tha.

    Hello

    It should work like that or I misunderstood what you want to do.

    If Boolean is true, boolean 2 is true, at the same time, you can change the value of A so C or B then C.

    See attachment

  • different sous-schemas of a case of structures Concat strings

    I use a case structure, which has about 8-10 different cases and each case has a string constant. I want to show the strings in a single indicator. Suppose that if 3 cases runs first, then second and third then. Then, the indicator should show

    "first case".

    second case

    third case.

    initially the indicator should be empty and then as soon as the first case runs indicator should show "first case".

    After completing the first case, when the latter is running then the indicator should show

    "first case".

    second case. "

    and so on... Please help me.

    $agar wrote:

    Here, it is attached with 3 cases...

    Well, who does not seem very useful. Try to scale of 10 Boolean values!

    Here's a quick draft how this could be done. Modify if needed.

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

  • Addition of registry to shift to Case stacked structure

    According to the help, you can add shift registers to the Structures.  The stacked sequence is a Structure, but I do not see the option to add a register to shift when I right click on the left side of the Structure.  Am I missing something?  I want to run my error in and error of the lines through the shift is part of a sequence stacked to do not have to do it by using a feedback loop, as which could be annoying.


  • 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

  • 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

  • Spinning ball on web pages

    I get the ball going off while I'm on the web pages, that it does not happen in applications

  • transferring files to the slow nas Server

    I just bought a new PC (HP Compaq) with Windows 8 and you have a NAS from Synology DS209 server. I joined this as a networkdrive, but it's extremely slow to copy files from the PC to the network (24 Kbps) drive. The two units are wired (no WIFI) dire

  • Drop of connection

    I would like to understand this connection problem has dropped. I have a wrt54g v5. For several months I had a loss of connection once a week. It now happens several times a day. My installation includes a Motorola Surfboard Modem in the Vonage WP2 w

  • sql database problem waterfalls

    Hello I use the cascades sql database! I am able to run the sql query, create tables and data screwed into it! But I am unable to read the sql database! Please help me! It's my code, SqlDataAccess sda (home.absoluteFilePath ("mydeb.db")); QVariant li

  • Presentation of C60 double profile on single screen problem

    Hello I C60 double profile. The problem I encountered, is when some end share the presentation then their screen comes on the 1st screen of my camera instead of the 2nd screen of the device. When sharing the screen, it goes to the second screen. Can