Jump to content

Mark Balla

Moderators
  • Posts

    607
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Mark Balla

  1. I am upgrading my program helper tool and would like it to be able to detect what the name of the active widow is. I initially tried the Active VI property node but it will only update the output string if something is selected which isn't always the case. I've also tried the Open G Find VI with Focus.vi but it will only update the name string if the Front Panel is selected and not the Block Diagram. Is there a windows API dll call or another VI that can tell me the name of the active window?
  2. Nice tool but I would like to change a few things so it will fit better with my personal tools. Why is the Diagram is Locked?
  3. Scooter! hmm...... maybe I should change my avatar
  4. To modify a subvi dynamically you need to disconnect the input terminal from the connector pane. When a subvi is called all input values that are connected to the connector pane will be set to the incomming value or the default value. Here is a quick example.
  5. Why not give your subvi two inputs a string and an Enum. If the String is empty use the Enum and convert otherwise use the String input. Polymorphic vis might be a solution too.
  6. Sorry I posted demo vi and not the llb. Thanks to Guillaume Lessard for pointing it out to me Download File:post-584-1142916971.llb
  7. For a decent size class there will be many public function using the same data cluster. The locking insures that only one public vi at a time may change the data. This is more apparent when using classes or even functional globals in multiple while loops. The locks will prevent the following situation. PulblicOne.vi reads data cluster (A) PublicTwo.vi reads data cluster (A) PublicOne.vi unbundles STR data, changes it and bundles it and writes back the data cluster (A & STR). PublicTwo.vi unbundles NUM data, changes it and bundles it and writes back the data cluster (A & NUM) not (A & STR & NUM). PublicOne's change is lost because PublicTwo did not read the STR changes. Its the changing of one data item and assuming that none of the other item in the cluster have changed that causes the problem. The locking of the data cluster would have forced PublicTwo to wait until PublicOne had completed its change. Tracking down a lost data problem is very difficult. Timming is a major factor and when you try to find the problem you change the timming. Here is an example showing why locks are important. the counts of each loop should follow the itteration number Download File:post-584-1142554592.llb To do the same thing with out locks you have to keep all of data change functionality inside a single Functional global to insure no other vi has access to the data while it is being changed. There are probably other ways but the dqGOOP locking method to me is the eaisest way to keep the data safe. It sound like you too have fallen victim to the dreaded "SCOPE CREEP" :ninja:>>>>>>>>>>
  8. I think of them as dynamic objects. What they do is as important as what data they hold. Checking in and out (which implies some external object takes control of the data) is not allowed. However Requesting changes and viewing data is permitted through public functions only. Inside a change public function the object is locked. The data is tested, changed and written in to the cluster and them unlocked. The data never leaves the class. How about this instead. The GUI would like to increase the maximum acceleration. It calls the public function "Change Acceleration.vi" and the function makes sure it is capable and then changes the acceleration value. It then returns the values that was actually set. If you think of a class as a group of functions that manipulate data and not a global variable that needs help, then I think there isn't a valid reason to separate static data from dynamic data. How often a data object changes doesn't make the functionality less dependant on its values. Since we are using motion as an example here is how I would frame the solution. I would create an Axis class Its data cluster contain thing like acceleration, velocity, position, tuning constants, motor com reference, rotary encoder count/rev, gearbox ratio...... The private vis manage things like communication, syntax, conversion of counts to degrees, maybe even plug-ins for different controllers....... The public vis are the interface to the class. their inputs use real world units like Degrees and seconds. All the public function are tested to make sure they work as expected. Even unexpected data is used to insure the class is robust and can adapt to bad inputs. When I'm finished I have a stand alone class that can be used by any program that wants to use an axis. A program that uses the class doesn't need to know how to communicate with the motion controller or how to convert degrees/sec to counts/sec. It only has to know where it wants to go and how fast it wants to get there. If I find I need more functionality I create a new public function and it is automatically usable by all axes. If multiple axes are needed then I would create a multi axis class to do the coordination. This class would have an array of axis class references inside the data cluster. Now the GUI is much simpler to write because it only has to be concerned with the user and the multi axis public functions. If the axis class is written well I could even change the motor controller brand without affecting the GUI. Robustness, flexibility and modularity that
  9. It sounds like you are thinking of a class as more of a global variable. In a class data is manipulated only by its public and private functions. If you hold to the strict class rules, programs out side of the class can only access the class through public functions. Only public or private functions may access or change the data cluster. Any function that manipulates the data cluster should be a part of the private or public class functions. This allows you to encapsulate the class and makes for easier debugging. So every time you want to add more functionality to the class you would create another public vi to do so. Yes it does create more overhead but I think you will gain flexibility and robustness. I have a similar template in my goop structure. It is used when I need to combine two or more public vis together. An example would be a standard motion profile that calls a public single move vi several different times with pauses in between.
  10. The blank lines are created by the New Report Line.vi Change or remove this vi to change the number of extra lines. Remember to save the vi under a different name after you change it.
  11. I think they add a definite cool factor to the Goop vis :thumbup: Although sometimes the graphic creation takes more time than it should.
  12. My solution to this challenge is to create a Master class that contains all of the other classes. Here is the Data Cluster of a Class that I am currently working with. It represents a Test Bay. All of the class objects for this class are created in the Master create vi. When 2 or more separate classes need to work together their referenced are easily accessible inside a public function. Hope this helps.
  13. Posting your code or some example of what you are trying to do would make it easier to help you.
  14. Another useful tool when building a user interface was given to me by njkirchner. The propose is to put a Front Panel in it correct position at run time. The steps to use it are as follows Position the Parent VI in the desired runtime position. Place the FP size and position vi on the block diagram. Next open the FP size and position vi and click on the Set Values button. Now run the Parent vi and stop it. The position values with be filled in and the Set Value button will be set to false. Create constants on each of the position inputs. Set the Move Window input true if desired Finally if you move the front panel of the Parent to a new location it will always come back to the same spot at runtime. Download File:post-584-1140328475.llb
  15. Inspired by the tips and tricks thread. I am starting this post looking for everyone
  16. Try programming a radio button control that works like the one in the NI controls pallet. The key is to be able to add as many buttons as you want to the cluster without changing your code. This exercise should covers shift registers, array, clusters and bool logic.
  17. I am starting to work with the Open G development team on the Goop Libs. But I don't have a good Idea of how many developers out there use Goop. I set up this poll to try and get an Idea of where to start.
  18. My solution to your issue would be to create a Master DQ3class that manages the other minor classes. The Master class would have an array of minor class references in its data cluster. Essentially DQ3 is a type of global variable just like LV2. You could just as easily create another DQ3 class or a Single item que to do what your requesting. Yes I believe this was an oversight. Here is the current template I use if you are interested. Download File:post-584-1137095989.zip Support Files are Now included. Thanks Michael, Ok lets try again Download File:post-584-1137308121.zip And here is the template with everything included Download File:post-584-1137308268.zip
  19. You can pretty much ignore the transitional stats. I was unable to get them to show on the front panel. As for blinking you could put the color property node in a while loop and swap the colors around. Download File:post-584-1130342239.vi
  20. If you select File\New.. and in the tree view select (Vi from Template\Design Patterns\Producer/Consumer Design Pattern). This is the standard user consumer configuration. Referring to your example. The upper loop would be the people waiting in line sending requests. and the lower loop would be the bank teller. I've attached my template that I use. Its a bit more advanced than the Labview example. Download File:post-584-1130172767.llb
  21. To get properties of a control or indicator. right click on the terminal and create property node or create a reference and wire a property node to it. To set the properties right click on the node and select "Change All to Write"
  22. And lets not forget Smokey and the Bandit. Man can that guy drive a Trans Am or what. As for attractiveness, Jodie attracted a Lunatic while Burt got Loni.:worship:
  23. Since were talking about multiple monitor. Does any on know of a way to add a second graphics card to a laptop? I'm am soon to receive a new laptop from IT but I will have to give-up my dual monitor desktop. I'm looking for a way to get the best of both worlds, portability and bigger desktop. I saw that APPIAN use to make a PCMCIA graphics card but it is no longer available.
  24. You can also get the color box constant directly from the Block Diagram.
×
×
  • Create New...

Important Information

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