Jump to content

crossrulz

Members
  • Posts

    541
  • Joined

  • Last visited

  • Days Won

    23

Everything posted by crossrulz

  1. QUOTE (Tim_S @ Mar 19 2009, 08:56 AM) GVA - Global Variable Anonymous. I like it. I have somehow been global free for 3 years. But are functional globals just a crutch or are they actually better to use? Hmm...
  2. Cat, I'm with SULLutions when it comes to the LV2 global variable. His VI is too old for me to read (in 5.1, I am now down to only 8.6), but I made a VI with similar functionality. I saved it in LV8.0, so hopefully everybody can read it. Download File:post-11268-1237404447.vi But still, don't feel bad for using a global variable. They are there for a reason, and I think this was one of them. SULLutions, Can you repost a newer version of your abort vi? I'd just like to see how you handled it.
  3. The LV Intermediate I course has a really good example of this using Queues.
  4. I would just put the terminal of the boolean inside the "Value Change" event. That is the only one you should ever care about resetting the boolean. None of the other events should care about the state of the boolean. Now if you are using mulitple event structures, the changed value event will register for all event structures with that "Value Change" event. Therefore, it doesn't matter which event structure you put the terminal in. As soon as that terminal is read, the latch will reset. For instance, in the picture below, when the stop button is pressed both event structures will tell their respective while loops to stop. The top loop will reset the latch value of the stop button.
  5. I even went as far as creating a VI that I put in my user library. I use this one all the time. This VI is in LV 8.6
  6. You can download drivers from the NI website. Try this link for your HP8110. If you don't like these, then you need to lookup the SCPI commands and create VIs that will build up the commands and send them over the GPIB bus.
  7. OpenG has a good wait function that uses an Occurance if you'd rather not code it up yourself. I'd say the event structure would be the next easiest way to go.
  8. I did something similar when I first downloaded LV8.6. Quite frankly, I agree that the cleanup tool actually made my VIs look worse. Then again, I try to make my code look really clean in the first place. I think the real problem is that you can't really set concrete rules when it comes to LV code. Sometimes you have to give on one rule for the sake of readability and/or performance. So I simply just ignore that feature. Though, I have some real BAD speghetti code that I inherited. I should try it sometime. As a side note, the only new feature I like in 8.6 is being able to alter the properties of multiple objects at once. That will save me hours of work in the near future.
  9. schneidley, I think this will work for you. I used two shared variables to start and stop the two parallel processes. You could also use globals. Just make sure you initialize these variables very first thing in your program. If you are passing read data between the two processes, I would highly recommend using queues.
  10. QUOTE (Brian B @ Jul 24 2008, 01:02 PM) Sorry. I should have looked at what versions you had. I just did a save for version 8.0.
  11. Your problem (at least in this example) is that the global variable is only being written to immediately coming into the loop. The loop is then dominated by the subVI. Therefore the global to exit the subVI will never be written to again. The following recommendation is only for GUI stop commands, but it might lead to other ideas for your specific situation. Use another loop with an Event Structure in it. Set an event to "Stop" value changing and then write the new value to the global variable. This will then end the subVI. As long as you don't have a Timeout event case, the event structure uses no cpu cycles until a registered event happens, so performance issues are nonexistant. My edited code for the top level VI is attached.
  12. If I set up Data Binding on an indicator to a network shared variable, how often is the indicator updated? I am using LV 8.5 with the RT module. I am trying to get updates from the RT target to show up on the Windows computer. I would prefer not to constantly poll the shared variables if possible. We don't have the DSC module, so I can't use event structures to update that way. What I am hoping is that the data binding updates is event driven and therefore making it a lot more efficient than the polling I am currently doing.
×
×
  • Create New...

Important Information

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