event structure help, basic execution

This is a discussion on event structure help, basic execution within the labview forums in Programming Languages category; Hello, I am a new user of the event structure and have a very basic question. I am trying to write a program to control some GPIB power supplies that executes intial user settings (voltage, current limit, etc.) a single instance before stepping into an event structure.  Once inside the event structure, the timeout event will be infinite, and the program will only update when there is a change to any of the front panel controls. The problem with my current approach is that I am rewriting the same code twice. Once, before stepping into the event structure, and a second time when the ...

Go Back   Application Development Forum > Programming Languages > labview

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-15-2008, 07:10 PM
Newbie217
Guest
 
Default event structure help, basic execution

Hello, I am a new user of the event structure and have a very basic question. I am trying to write a program to control some GPIB power supplies that executes intial user settings (voltage, current limit, etc.) a single instance before stepping into an event structure.  Once inside the event structure, the timeout event will be infinite, and the program will only update when there is a change to any of the front panel controls. The problem with my current approach is that I am rewriting the same code twice. Once, before stepping into the event structure, and a second time when the user front panel controls change. Is there a way to incorporate the initial code to execute only a single time in the event structure shell? If so, how do I go about doing that? I don't want to put it in the timeout event because I would like to avoid having the program refresh itself unless a front panel control changes. But I do need that single intial execution. Any help is appreciated. Thanks!
Reply With Quote
  #2  
Old 08-15-2008, 07:10 PM
altenbach
Guest
 
Default Re: event structure help, basic execution

You can do one of the following teachinques: - First create an event for your main value changes and also assing the timeout to it. - Place the timeout in a shift register initialized with zero and wire -a (=infinite) to the shift regsiter on the right. It will timeoutonce and then never again.
- Use "Select" and wire =0 to the iteration terminal. Pick 0 for i=0 and -1 otherwise and wire the output to the timout terminal of the event structure.

- Don't even use a timeout event, but use a value(sgnl) property write before the loop to trigger the main event with it. This way it will fire immediately after the event structure is ready for the first time. As a side effect, you can even bring the control to a defined state.
 See how far you get.
Reply With Quote
  #3  
Old 08-15-2008, 07:40 PM
Eugen Graf
Guest
 
Default Re: event structure help, basic execution

 Place your whole initialisation step into a SubVI and call them before the event structure and even in the appropriate event case.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 06:34 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.