Select the problem with expressions

Hello

I use Teststand 4.0 and a frustrating problem with the Select Case statements.

I have attached a sequence that shows the problem.

A loop from 0 to 10.

The select case statement should decide which box 3 instructions corresponds to the expression and a message box is displayed.

However the Basic program reacts as expected.

First, he made his entry with a value of 0, it goes to the > 7 stated case.

The second time, he enters the loop with a value of 1, it will correctly to the<3 case="">

The other values of 2 to 10 enter no case statement.

Is this a bug in TS 4?, or I do something wrong?

Thank you

Mike

The problem is that you compare the Locals.New_Val of the Locals.New_Val property.< 3". ="" if="" those="" two="" properties="" match,="" then="" it="" will="" execute. ="" if="" you="" wanted="" that="" particular="" case="" to="" execute="" when="" locals.new_val="" is="" 0,="" you="" would="" just="" type="">

Unfortunately there is no way to have multiple cases of a single block of code.

In C, you could do it like this:

Switch (newVal)

{

case 0:

case 1:

case 2:

do something

break;

case 3:

case 4:

case 5:

case 6:

case 7:

do something else

break;

etc...

}

Even in C, it's awkward, and you would probably do the following instead:

If (newval<>

do something

Else if (newval<>

do something else

on the other

do something else

The reason why it works in TestStand, is that expressions will try to automatically convert types if she can do it.  false is logically equivalent to 0 and true, it is logically equivalent to 1, so what you are really comparing to in your case statement is your property (Locals.New_Val) to a Boolean expression that evaluates to 0 or 1.  It is certainly not obvious when we look at, but at least, this explains why it happens.  Another way, you could do this is to change "Point to compare" step of the 'True' selection, which will each case in order to compare the expression of the value 'true '.  I still recommend a structure if/else if/else for this kind of problem because it's easier to read, but it is possible to do what you want in this case with a select / box.

P. Allen

NEITHER

Tags: NI Software

Similar Questions

  • Select the problem with joined tables

    Hello everyone I have the following query
    SELECT 
        OBJEKTI.OBJEKAT_ID OBJEKAT_ID, 
        OBJEKTI.ADRESA ADRESA, 
        OBJEKTI.POVRSINA POVRSINA, 
        OBJEKTI.BROJ_IZVRSILACA BROJ_IZVRSILACA, 
        OPREMLJENOSTI.OPREMLJENOST_ID OPREMLJENOST_ID, 
        OPREMLJENOSTI.PULT PULT, 
        OPREMLJENOSTI.REKLAMA REKLAMA, 
        OPREMLJENOSTI.MOKRI_CVOR MOKRI_CVOR, 
        OPREMLJENOSTI.WC_ZA_IGRACE WC_ZA_IGRACE, 
        OPREMLJENOSTI.WC_ZA_OSOBLJE WC_ZA_OSOBLJE, 
        OPREMLJENOSTI.VENTILATOR VENTILATOR, 
        OPREMLJENOSTI.OSVJETLJENJE OSVJETLJENJE, 
        OPREMLJENOSTI.VRSTA_BROJILA VRSTA_BROJILA, 
        OPREMLJENOSTI.ELEKTRO_INSTALACIJE ELEKTRO_INSTALACIJE, 
        OPREMLJENOSTI.VODO_INSTALACIJE VODO_INSTALACIJE, 
        OPREMLJENOSTI.TELEFONSKE_INSTALACIJE TELEFONSKE_INSTALACIJE, 
        OPREMLJENOSTI.GRIJANJE_ID GRIJANJE_ID, 
        OPREMLJENOSTI.POD_ID POD_ID, 
        OPREMLJENOSTI.PROZORI_VRATA_ID PROZORI_VRATA_ID, 
        OPREMLJENOSTI.OBJEKAT_ID OBJEKAT_ID1, 
        TEHNICKE_OPREMLJENOSTI.TEH_OPR_ID TEH_OPR_ID, 
        TEHNICKE_OPREMLJENOSTI.ONLINE_KLADIONICA ONLINE_KLADIONICA, 
        TEHNICKE_OPREMLJENOSTI.PANO PANO, 
        TEHNICKE_OPREMLJENOSTI.NOSACI NOSACI, 
        TEHNICKE_OPREMLJENOSTI.TV_LCD TV_LCD, 
        TEHNICKE_OPREMLJENOSTI.TV_TELETEXT TV_TELETEXT, 
        TEHNICKE_OPREMLJENOSTI.APARATI_IGRE APARATI_IGRE, 
        TEHNICKE_OPREMLJENOSTI.EVONA EVONA, 
        TEHNICKE_OPREMLJENOSTI.NOVOMATIC NOVOMATIC, 
        TEHNICKE_OPREMLJENOSTI.RULET RULET, 
        TEHNICKE_OPREMLJENOSTI.BILIJAR BILIJAR, 
        TEHNICKE_OPREMLJENOSTI.KLIMA KLIMA, 
        TEHNICKE_OPREMLJENOSTI.OBJEKAT_ID OBJEKAT_ID2, 
        PONUDE.PONUDA_ID PONUDA_ID, 
        PONUDE.ONLINE_TERMINAL ONLINE_TERMINAL, 
        PONUDE.SRECKE SRECKE, 
        PONUDE.ONLINE_KLADIONICA ONLINE_KLADIONICA1, 
        PONUDE.APARATI_IGRE APARATI_IGRE1, 
        PONUDE.RULET RULET1, 
        PONUDE.BILIJAR BILIJAR1, 
        PONUDE.OBJEKAT_ID OBJEKAT_ID3 
    FROM 
        OBJEKTI, 
        OPREMLJENOSTI, 
        TEHNICKE_OPREMLJENOSTI, 
        PONUDE 
    WHERE 
    (PONUDE.OBJEKAT_ID=OBJEKTI.OBJEKAT_ID AND TEHNICKE_OPREMLJENOSTI.OBJEKAT_ID=OPREMLJENOSTI.OBJEKAT_ID) OR (OPREMLJENOSTI.OBJEKAT_ID=OBJEKTI.OBJEKAT_ID AND TEHNICKE_OPREMLJENOSTI.OBJEKAT_ID=OPREMLJENOSTI.OBJEKAT_ID)
     ORDER BY OBJEKTI.OBJEKAT_ID
    The problem I have is any WHERE clause I use I have double values that makes no sense. I checked in the tables and I not all double values. Each Opremljenost has 1 objekat (there are 2 rows of each with its own Objekat) and this applies to 2 other tables (PONUDE and TEHNICKE OPREMLJENOSTI), but for some reason any that they double values. If I run it without a where clause at all clause, I get a repetition of values itself up to 4 times. Does anyone have an idea what's wrong with my request?

    Well, if all relationships are to 1-1 (1-0), then try this (the names of table/column, but you get what I mean bad):

    select OBJ.*, OPR.*, TEH.*, PON.* -- I know you can't do this, but you get what I mean.
    from OBJ,OPR,TEH,PON
    where OBJ.object = OPR.object (+)
      and OBJ.object = TEH.object (+)
      and OBJ.object = PON.object (+)
    /
    

    its supposed to be a 1 to 1 relationship, but it is not.

    In this case the remedy is very simple: create a UNIQUE constraint on the column of the OBJECT in OPR, TEH and PON...

  • I installed the download tool usb/dvd windows 7, but after you have selected the iso file when I insert the USB stick and refrecing, it does show that "no usb drive compatible' what is the problem with my USB

    I installed the download tool usb/dvd windows 7, but after you have selected the iso file when I insert the USB stick and refrecing, it does show that "no usb drive compatible' what is the problem with my USB

    I have sandisk cruzer blade USB key

    Hi Rohit,

    Thanks for posting your query in Microsoft Community Forum. I understand that your USB drive is having problems of compatibility with your computer, but I would like to learn more about the issue in order to provide you with better assistance.

    1. You did it any significant hardware or change software on the computer before this problem?
    2. When do you get exactly the error message?
    3. Have you tried to connect to any other computer on this flash drives?
    4. Your USB key works on other computers or have you tried to connect to different USB ports on this computer?
    5. Is the pen drive getting detected in the case or you are able to access the drive folder in the window of the computer ?

    The question may arise if the currently loaded USB driver has become unstable or damaged, or if your PC requires an update for problems that could conflict with a device USB and Windows. This can also occur if your USB controllers may have become unstable or corrupt. So, I would suggest trying the following steps and check if the problem persists.

    Method 1:

    Please try the fixit (s) provided below which will help you solve common problems associated with devices and USB ports.

    If method 1 does not work, try Method 2.

    Method 2:

    Remove and reinstall all USB controllers.

    1. Open Manager devices by clicking the Start button, click Control Panel, click system and security, and then, under System, clicking Device Manager. If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.
    2. In the list of the categories of equipment, locate and expand Bus USB controllers.
    3. Right-click every device under the Bus USB controllers node and then click Uninstall to remove them one at a time.
    4. Restart the computer and let the USB controllers get reinstalled.

    Plug in the removable USB device and test to make sure that the problem is solved.

    If the problem persists, go to method 3.

    Method 3:

    This method will install the latest drivers from device to your USB device.

    1. Click the Start button, type Windows Update in the search box, and then click Windows Update in the results pane.
    2. Click find updates. When the scan finished, click optional review updates.
    3. Click the check box next to the update, and then click install updates.
    4. If you are prompted, read the license agreement, then click I agree.
    5. Follow the instructions on the screen to download and install updates.
    6. If you are prompted, restart your computer.

    More information: Update a hardware driver that is not working properly

    Hope this information is useful. If the problem still persists, please post back for further assistance, we will be happy to help you.

  • Could someone explain to me what is the problem with this refined expression?

    Hi, could someone explain to me what is the problem with this refined expression

    faultCode:Server.Processing faultString:' unable to invoke CFC - regular expression malformed ' ^ [0-2][0-9][/][0-1][0-2][/][1-2][0-9]{3}+$ '.»»

    Thank you

    I think that the + should not be there. Do you have a match?

  • What is the problem with this WHERE statement?

    What is the problem with this WHERE statement?

    < cfquery datasource = "manna_premier" name = "kit_report" >
    SELECT SaleDate,
    TerritoryManager,
    Distributor,
    DealerID,
    Variable,
    US_Dealers.ID,
    DealerName,
    DealerAddress,
    DealerCity,
    DealerState,
    DealerZIPCode
    Orders, US_Dealers
    WHERE US_Dealers.ID EQ DealerID AND SaleDate BETWEEN #CreateODBCDate (FORM. Implementation) # AND #CreateODBCDate (FORM. End) #.
    ORDER BY SaleDate
    < / cfquery >

    It's driving me crazy!

    Syntax error (missing operator) in query expression ' US_Dealers.ID EQ DealerID

    You accidentally use the CF equals operator: "EQ".

    Instead of MS Access: «=»

    [Macromedia] [SequeLink JDBC Driver] [ODBC Socket] [Microsoft] [ODBC Microsoft Access driver]...

    in a query expression. AND SaleDate BETWEEN #10/1/2009 #-October 18, 2009 #'.

    I don't see how CreateODBCDate() would produce these values.  But maybe it's just a quirk of the error message?

  • The problem with recording

    Well, just at the moment where someone starts calling and he wants to take he writes "the problem with the recording" he calls here Echo and all the time the same... They advised you'd like?

    In Skype, open Tools-> Options-> Audio settings. Which device is selected as the Microphone. You have several options available in the select box?

  • What is the problem with Safari?

    Since the last update of El Capitan, Safari has become almost worthless.  I can't use it. It will give me the beach whirling death ball. I can not click through links. the full page is not displayed.

    What the * is the problem with that?  It's the kind of shit that I would wait in a Microsoft product. I had started using Chrome.

    What the * wrong with Safari and when you're going to fix?

    Try to reset the settings of Safari:

    1. open Safari

    2. click on the Safari menu at the top (to the right of the Apple logo)

    3. Select the Preferences/Privacy tab

    4. click on remove all data from the Web site

    5. close Safari.

    Remove cache Safari files:

    1. click on finder

    2. look for the menu GO to top

    3. click on GO and hold down the option key. This will show a user library folder.

    4. click library and find the Caches folder

    5. in the folder caches com.apple.Safari Ouvrezledossier

    6. move the Cache.db file Trash.

    This should solve the problem. If it does not help, try to disable the Safari extensions

    1. open Safari

    2. click on the Safari menu at the top (to the right of the Apple logo)

    3. Select Preferences

    4. find the Extensions tab

    5 disable all extensions of

    6. relaunch Safari

  • Always the problem with e-mail after trying to repair it with uninstall

    When I try to delete e-mails, it is said: msg store was damaged by an external application to windows mail. Windows mail at recovered. error 0 x 0000000.

    I delete the emails and they do not appear in my file delete so I can remove them permanently. When I opened my email each day the same messages deleted come thru with exactly the same day as before and as a new email. I have the border in Arizona as my provider. I followed the instructions of a similar problem, I was alerted by going to programs, uninstall, repair, but no luck, same thing back on email. I get emails with the date of the day on them, so I'm able to send and receive. Exactly what remove file showing nothing as deleted, and when I click on an e-mail I deleted it says that it does not. I use the computer for email and internet, that's all. My computer is a windows vista Basic. Thanks for any further help.

    Hello

    You use Norton or McAfee av?  I suggest to uninstall these and select free software such as Microsoft Security Essentials, Avast or AVG.  These work properly with Windows Mail.

    How to fix most of the problems with Windows Mail

    http://www.Vistax64.com/tutorials/62560-Windows-Mail-problems.html

    Alternatively, you can consider the use of the Windows Live Essentials Mail instead of Windows Mail application.

  • What is the problem with Windows 7 Live Mail?

    What is the problem with Windows 7 using Windows Live Mail?

    When I type my emails using special characters, for example "$- + = % sometimes even Live Mail change my characters to a reverse with a top character."  And it it changes between the time wherever I sends it and receives the other person, so I never really know if they receive a message scrambled or not.  I never had this problem with Outlook Express.  What can we do about it.  I use this for business and it is absolutely unacceptible.

    Hello

    This forum deals with aspects of electronic mail on your computer network.

    If the problem related to the Live mail Server, or configure the features of the software, you'll do better by logging and displaying the question on Live Mail support forum.

    My moderator tools cannot transfer messages on the forums of Windows,

    Please re - ask your question on the Forum Windows Live,

    Windows Live Mail Forum
     
    http://windowslivehelp.com/forums.aspx?ProductID=15

  • What is the problem with my Oracle reports parameter?

    Hello

    We use a PL SQL package that allows the user to select the report you want Oracle and associated parameters.   While the control is passed to Oracle 11 g reports.

    The requirement of one of the reports is to enable more detailed codes be selected by the user and then shown.  The detailed code is an alphanumeric field that can hold between 4 and 6 characters.

    If my data model looks like this

    SELECT student_id

        FROM my_view

       WHERE detail_code IN :p_detail_code;

    and the parameter that I'm passing to Oracle reports looks like this (when I view the source HTML code)

    & p_detail_code =('1001','1002')

    so no record is selected.

    However, if my data model looks like this, I get the records you want:

    SELECT student_id

      FROM my_view

    WHERE detail_code IN ('1001', '1002');

    We have Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production.

    Please tell me what is the problem with my setting.  Thanks a lot for your help.

    This isn't how you can use in. See this example on how to solve it with the digital settings. If your setting is a character, you need to change this.

    In fact, when you simply enter 1,2,3 as an input parameter, you actually create this query:

    Select *.

    from my_table

    where num_column in ("1,2,3")

    Use rather a lexical parameter:

    Select *.

    from my_table

    & p_where

    In the parameter after relaxation shape, build the lexical like this:

    :p_where := 'where num_column in ('||:p_param||')';
    
  • I agree with the CC. But I also have APS CS6. I get the message that the updates are available. But whenever I try to 'install', I get the message that it failed and the error code is U44M1P7. What is the problem with obtaining this update?

    Whenever I try to install I get message that he had failed. The error code is U44M1P7. What is the problem with this update?

    U44... Update error http://forums.adobe.com/thread/1289956 can help

    At some point in the past (I don't know the exact date) Adobe "merged" the original update manager in cloud Update Manager, which means that you no longer use your original update manager

    I read a lot of posts that the updater latetest (cloud) sometimes does not work with old programs... Try to install your updates manually

    Beginning of the updates here and product selection, read to see if you need to install updates in the order of the numbers, or if updates are cumulative for the product http://www.adobe.com/downloads/updates/

  • How to solve the problem with the wacom tablet and the polygonal lasso tool. It does not work with a pen.

    How to solve the problem with the wacom tablet and the polygonal lasso tool. It does not work with a pen. I have install windows 10 and fresh, new drivers for wacom bamboo, could he makes problems or there is a problem of photoshop?

    It should do.  You use one of the buttons of pen maybe?  Just touching wheels with the pen with no buttons or modifier keys.  Press ENTER to close the selection.

    Personally I never use the lasso, Polygonal, but rather just the Lasso tool by using the ALT (Opt) to operate the Polygonal tool.  I also use the mouse instead of the Tablet for the selection of cutting edge.  It is a little too uncertain where the point will go when hovering the stylus above the image.

  • Select the line with the smallest Beach

    Hello
    I am trying to build a complex query...
    He must select the line with the inner range...

    I'll explain for example:
    Location of poolsize ID value
    1 32 8
    2 40 6
    3 42 8
    4-36-3

    I want to select the line where the fork between value and value + poolsize is shared also with the other location...
    so:
    1 is 32-40 (in A place)
    2 is 40-46 (in place)
    3 is 42-48 (location B)
    4 is 36-39 (at location B)

    4 is located at 1 (and there are different places...) so sql must return to the fourth line.

    Any help will be appreciated!

    Thank you
    fcbman

    Hello

    fcbman1899 wrote:
    Hello
    I am trying to build a complex query...
    He must select the line with the inner range...

    I'll explain for example:
    Location of poolsize ID value
    1 32 8
    2 40 6
    3 42 8
    4-36-3

    Whenever you have a problem, please post CREATE TABLE and INSERT statements for your sample data, in order to let the people who want to help you re-Ridge the problem and test their ideas.
    See the FAQ forum {message identifier: = 9360002}

    I want to select the line where the fork between value and value + poolsize is shared also with the other location...
    so:
    1 is 32-40 (in A place)
    2 is 40-46 (in place)
    3 is 42-48 (location B)
    4 is 36-39 (at location B)

    4 is located at 1 (and there are different places...) so sql must return to the fourth line.

    To find all the rows that are within the range of at least one other line with another location:

    SELECT     *
    FROM     table_x  m
    WHERE     EXISTS (
                 SELECT  1
                 FROM        table_x
                 WHERE   location          != m.location
                 AND        value          <= m.value
                 AND        value + poolsize     >= m.value + m.poolsize
                )
    ;
    

    When you talk of the "" * most * inner range ", do you mean that you might have another line, such as"

    INSERT INTO table_x (id, vlue, poolsize, location) VALUES (5, 37, 1, 'C');
    

    which is inside the range of id - 4, and that's why you wouldn't have id = 4? If so, include examples in the results and data sample yout. You can do this with a query CONNECT BY, or, depending on your version of Oracle, a WITH recursive clause.

  • What is the problem with Creative Cloud connection update

    What is the problem with Creative Cloud connection update?  I tried 25 times to update, but it does not work? Can you please help?

    Double-click on the creative process of cloud.  which opens another window that contains a button exit.

    or, click the process (to select) > click on view > click process to quit.  This method brings up a window that contains the two resignation and force them to leave (in the case of quit smoking does not work).

  • What is the problem with this pl/sql code?

    What is the problem with this statement of the cursor? I am getting PLS-00341 error for her:
    CURSOR cur_rsource(p_sql_stmt IN VARCHAR2) IS
            SELECT plan_table_output FROM v$sql s, table(dbms_xplan.display_CURSOR(s.sql_id, s.child_number)) t WHERE sql_text LIKE '''%'||p_sql_stmt||'%''';
    How to solve this problem?

    Thank you

    Published by: PhoenixBai on December 14, 2009 14:05

    I don't have time right now to study exhaustively, but for me his vomit ORA-00942 table or view does not exist on this line:

        SELECT sql_id, child_number into tmp_sql_id, tmp_child_number
             from v$sql where sql_text like sql_statement||'%' and sql_text not like '%v$sql%';
    

    I am able to select from v$ sql in normal SQL as user I am compiling as, so don't know why it's complaing.

    Anyone know if there are certain restrictions on access to the views v$ through PL/SQL?

    EDIT: http://www.dbasupport.com/forums/showthread.php?t=22299

    Access to the views of $ v seems to be through a role - try giving explicit access to it.

    As SYS, you must grant select permissions on V_$ SQL (V$ SQL is synonymous with V_$ SQL) to your owner of the procedure. Just tested on my system and it allows him to compile.

    Published by: Cyn on December 14, 2009 10:30

Maybe you are looking for