Jump to content
ASalcedo

Close program ordely

Recommended Posts

Hello to all.

I would like to know how I can close my program ordely.

I mean... I have 4 whiles in my program so when user clicks a "stop" botton close ordely: while 1 and when it is finished then close while 2 then close while 3....

How can I do that just with a stop botton?

Thanks a lot.

Share this post


Link to post
Share on other sites

Need to see the code, but I suspect a few local variables, or some communication scheme between loops would work.  Have you looked into Channel Wires?  This could also be used to facilitate communication between loops.

Share this post


Link to post
Share on other sites
18 hours ago, hooovahh said:

Need to see the code, but I suspect a few local variables, or some communication scheme between loops would work.  Have you looked into Channel Wires?  This could also be used to facilitate communication between loops.

That is new in Labview 2016 right? I am gonna have a look.

Thanks!

Share this post


Link to post
Share on other sites

Yes Channel Wires existed in a semi-beta state in 2015 but are official in 2016.  Go to Help >> Find Examples and you'll find lots of examples showing the different types of Channel Wires and explaining how they can be used for communication between loops.

Share this post


Link to post
Share on other sites

Just wanted to point out the excellent NI KB on this subject here.  It covers channel wires, locals, queues, notifiers and more.  I personally use notifiers (unless I have an event structure) and have never had an issue with them.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Similar Content

    • By Llisas
      Hi all, 
       
      I have an error that doesn't affect the functionality of my program, so for the moment I'm just ignoring it, but anyway I would like to know what is its cause and how can I solve it, or if it's safe to ignore it.
       
      I have a program that makes some tests and stores the data in some clusters, and then when the job is done it writes everything in a database. Then it asks if you want to start another job or end the program. Up to there everything works perfect. But if you choose to start another job without closing the program, after you complete it there's an error at the end of the database writing. The error is this:
       
      Error 505 occurred at NI_Database_API.lvlib:DB Tools Close Connection.vi->Escritura DB.vi->Interfaz Principal.vi
       
      Possible Reason: Open Command Object.
        ADO Error: 0x000001F9   As you can see in the attached image, in my database writing subVI I only open connection, use two "Insert Data" blocks and then close connection. I don't have any command references to use the Free Object block, so I don't know what's wrong.
       
      Thanks in advance for any help. 
       

    • By rasmusvt
      Hi everyone!
       
      I am currently designing a lab setup, where I need to take measurements from two devices simultaneously. I am dependent on polling one of the devices (a 1-axis stepper) for its position, while the other is a simple readout from a DAQ-board.
       
      My problem comes in the form of a low sampling rate. I have included a control that (is supposed to) enable users to set the sampling rate. I then pass the reciporcal of this as the argument for a time delay within a while loop that takes one measurement (polls the stepper and reads a single value from the DAQ board and writes to a spreadsheet file). However, the sampling rate is quite limited, and over the course of 15 seconds, it takes about 600 samples when setting the sampling rate to 1000 S/s. This doesn't seem to change when setting the sampling rate to other values.
       
      Does anyone recognize an obvious limitation to my way of implementing this? Am I using the timer wrong? Is there an obviously better way of implementing this?
       
      Thank you!
       
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.