Why does LabVIEW skip over commands in programming structures

Hello everyone!
Is there a certain way you program to make labview execute ALL commands within a loop before going into another loop? For example, I have a while loop that stops if either the stop button is pushed or if the set point input is greater than 8. If both of these are false, then the code entered a case structure where it controls the output from a plant model. However, labview will enter the case structure without checking if both conditions are met. I've attached the VI and in the next message will post the VIs from the plant. I want it to do the below code,
IF (Set Point > 8 OR Set Point < 0) THEN
       SET_Point OK= False
ELSe
      SET_Point OK = True
END IF
IF (SET_Point OK = FALSE OR Stop Button pushed) THEN
         ! STOP VI
ELSE
         ! Enter PID Control Loop
END IF
But labview likes to just jump around and skip parts for some reason. So when it for example, skips the OR check it uses the default value of true for the next case structure. It's driving me crazy. Can anyone please tell me why its doing this??
Thanks.
Solved!
Go to Solution.
Attachments:
General Auto PID Simulator.vi ‏83 KB
Global 1.vi ‏5 KB

Ah! I can't believe I made that dumb of a mistake. And thanks for the advice altenbach. My overcomplicated diagram probably lead me to making that error. 
I have another question though. How come when I use the Write to measurement file VI it will start the process variable at like 40 inches but when I don't use it, it'll start it at 0 and do as its supposed to? I've attached my updated VI with the write to measurement file VI in it. You'll see that if you delete it then it'll do as its supposed to. I don't understand why though..
Attachments:
General Auto PID Simulator.vi ‏118 KB
Global 1.vi ‏5 KB
problem with PV initialization.JPG ‏132 KB

Similar Messages

  • Why does Labview insert quotations in the case structure selector box?

    I was building a case structure with an array of strings.  So, I copied the strings from the array on the FRONT PANEL directly into the SELECTOR LABEL.  My 3 strings have the form; to me, these are 5- character strings with spaces, or 7 characters if you count the spaces as string characters 
    A, B, C   
    A, B, D
    A, B, E
    So, when I copied and pasted them directly into the selector box A, B, C appeared as "A", "B", "C" and A, B, D appeared as "A", "B", "C" and then I got an error for selector values not unique.  Why didn't it appear as "A, B, C"?
    Why did it transform the string I pasted and insert the quotation marks?  I used no quotation marks in my array.  Does the selector label interpret commas as functional characters that require quotation marks??
    Thanks,
    Dave 

    dav2010 wrote:
    I was building a case structure with an array of strings.  So, I copied the strings from the array on the FRONT PANEL directly into the SELECTOR LABEL.  My 3 strings have the form; to me, these are 5- character strings with spaces, or 7 characters if you count the spaces as string characters 
    A, B, C   
    A, B, D
    A, B, E
    So, when I copied and pasted them directly into the selector box A, B, C appeared as "A", "B", "C" and A, B, D appeared as "A", "B", "C" and then I got an error for selector values not unique.  Why didn't it appear as "A, B, C"?
    Why did it transform the string I pasted and insert the quotation marks?  I used no quotation marks in my array.  Does the selector label interpret commas as functional characters that require quotation marks??
    Thanks,
    Dave 
    Actually in CASE STRUCTURE, any frame can have multiple values as 'Case Selector value' and these are separated by a comma. Also if you choose to operate a CASE STRUCTURE using string, it will automatically prefixs & suffixs quotes (") to that string.
    But you can enter  "A, B, C" manually and it will remain as it is. But if you copy and paste A, B, C, the CASE STRUCTURE will automatically change it to "A", "B", "C".
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

  • Why does airplay skip

    why does airtunes skip over airplay with my apple tv 2?

    Have you cleared your browser cache and Flash Player cache?
    Firefox (History>Clear Recent History):
    FlashPlayer (Global Settings Manager - right click any Flash content):

  • Why does LabVIEW allow me to have 2 controls with same name

    Here's a general LabVIEW question:
    Why does LabVIEW allow me to have 2 controls with the same name in the same VI?  It seems like this only increases the chances of confusion.  Especially when someone is just looking at a block diagram (or documentation of a block diagram).
    No other programming language that I know of allows this.  I realize that uniqueness of name is not as critical in LabVIEW as it is in any text based language.  For example, in a text based language, if I had 2 variables called abc and I wrote a statement
    abc = 12;
    the compiler would not know which abc was being referred to.  In LabVIEW, if we had 2 controls called abc, the equivalent of doing an abc=12 is writing to a local variable (which is always linked to one of the controls) and there is no ambiguity.  Still, someone looking at the code cannot figure out which abc is linked to unless he does a right click>>Find>>terminal (or a double click).
    Even though I have never and never will name 2 controls the same, I think it would be a nice constraint to see enforced by LabVIEW.
    Any input from NI engineers on this?
    Message Edited by S G on 12-18-2007 03:38 PM
    S G
    Certified LabVIEW Architect, Certified TestStand Developer, Certified Professional Instructor
    Attachments:
    Trial1.JPG ‏21 KB

    I know when you copy and paste a control or indicator, LabVIEW automatically increments the label. But since you can hide the label, and show or hide the caption, there must be another mechanism that LabVIEW uses to keep track of all the controls. I thought I remember back in the "old days" (ver 6 or 6i) LabVIEW would give you an error if you tried to make two controls with the same name. Perhaps that was LabWindows/CVI.
    I don't know where the index is actually stored, but if you look at a property node linked to the Pane, you will see an array of references to the controls and indicators. Since the references are stored in an array, I assume that any local variables are tied to the index of that array. Since the labels themselves are properties of the control, I guess there's no reason to limit what that label is. They all have a unique index number.
    Interestingly, this array of references grows from the beginning. That is, any new control or indicator is put at index 0, not the end of the array.
    B-)
    Message Edited by LabViewGuruWannabe on 12-18-2007 08:45 PM
    Attachments:
    Labels.png ‏12 KB

  • Why does it take over two hours to download a movie on Apply tv

    Why does it take over two hours to download a  movie on Apple TV
    Thanks

    Welcome to the Apple Community.
    The first thing to check would be your internet download speed, you can do this at www.speedtest.net.
    1080p HD movies require a recommended speed of 8 Mbps, 720p HD movies require a recommended speed of 6 Mbps, while SD movies require a recommended speed of 2.5 Mbps.
    Netflix uses adaptive streaming and can reduce quality right down to produce a stream as low as 0.5 Mbps.

  • Why does Labview allow a cursor in a indicator?

    Hello,
        Why does Labview allow the user to position the cursor with the mouse inside a numeric indicator? Users think that just because they can put a cursor they should be able to type something and enter data. Is there a way to disable/stop the user from putting the cursor in a numeric indicator?
    Regards,
    Kaspar
    Solved!
    Go to Solution.

    Disabling the indicator satisfies your requirements, but this is funnier.  It would be even better if I calculated the position of the indicator and the "entry point" and just kept the mouse from entering, but I have a project to finish... 
    Message Edited by jcarmody on 03-27-2009 11:58 AM
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
    Attachments:
    move.png ‏4 KB
    test.vi ‏9 KB

  • Why does Adobe take over?  Part 2

    Why does Adobe take over Part 2:  I attempted to use  http://helpx.adobe.com/acrobat/kb/application-file-icons-change-acrobat.html  and on download got a box that said, Quitting     Raise without Handler!    
    Oh, and I had to uninstall the whole thing anyway just to be able to get to the Internet.  Any Adobe icon I hit tells me that there is nothing attached to it. 

    May be you can try other solutions mentioned in the link.

  • Why does it take over 2 hours to download a rented movie on apple tv? When I download a movie on Netflix it downloads immediately.

    Why does it take over 2 hours to download a rented movie on Apple TV?  When I download a movie from Netfix it is immediate.

    Welcome to the Apple Community.
    The first thing to check would be your internet download speed, you can do this at www.speedtest.net.
    1080p HD movies require a recommended speed of 8 Mbps, 720p HD movies require a recommended speed of 6 Mbps, while SD movies require a recommended speed of 2.5 Mbps.
    Netflix uses adaptive streaming and can reduce quality right down to produce a stream as low as 0.5 Mbps.

  • For Experts: Why does LabView cause System reboot while accessing hardware with driver?

    Hello NI Developers!
    I use LabView 7.1 under Windows XP
    I have a programm console application which accesses through Jungo Windriver PCI-E board.
    This program works fine - and performs DMA data transfer between PC and Board's memory.
    In order to implement this console application work together with LabView I did following:
    1) Added this function inside the source:
     _declspec(dllexport) void LVMainFunction(uInt32 *IntValue);
    _declspec(dllexport) void LVMainFunction(uInt32 *IntValue)
        AllocConsole();                   //Open new console window
        SetConsoleTitle(L"Debug Window"); //Set a title for console window
        freopen("CONOUT$","a+",stdout); //redirec standard output stream to current window so
                                        // so we are able to see "printf" outputs
       freopen("CONIN$","a+",stdin);    //redirec standard input stream to current window so
                                        // so we are able pass inputs from keyboard
       main();                          //Call applications main function which does all the work
    2) Compiled this new source as DLL library
    3) Call  LVMainFunction(...) function from LabView using Call Library Node
    In the result: Executing VI - opens new console window, shows debug outputs and receives keyboard inputs.
    It works fine till the last function, which perform DMA data transfer - and reboots PC.
    1) Why does this happen?
    2) I understand that opening console from Call Library Node, attaches together this console window and running VI. So If I close one of them - both windows closes.
         So does LabView have somekind of restrictions of accessing Hardware's functions? 
    I can read Board's resource information and view size of memory on board, interrupt functions and other information about device, but when I try to reach
    DMA my system reboots. And I understand that this should be some kind of LabView problem, cause I tried different implementations, even without use of
    console window - and the result is the same.
    3) Should I split the program in to two separate processes and perform data exchange using Sockets or Pipes techology?
    Thank you in advance!
    ACiDUser
    Message Edited by ACiDuser on 11-13-2008 09:37 AM

    Hello!
    At LAST!!!
    I solved this problem!
    From the beginning I was following National Instruments manual on how to build DLL with external IDE:
      http://zone.ni.com/reference/en-XX/help/371361A-01​/lvhowto/building_library_project/
    Set the Struct member alignment control to 1 Byte.
    Now this option caused my PC to reboot!
    So could someone explain  why this happened? and If it is a bad tip, so it's better to remove from manual. Then other people will not have such problems as I did
    - wasting 2 monthes of time determining the problem. 
    I changed it to  Set the Struct member alignment control to DEFAULT.
    and now everything works fine.
    Regards
    Message Edited by ACiDuser on 11-13-2008 11:14 AM

  • Why does LabView crash when unloading my DLL (reentrant calls)?

    I have written a DLL in Borland Delphi using multiple threads that exports several functions (stdcall). I am using LabVIEW 6i on a WinXP machine.  All functions in the DLL work as expected and return correct values. Everything works fine if I set all Call Library Function Nodes to 'UI-Thread', but as soon as I set one Function Node to 'Reentrant', LabView crashes when I close the VI after it has been executed. I assume the error is caused by the DLL unloading mechanism of LabView. Other C++/Delphi programs using the DLL reentrantly work fine, this only occurs in LabView. In which thread does LabView call FreeLibrary/DLL_PROCESS_DETACH? Has anyone experienced similar problems?

    I have never run into this situation myself, but I do know that calling a multi-threaded DLL or CIN from LabVIEW does depend upon the following criteria:
    If your CIN/DLL doesn't have any global data storage (global variables, files on disk, etc.), AND it doesn't access any hardware (register-level programming) AND it doesn't call any functions/DLLs/Drivers that are thread-unsafe.
    OR
    Your CIN/DLL protects (with semaphores or mutex's) access to those global resources.
    OR
    Your DLL is only called from one, non-reentrant VI
    OR
    Your CIN is only called from one, non-reentrant VI AND you don't access any global resources from CINInit, CINAbort, CINDispose, etc. procedures.
    Hopefully this information can help you out in some way.
    J.R. Allen

  • Why does rmid execute the command it executed before

    I ran rmid,
    C:\Documents and Settings\zhengda>rmid -J-Dsun.rmi.activation.execPolicy=none -J-Dsun.rmi.activation.execTimeout=120000 -J-Dsun.rmi.server.activation.debugExec=true
    Then I did nothing but waited. Some moments later, I found rmid started to execute the command it had executed.
    rmid: debugExec: running "D:\j2sdk1.4.2_08\jre\bin\java -cp D:\jini1_2_1_002\lib\reggie.jar -Djava.security.policy=D:\jini1_2_1_002\policy\policy.all -Djava.rmi.server.codebase=http://222.205.9.198:8080/reggie-dl.jar cun.rmi.server.ActivationGroupInit"
    It is quite strange. Does rmid record the commands it has executed? And where does it record?

    Yes, it keeps a log of everything you have registered for activation, in accordance with its specification, in its log/ directory I believe. It's serialized and not human-readable.

  • Why does labview close whilst my program is running?

    I am running a program doing data acquisition using the PCI-6602 cards. Everything works fine but somehow after I have been doing acqusition and saving the data for approximately 2 days, I find out that the program has been stopped by LabVIEW and find all the windows closed including labVIEW. In my program I did not use any of the exit functions provided with LabVIEW but somehow, labVIEW exits by itself without issuing any error messages. Why is this happening?

    I experienced a problem with LabVIEW 7.0 shutting down unexpectedly.  It may be completely unrelated, but I thought I'd mention it just in case.  My problem was that I was calling a DLL that used a reference handle.  At the end of my test (using TestStand), the test closed, and thus the DLL was unloaded from memory as well.  Because there was still a handle open to this DLL, LabVIEW must not have known how to handle this and shut down (or it confused Windows and it shut down LabVIEW).  In any case, the solution was to have a VI stay in memory which calls this DLL, and put the DLL in a the true case of a case statement wired with a constant false.  Thus, the DLL is never actually called by this VI, but it keeps the DLL in memory.
    So if you call any VIs dynamically, etc., where a VI could be unloaded from memory, check those VIs and make sure you aren't leaving any references open or something like that.
    Hope this is in some way helpful.
    Tom

  • Why does the Ni-Motion Torque-Control Program give me such an oscillation???

    Hello,
    I really hope to find somee help here...I have a UMI-7744 and I would like to do force control for a servo motor. I have tried the NI-Motion example "Torque Cntrl Using Monitoring Force"...it seems to be quite easy - it constantly measures the current force and compares the ADC-values with the target force. The difference between the two is then new relativ position...
    When I test it with an actuator that does not touch the workpiece (current force==>0N) and then tell it to apply 50N (ADC-value of ~1000) then of course it starts moving towards the workpiece, but then overshoots quite significantly when it touches it, then undershoots, then overshoots, then undershoots....etc....
     (1) Apart from the big overshoot, I would have assumed that the failure decreases over time and the force will be maintained at some point, but the actuator keeps on oscilating around the target force with quite high amplitudes.......does any body have an idea for the reason?????....How is it possible that the controller actually approaches the target force, ie. the over/undershoot should get smaller with every cycle...
     (2) I was assuming that the problem is because I load quite large relative positions (1000 - 0 = 1000) while the actuator is not yet in contact with the workpiece which then causes the overshoot when the actuator touches the workpiece. Hence, I tried limiting the relative positions to +/- 100, but it seems that it does not improve anything. The actuator still never maintains a steady force.Any idea, why limiting the relative positions does not have an effect on the oscillation??
    (3) I have seen that the use a delay of 50ms. Hence every 50ms a new target position is loaded. Is there any experience of what the BEST time delay is for motion control???? Is it better to decrease the delay to adjust the relative position more often OR would this have negative effects because the moves don;t have enough time to complete??????
    I am grateful for any reply...

    Hi Jochen,
    thanks for the clarification on the pros and cons of the two Torque control approaches...very enlightening......
    To clarify my previous question: I am using the S200VTS-Servo Drive from Danaher Motion. The drive is able to run in Torque-mode, Velocity-mode and Position-mode. In the latter case it needs a "step and direction" input, instead of an analog input. My idea was to setup the S200-drive in Position-mode because in the "Torque Control using monitoring Force"-example the inner PID loop is for the position...so I thought, why shall I setup the S200-drive in torque mode, when actually the PID-loop tries to control the Position.....you know what I mean? It appeared to me, that with setting up the drive in torque mode and running the example code with the positional PID-loop I am mixing force and position....
    Kind regards and thanks a lot for your efforts.
    Well, let's take it like that: The second approach is ok, if the dynamics of the torque are very low. The worst case scenario for this approach is a solid actuator pressing against a solid workpiece. When these two pieces meet, a force occurrs almost instantaneously. That means, that very short move distances result in high force differences. With your current approach this means that it's very hard to control the force, as in fact the only way to generate force is to move the axis a bit. If you control the force directly instead (analog feedback), you will get a much better control behavior.
    To clarify the idea behind that:
    Just think of two metal plates lying on each other on the floor. Now you step on the upper metal plate. Does the upper metal plate move? No. Is there a change of the force applied to the lower plate? Yes.
    To summarize: 'Torque Control using monitoring force' works best in systems with very low dynamics and a soft contact between actuator and workpiece. still all the limitations that I have mentioned in my first post are true, so I strongly recommend to use analog force feedback.
    Your last statement about running the motor in position or torque mode is not clear to me. Are you referring to operation modes of your drive (by the way, which drive are you using?). In this case the clear recommendation is to configure your drive always in torque mode, regardless of the type of control provided by the 73xx device that you are using. From a drive's point of view 'torque mode' means, that the analog input voltage (command input) is converted into a proportional current signal and that's in both modes the best option.
    Jochen

  • Why does the Illustrator "trap" command trap the same spot colors in opposite ways?

    I can not understand how Illustrator decides which way to expand something when using the "trap" command. According to their tutorial it expands the lighter-colored artwork over the darker artwork, unless you choose to reverse traps. But in practise, where two objects of the same color meet, it will frequenrly trap them in one direction in one place and the opposite direction in the other.
    Here's an example with especially large traps:
    The two yellow items are defined as the same spot color and are a single compound path. There is just the one simple shape of spot red and one simple shape of spot pink.
    On the left yellow object, it expands yellow over pink. On the right, it expands pink over yellow. On the left yellow object, it expands red over yellow. On the right, it expands yellow over red.
    There is no possible print order of these three spot colors that would result in the correct object shapes being printed the way this is trapped. Is this just a bug? Can anyone explain this result, or especially how to make it work in a useable way?
    All objects are spot colors that are cut out from each other so there were no overlaps.

    Here's what it looks like with overprint preview:
    It still looks wrong.
    This view is glossing over how bad it would really look with screen printing, because the inks are much higher opacity than they're previewing here. I suppose that's what you're getting at, that the trapping may be bad for screen printing, but if you're assuming offset press inks that have next to no opacity and will mix together on press, that it doesn't matter which way you trap. Overprint preview makes yellow overprinting pink look the same as pink overprinting yellow. With spot colors in screen printing, that is no where near the case.
    But even consdiering that, this trapping is wrong, the final shapes of the objects are changed by the trapping. And the trapping does not appear to follow Adobe's own description of the logic used, or any kind of consistency. Why would it expand yellow into pink in some places and pink into yellow in others?
    I've heard the trapping in Indesign is much better, some screen printers open in Indesign to add trapping... maybe I'll look at that.

  • Why does Labview hang when switching from one TestStand application to another?

    I have several 2013 TestStand applications that use a number of LabView 2013 VIs on a test computer.  When the operator closes one TestStand program and opens another often Labview does not close properly and so when TestStand tries to load the LabView VIs it hangs or just runs and every test that is affected by LabView fails.  The only potential issues that I know about are that two of the applications were created in LabView 2009 and then updated to 2013.  Then two other TestStand applications that were created in 2013 use the function "UnloadAllModules". 
    Are there any known issues with LabView 2013 that cause this or any ideas of what I might be doing wrong?
    Solved!
    Go to Solution.

    Hello Michael,
    I did find my issue.  In my case a VI was not getting closed properly in cleanup due to the previous command not passing the handler out correctly.  Thus this VI would remain open and when I ran another TestStand Sequence, when it tried to load that LabView VI it would just hang.  But the result of this error could be seen when I closed TestStand and LabView stayed open (since it was frozen) or when done running the sequence and closing it.  Then if you tried to pop-up LabView it would not show the starting splash screen because it had froze.
    I found the problem by turning on the show VI front panel option in TestStand for all of the VI calls.  The VI that stayed open was the problem VI.
    Thanks everyone who responded for your help!
    Kurtus

Maybe you are looking for