While loop stuck in LabVIEW when VI called by TestStand only

LabVIEW 8.5, TestStand 4.0, Windows XP-SP3
The issue I’m facing is a different behavior of a LabVIEW VI whether it is called independently (in the LabVIEW environment: normal behavior) or from TestStand (unexpected behavior).
In the same VI, I've wired in parallel, so they can execute in parallel:
a call through “System Exec”, to a program which prompts for a user's answer. The case I’m concerned is when the answer will never come...
a while loop, managing a timeout which finally kills the program above when it waits infinitely for a user's answer
Just to be more precise for those who’d try reproducing the issue (but you might just have a look at the enclosed VI): in my case the program is the command line WinSCP.com. WinSCP prompts when it wants you to accept the host’s private key which is not in its cache. Don’t be afraid if you’re not used to WinSCP, the concern here is LabVIEW + TestStand.
What happens when we’re stuck in the “System Exec”:
under LabVIEW: it works fine, as expected; while stuck in the “System Exec”, the while loop executes in parallel
when the same VI is called in a TestStand sequence step (ActiveX automation server to the LVdevelopment system), it does not run the while loop (we're stuck in both System Exec and inside the loop). The only way to release everything is to manually kill the program called by the System Exec through Windows Task Manager.
For information, all tasks: TestStand (SeqEdit), LabVIEW and program (WinSCP) show 0% CPU and their memory usage is stable.
Have you an explanation for this unexpected / different behavior of the VI, only because it is called from TestStand?
Enclosed is the VI.
If you actually want running it, you might have WinSCP installed and a valid session to an accessible host (adapt path to WinSCP and session name), and do not put the host key in the cache!
Note: you won't see the same issue with other programs or commands called by System Exec (e.g. netsh, ftp...) even if they await a user's prompt.
Thanks for your help!
Solved!
Go to Solution.
Attachments:
CheckLabVIEWLock.vi ‏26 KB

Have you tried changing the Preferred Execution System of the VI from 'same as caller' to 'other1'.
Regards
Ray Farmer

Similar Messages

  • How do I create a start/stop button for each separate while loop within my program, when each of them does a different task?

    I have a multimeter VI with separate while loops to accomplish the different tasks of reading  voltage, current, etc. Each while loop has a stop button, but I need a button that will have to be pressed in order for the while loop to even start. I tried putting another while loop around the present one, but it still has to run once before it will stop. I want the user to have to press the button before it runs, because they interfere with each other.
    I am just learning so patience and your kind assistance is greatly appreciated!
    ElectroKate

    iZACHdx wrote:
    Hello,
    I'm not entirely clear with everything you have going on and what you want your final functionality to be, but you can use sequence structures to prevent a loop from starting until the user presses a button like this:
    -Zach
    I have to ask, why is an NI employee using examples using sequence frames? The same thing could be accomplished using data flow by simply wiring the value of the first stop button out of teh first while loop and connecting it to the second loop. This would then use data flow to control the sequence. Why show new users bad programming methods?
    As to the original question I would concur with altenbach on using an event structure.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • How to avoid launching Labview when invoking VI by Teststand

    Hi, friends.
    I'm a learner of teststand. I wrote some VIs by Labview. Now I want to invoke them in teststand environment. But when I run the sequence. Labview will be automatically launched. How to avoid launching Labview when I run the sequence?
    Thanks.
    Solved!
    Go to Solution.

    I'm not sure that I follow what you are saying..  But it sounds like when the VI is called, the LabVIEW development software is started and you want to avoid that.
    If you create an executable or dll and call that from within TestStand, it should not call the development environment.  You would need to have the LabVIEW run-time engine installed on the target PC. 
    It has been many years since I've used TestStand with LV, so my memory may not be accurate.  I think the above had worked for me.  However, it seems that I recall something about having the LV code in debug mode causing it to open the development environment.... but it's a distant memory.    You're not using breakpoints where the LV VI is being called, are you?
    R

  • TS4148 Why cant my stored names appear on screen when they call but rather only numbers

    why cant my stored names appear on screen when they call
    no sim icon seen on my phone

    For names to appear on the screen of the phone when calls are received, the carrier has to support caller ID, and the caller ID information has to match what is saved in the contact exactly. If this is not working, you will not see the name.
    Not sure what you are asking regarding SIM icon.

  • BUG (?) with simple while loop in LV2011

    Hello all,
    I have found a very strange behaviour in LV2011: A While Loop is not executed when running as EXE (in Development Environment it works)
    While Loop:
    (OK, its not the best way to check if button was pressed, but the WHILE Loop itself should be executed)
    How to reproduce:
    1. download attached file
    2. open built EXE file
    3. Look at numeric indicator. At my PC, the values are not increased->this means: while loop is not running
    4. Open Project (lvproj)  (I hope I havent forgotten anything)
    5. Start running the VI from whithin LabView (debug) -> now it should run
    6. Try to build EXE
    7. Try with new EXE. Still not executed While Loop?
    BTW: I have saved the code for LV2010. There it is running. Strange.
    Thanks
    Eugen Wiebe
    Bernstein AG
    CLAD - Certified LabView Associate Developer
    Attachments:
    Project.zip ‏1253 KB

    Norbert_B wrote:
    I concur that this is unexpected behavior, but having dead code in the VI is always a bad idea.
    If this issue occurs with other code segments comparable to this (having dead code within case structures), i concur that it is a bug. ... 
    hope this helps,
    Norbert
    Hi Norbert,
    I'm hair-splitting as normal.
    Re Dead code
    Please cite a reference.
    1) There is an old school of thought that code should never be removed only replaced with a new version. This allows quickly switching back to the old version if the new version seems wacky.
    2) Diagram disable is new and we used to use a boolean to disable old code. Apperently there is some noob loose in R&D that never imagined anyone would use a constant and this bug fell through the testing cracks. I have recently logged a call >>> CAR about a case with a constant preventing a build.
    3) THe useage of a boolean constant to disable a code segment was knowan at one time becuase there was mutation code imlemented to convert constant to controls when open in a new version.
    4) A diagram disable will force an ignore of the code in the disabled state. A constant driven case did NOT have that behaviour and we used to use it to ensure dynamic VI's were included in VIs.
    So please cite the reference that I apperently missed.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to stop while loop

    I can't figure out how to stop a while loop in my labview program. 
    When the user presses the Run arrow in the toolbar I want my program to begin reading the serial port for GPS messages.  These messages should be displayed on the front panel.  Currently I have this read/display in a while loop.  The program is also waiting for an extrenal trigger.  When that trigger arrives, I want to grab the current string from the serial port and save it and continue reading and displaying the serial/gps string.  This trigger starts the other parts of the program- signal generation, recording, and saving data which need to run concurrently with the serial/gps reading/displaying.  Once the AO and AI have finished and the data have been written to disk, I want the program to stop.  The serial/gps messages should be updating this whole time.  Only when the data are written to disk should the whole program end.  This whole sequence of events should only be done once when the user preses the Run arrow. 
    So far I'm unable to pluck the serial string when the trigger comes in if I'm watching the serial port all the time.  The program also doesn't stop when it finishes writing to disk because the read serial while loop is still running.  I don't want to use a front panel stop button.  The program should stop itself when the data havebeen written. 
    I'm really stumped on this one but I'm new to LabVIEW so I'm sure there's an easy solution to this. 
    Thanks for any and all help. 
    Attachments:
    SPoleLakeChirp.vi ‏199 KB

    Dennis and altenbach-  Thank you both for your patience. 
    I was trying to do just what Dennis suggested-"As I said, setting a local variable is one way." even before posting to this forum, but I couldn't get my local variables to reflect changes made elsewhere in the program and I wasn't able to wire from them because they were writes.  The critical part I was missing was how to change a local variable from a write to a read.  It was staring me in the face the whole time- just right click.  When I finally found it, my problems were solved. 
    altenbach- thank's for putting the figures together.  I do understand the logic and wiring there, but I was really trying to avoid stop buttons.  The program should be smart enough to figure out when to stop.  And using local variables turns out to be one way of solving this.  I still have some clean up to do, but I've included my current working version just so you can see how I implimented your suggestions.  There's still a lot of clean up to be done, but I'm delighted to be able to watch the serial/gps messages until I'm done reading in data.  At first I had this stop variable set in the final sequence frame.  That didn't work because I wasn't getting to the final frame because the loop wasn't finishing.  Once I placed the stop variable in the same frame as the while loop it began stopping when it should. 
    If you have other comments/critiques about the wiring diagram I'm earger to hear them.  I'm considering the structure finished, however.  It still needs cleaning up and commenting, but I'm satisfied with the functionality. 
    Thanks,
    Peter
    Attachments:
    SPoleLakeChirp.vi ‏210 KB

  • While loop and for loop condition terminal

    Hello friends,
    I am using labview 8.6. The condition terminal of the while loop and conditional for loop is behaving in just the opposite way.
    When i wire a true to the condition terminal of my loop, the while loop continues to run when I click on run. when I wire a FALSE, it stops.
    Is there any setting change that I have to make it to get it work properly.
    Please suggest on this.
    Thanks and regards,
    Herok

    Please do NOT attach .bmp images with the extension changed to .jpg to circumvent the forum filters!
    Herok wrote:
    I am sending you the VI. I am not sure if this would help you because only in 2 computers this behaviour is seen. In others, it works as it is supposed to work.
    Whatever you are seeing must be due to some corruption or folding error. It all works fine here.
    To make sure there are no hidden objects, simply press the cleanup button which would reveal any extra stuff (which is obviously not there). Does it fix itself if you click the termination terminal an even number of times? What if you remove the bad loop and create a new one?
    Could it be you have some problems with the graphics card and the icon of the conditional terminal does not update correctly?
    Whay happens if you connect a control instead of a diagram constant?
    What is different on the computers where it acts incorrectly (different CPU (brand, model), #of cores, etc.) 
    LabVIEW Champion . Do more with less code and in less time .

  • Outputting sine wave to motor -- While loop placement?

    I'm having trouble creating a basic Labview program to drive a motor with a sine wave. I'd like to output one sine wave at a time to my motor and look at the response to eventually get a Bode plot. I'm using the Sine waveform VI and I've got a PXI-7358 controller card.
    I'm having trouble figuring out what goes in the while loop. I'd like to output, for example, a 10Hz sine wave to my motor. But when I create a VI as shown below (& attached), my output waveform frequency is nowhere near my input frequency. When I type 10Hz I get no movement out. At 10.01 Hz input the motor oscillates at a few Hz, and at 10.1Hz input the motor oscillates wildly. I don't think it's a problem with my motor or my PID settings, because even when I eliminate the motor commands altogether (second figure below), I get the same unpredictable relation between the frequency I type in and the Waveform graph.
    It seems that the output waveform depends on some sort of difference between the while loop execution rate and the PXI-7358 command generation rate. It seems to me that the Sine Waveform.vi should be outside the while loop, but in that case the Load Position.flx only seems to grab one position. Is there a good way to have direct control over output frequency of the sine wave?
    Attachments:
    one_axis_move11.vi ‏20 KB
    one_axis_move12.vi ‏12 KB

    matthewg,
      Dennis is right, let’s keep this to one forum since it is the same topic of discussion, and I will address some of the issues with your code there.
    Chris_G
    Sr Test Engineer
    Medtronic, Inc.

  • Stop and start while loop on order

    Hallo everyone,
    I have this small IV, it means nothing but I want to know if it's possible to control each while loop. what I wish to do is to press the boolean button, then the while loop starts running and when i press it again the loop stops but when I press it again it works again, not that the program stops running at all. not only that but I need it for both loops. so i run one and stop the other then stop one and run the other and so on...
    I dont know if this is possible and its not necessary to be done with loops, I just wrote loops because this is what I can do and understand, if there are any other possibilities then please feel free to share it with me.
    Attachments:
    Unbenannt 3.vi ‏178 KB

    pcardinale wrote:
    Perhaps something like this.
    I don't think we need to involve such a huge amount of code and new concepts (timed loop, notifiers, subVIs, clusters, arrays, event structures, etc.),  to solve such a simple problem. (This might turn off a beginner!).
    Here's what I would do.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    TwoCharts.png ‏14 KB
    Unbenannt 3Mod.vi ‏17 KB

  • Starting new while loop while old one still running

    Hi!
    I am attempting to write video images to AVI files. I want to give the user the option to decide when they want to begin to capture the images. I place the "start recording" button in one loop and the image acquisition and AVI Write subVIs in another loop. LabVIEW won't allow me to continue on with the image acquisition loop until I finish with the "start recording" loop. Any ideas how to fix this (to allow the image acquisition to start and continue having LabVIEW check for a button press on "start recording")?
    Attachments:
    Capture_and_Save_as_AVI.vi ‏177 KB

    Thanks. I suspected as much. In any event, I can't seem to find a good configuration of while loops and case structures which will produce the desired results. I want to start acquiring images and allow the user to choose to start recording at any time he desires. This issue is further complicated by the fact that the status of the "Start recording" must be checked at all times, but only initialized once, while the AVI Write Frame depends on that first initialization step but must be looped continuously aferwards in order to 'keep up' with the images being acquired. In the newly attached example, I placed the case structure inside the image acquisition while loop and the avi write frame inside a while loop inside of that case structure. unfortunately,
    labview decides to stay inside the avi write frame while loop after entering, instead of returning to the image acquisition while loop. i can't place the avi write frame inside the general image acquisition while loop because then labview will think i want to initialize the avi write frame right away and will return an error when avi write frame isn't provided with an avi refnum. Ideas?
    Attachments:
    Capture_and_Save_as_AVI.vi ‏174 KB

  • What happens to the while loop iteration counter if it runs unchecked?

    I want to use the iteration counter to initialise a value on the first loop of a while statement. ie i = 0, x = 100. Fine. The application I am building will be left to run for weeks or months on end without stopping (hopefully :¬)). What happens to the iteration counter in this situation? Does it reset to 0 or what? I don't want it reinitialising any values while the loop is running other than when it starts.
    I set up a while loop to try to figure out what happens and the iteration counter stops at 2147483648 which is 2^31 - 1.
    Any help would be appreciated,
    Thanks,
    Niel.

    It might be something you already looked at, but perhaps it's an option to perform the initialization outside (before) the while loop. That way it will be initialized correctly only once, no matter what the iteration counter does.
    Of course if you need the counter for other purposes than initialization you might have the same problem...
    Note that a lot of the timer functions also overflow after a certain time (I believe 24 or 48 days?) so be careful running very long loops (but you already knew that probably).

  • How to pass a value from inside a while loop outside the loop

    Hello to everybody, I have been searching through the forum but I have not found a certain answer for my problem. I would try to explain my problem as breefly as posible:
    I have to send by a BNC2120 two signals and acquire an other one thats comes from a preassure sensor. That part is done by introducing simulating and acquiring DAQmx inside while loops.It is sycronized by my self, proving such diferent values (is not the optimum, but is only the first prototype) and works as I expected. Well, then I want to sample some of the values of these signals, that is done with relays and local variables to get the value in the instant I want to sample. Here begin my problems: I want to extract the sample values out of the while loops without restarting them, I mean: I do not want to stop the while loops because the acquisition and the generation of the signal must be continuous, but I do not know if it is posible to put the while loops in "standby" until I operate with the values I have sampled and then the signal generator and the acquiere continues from when it has stoped before. Particulary I want to obtain the value of the top while loop (inside a case) when the counter arrives at 15.
    I have proved to do with local variables, global variables, making a state machine, with event cases, with flat secuences...I have been reading about and proving diferent posible solutions for this week and the whole past week and I have not found the solution.
    If any of you know how I can do this thing, I would be loved to listen your opinions. My proyect is above: 
    Thank you a lot in advance.
    Sinceresly,
    Miguel.
    Attachments:
    maq_estados_event_case.vi ‏239 KB

    It definately sounds like what you really want is a Producer/Consumer.  It is an architecture that uses Queues to pass data from a data generation loop (producter, your DAQ loop) and a data processor (consumer).
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How do you get a contact's photo to show full-screen when they call?

    A friend sees a large full-screen photo of some of his contacts when they call. I only see a small round circle with the name next to it? Is there a setting that makes this happen? Both of us on 5c iPhones with OS 8.

    Thanks, RobinD.
    I've just  solved it through Apple, but want to share the answer for others. Even with ALL of the near-seamless syncing between my Mac, iPad and iPhone, the only way you get a full screen photo of the person calling your iPhone is if you've assigned a photo ON YOUR PHONE to that contact in your iPhone's contacts app. Doesn't matter that Mac's "contacts" already has a photo that you assigned there before. That photo will only show up as the small round mugshot next to the caller ID UNLESS you duplicate the action of assigning the contact with another photo that's in your phone's collection of shots to the contact's listing in iPhone's "Contacts" app.

  • When people call my phone it only rings once and then goes silent until voicemail picks up?

    Is anyone having a problem with their voicemail on Iphone 4s.  When people call me it only rings once on their end and then goes silent until my voicemail picks up?

    Then get your iPhone checked out by an Apple Genius.. Or you can go online and Apple will check out your iPhone with an App sent via email.............

  • My contacts don't show up when people call

    I reset the settings on my iPhone 4s and now my contact names don't show up when people call. It only shows the number, but they are still listed in the contact list. Does anyone know how to fix this?

    Which phone do you have ?
    This happens when there are multiple entries with the same phone no.
    Also if the same contacts are stored on SIM and in Phone memory also and you have selected to show contacts from both these destinations..
    In contacts-->Options-->settings.. contacts to display.. select preferably the Phone memory only.. Also save the contacts to Phone memory to get better functionality of the phone book.. There are many limitations of storing contacts on SIM.. Periodically take back-up on PC to avoid unforeseen problems with your device..
    --------------------------------------------------​--------------------------------------------------------​--------------------------------------------------​--If you find this helpful, pl. hit the White Star in Green Box...

Maybe you are looking for

  • Won't reboot from install disk

    i can't boot from a bootable disk (my install disk or norton). i'll hold down the c button just like i've always been able to do before, but it goes straight to the login page, instead of starting up from the disk. if i try and go into account settin

  • Re installed photoshop CS5 onto new computer & now plug ins won't work?

    I recently bought a new computer & re-installed photoshop CS5.1 successfully, but can't get the plug ins to work (phototools 2.5 & perfect effects 3, which were a free download with purchase). I am running windows 7 64bit. I copied & pasted them into

  • How to export Apple Mail Email Addresses..

    I am going about an email-gathering process in order to analyze addresses I want to use for future marketing. One resource of qualified leads is my 5 year old Gmail account which has all my correspondence 'banked' - so I want to extract and put into

  • Problem with controller.

    hi all i have defined two contollers for two different regions region1 and region 2 in my page under pageLayout region. but when i press submit button in region2 , then control goes to both the controller . i m very confused .it should go to the cont

  • How display images stored in cell pohne with camera?

    Hi, I would like to display pictures taken by camera in cell phone. Example: I take picture by my camera in cell pohne and when I run my midlet I may watch all pictures from my camera? How API or package help me in this? How path may I write in midle