Jump to content

Mark Balla

Moderators
  • Posts

    607
  • Joined

  • Last visited

  • Days Won

    41

Posts posted by Mark Balla

  1. Hi people.

    How do I create a reference?. I mean, I have a cluster in a VI and I want to have a reference to it in another VI in orther to use property nodes and things like that to change that cluster. Can anyone help me? beacause everytime i create a reference and I copy it to another VI, it shows the original cluster in the front panel of the second VI , and I'm not interested in that(Maybe it's the only way to do it).

    Thanks a lot.

    Fernando :beer:

    If you right click on the reference and create control you will get what you are looking for.

    post-584-1127483645.png?width=400

    post-584-1127483658.png?width=400

    Paste the newly created control into your subvi.

  2. I have a vi that returns the information about file modifications as timestamps , I then want to find the oldest (or newest) file from an array of timestamps. I have tried direct comparison without success and am now trying Seconds to Date/Time but with Timestamp data as the source. Anybody suggest an easier way before I start unbundling the timestamp cluster and comparing induvidual elements ?

    Why not use the Sort 1D Array function.

    post-584-1127404850.png?width=400

  3. There are some "States" in my current project where I'd like the code to process as quickly as possible.  (Re-sizing and saving images)  But I notice poor front panel performance (lagging mouse and keyboard etc.) when there is no "Wait" function in my main loop.

    My question is; Am I asking for trouble by doing this?  Is there a better way?

    Thanks.

    6009[/snapback]

    One of the things I do when I want certain cases to run as fast as possible is put the input to the Wait primitive inside a case structure and send a 0 to the input base on the incoming state.

    post-584-1126030478.png?width=400

  4. Some more hardware info would help.

    How many inputs how many outputs.

    which E series card are you using.

    how fast do you need to aquire the data.

    what is the counts per revolution of the encoder.

    also any code you have already written.

    I do a rotational aquisition on a current project I'm working on.

  5. Ok

    Here are the changes I needed to make to get it to work.

    1: The bool wire in the event structure time out case needs to be passed through

    2: The integer controls and indicators from kels code were changed from I32s to U32s this caused big problems when negative values were used.

    After that it worked.

    I also added a stop button and replaced local variables with shift registers.

    I would highly recommend learning to use shift register instead of local variables.

    By using local variable this way you created a race condition which means there was no way to determine if the graph was updated first or the data was modified first.

    Although a minor problem in this case they can become big problems.

    lets us know if you need more help.

    Download File:post-584-1124948981.llb

  6. Hi Freinds,

    I want to acess the data of one Vi (which is local to that loop) in the other loop ,How can i do this ?

    My both Vis are running in parellal.

    Harsh

    5827[/snapback]

    Since I see you are new to LabView you may not be familiar with all the terms discussed.

    here is a simple vi I built a while back that shows the various ways to transfer data between loops.

    Download File:post-584-1124939201.llb 7.1 version

    Download File:post-584-1124942360.llb 6.1 version

    I would personally recommend learning to use Queues.

    functionals second

    and locals only when you have to. (Writing to a Input Control)

    good luck

  7. Yeah, I forgot about using libraries... duh!  I'll be sure to use them in the future. Thanks  :shifty:

    5763[/snapback]

    Ok the future is now.

    Can you please post the vis as a development distribution.

    In your main vi go to

    File>>Save with Options

    select Development Distribution

    and Save.

    post-584-1124830382.png?width=400

    LabView will create a llb with all the vis needed to run the main.

    This makes it much easier to help. :)

  8. I've tried to do some GOOP in LV 6.02 and I wanted to use Named objects/instances.

    It is fairly easy to set the name of an object, but then if I want to read the name of the

    object later on, how do I do that?

    The private functions "Get Data" and "Get Data to Modify" only return the Data from the Object repository, not the name.

    Of course I can in addition call the Object repository using the input method "Get Statistics", but is this the only way to get hold of the name?

    I don't want the statistics, I only want the Data and the name in one go.

    And I also don't want to store the name as part of the Data as what could be another solution.

    4914[/snapback]

    I've done this for my Open-G Goop model can you figure out how the names are extracted in the statistics vi.

    If you can I would move the code outside of the case structure so the name is generated for all cases inside the repository.

  9. Ok so you see how to do a multi user plot but the next question how to get it into your existing code still remains.

    To expand on what m3nth was talking about we covered some of this in this post.

    http://forums.lavausergroup.org/index.php?showtopic=1474&hl=

    In it I posted a Que Structure demo showing how to separate the user interface from the process code.

    Understanding that you are trying to digest and understand these new Ideas, a total rewrite doesn't get your code working any sooner.

    So here is what I would recommend until you are more comfortable with ques.

    1: In Sequence 1 inside the While Loop create a Event Structue around all the code and make it the timeout case with a timeout of 100ms.

    2: Insert kel712 code in the event structure and test it out. This should get you to where you need to be with out a total rewrite.

    3: Now one by one take the items in the timeout case where you are looking for user input and create an event case for them.

    Example: Create a event case for the Go Home button and in that case place the code.

    This will also help reduce the size of your block diagram. Remember to test your code after every change.

  10. Ok, here's what I want to do: I want to enable user drawing on a graph (similar to examples > general > uievents.llb > Draw Graph with Events.vi), but the graph I have has two plots. 

    5726[/snapback]

    Could you post what you have so far so we have something to start with.

    It makes it easier to help if we are all talking about the same thing.

    Don't worry about how messy it is we just need someplace to start.

    By the way this is not trivial stuff.

  11. Is it possible to use event structures in subVIs such that they handle events of the main program?

    5720[/snapback]

    Yes you can do it but It will add some complexity to your code.

    The Dynamically Monitor VI's.vi in the examples is a good place to start.

    as my main is already very large as it is.

    5720[/snapback]

    I haven't seen your code but I doubt the event structure is the primary reason your diagram is so large.

    SubVi have always been my main tool for shrinking the block diagram. If you are going to spend time shrinking

    the block diagram I would recommend focusing it there first.

    And (plug plug) if you want to save time wiring and cleaning up your sbuvis try using the Subvi fixer.

    http://forums.lavausergroup.org/index.php?showtopic=1597 ;)

  12. I've got an application where the user can stop the test.  The chart X-axis shows the time since the test started.  If the user exits the application completely the chart loses the test time.  When they try to resume the test the X-axis of the chart starts plotting at zero. 

    I can make the chart start the X-axis at a time I specify but I can't seem to get the X axis position of the last plotted point.

    5618[/snapback]

    The Maximum cluster element in the XScale.Range Property shows the last point on the strip chart.

    couldn't you read this property and set it to the start position before you enter the while loop.

    You could also save the last position value to an ini file when the program stops and recall it in the begining.

    post-584-1123851912.png?width=400

    Download File:post-584-1123851927.llb

  13. Are there going to be any planned LAVA/OpenG events or presentation this year at NI Week.

    Also I had an Idea and would like to hear what people think.

    What if everyone prints out their avatars and attaches it to their NI name tag.

    I think this will be a great way to meet other LAVA members in person without have to guess who they are.

  14. In February of 2005 around Valentines Day (icon color scheme Red & Pink) I was working on a project for work that now has approximately 1100 Vis in it. As the program expanded the block diagrams also start to expand so like a good little wire worker I start condensing the diagrams by creating subvis. Now being somewhat of a perfectionist concerning good looking code, I was unable to tolerate the mess that LabView leaves me when a SubVi is created. I found myself spending too much programming time fixing subvis.

    I was inspired by David Boyds Tunnel wiring wizard and how much time it saved. I had also been tinkering with scripting so I started building a tool that would do all the busy work for me. Thus the SubVI FIXER was bourn.

    The main purpose of the SubVI FIXER is to reduce the time it takes to cleanup a SubVI that is created by LabView. There are 3 major steps to accomplish this.

    1: Wire controls to desired connector pane terminals.

    2: automatically arrange front panel objects

    3: Clean up.

    The primary assumption used by the FIXER is the front panel objects relative location is representative of how they are wired to the connector pane terminals.

    post-584-1122092564.png?width=400

    As shown above (error in) is located in the lower left corner and therefore wired to the lower left corner of the connector pane the other controls are also wired to their relative location and are arrange in the same orientation as the desired terminal pattern

    The Read me document explains all the steps in greater detail.

    Download File:post-584-1122094477.zip

    In Short the FIXER works like this.

    If we start with this

    post-584-1122092968.png?width=400

    The user arranges the front panel to look like this.

    Adds text for place holders

    Selects all controls and indicators.

    Presses Ctrl-Shift-SpaceBar and presses 5 buttons.

    post-584-1122093198.png?width=400

    The FIXER Generates this. Wired, Labels conformed, Front panel arranged, relinked and saved.

    post-584-1122093259.png?width=400

    What use to take me more than 3 minutes now takes me only 50 seconds.

    Only 1200 more subvis to go and this baby will have paid for itself. :D

    I had to seperate the program into 4 parts so I could transfer it to the site.

    all of the zip files should be extracted into the same folder.

    Download File:post-584-1122091741.zip

    Download File:post-584-1122091787.zip

    Download File:post-584-1122092205.zip

    Download File:post-584-1122092240.zip

    I tried to design the program structure to be easy to modify and adaptable.

    Any coments or feedback would be greatly appreaciated.

    I realy hope this saves people time.

  15. Hey all,

      Im fairly new to LabView, and am building a program which is using a ring menu to bring up several options, depending on choice. I was wondering if there is any way (without using a subvi) to cut down on the number of property nodes that i need to use to enable/disable the visibility of each control, indicator, etc... Right now it is taking up a massive amount of space :headbang:  in the panel, any help would be appreciated.

    Thanks,

    Jesse

    5293[/snapback]

    I find I'm using tab controls more and more to do this sort of thing. No property nodes necessary to hide a control and you only have to change the tab control value.

    Another Idea would be to combine several control references into an array and use a for loop to set the visible property.

    and if you turn it into a subvi it will take up even less space. SubVi are our friends :shifty:

    post-584-1121314855.png?width=400

  16. How can I prompt a warning to the user when he/she writes an incorrect value in a "controller box".

    5290[/snapback]

    Usually I try to do the data checking while the user in inputting the information.

    If they enter incorrect data I will erase the input box and ask them to try again.

    I've attached a basic serial number dialogue box that I use as a template.

    good luck.

    Download File:post-584-1121312835.vi

    Another question is how do I create a start button for the whole script?

    5290[/snapback]

    It depends on how your code is structured. If you could post a vi I would be happy to look at it.

  17. I can't resist helping someone who is able to combine two of my favorite things together LabView and Beer. :thumbup: :beer:

    I made some modification to your code that may help. I removed the digital input line vi and replaced it with the standard daq vi and then wired in the itteration input.

    It unclear what exactly the burp line does or how long it stays on. I added an option to trigger off the rising edge of the inputs so calculation will only be triggered once a cycle.

    Hope this helps if not give me some more details and I will be happy to help. :)

    Download File:post-584-1121312098.llb

  18. I now understand LV2 globals and how they function but whenever I have used one I have only needed to use one instance of it. Now the case has arisen where I may want to have two instances of the same global, ie, two different data sets. The painful way to do it would be to make a copy of the LV2 VI and rename it two a second file. As I said though, I'm almost sure I've read a better way to do it... one where the same file can be instantiated or something of the sort, which would not require duplicate changes if the core functionality needed to be updated.

    5073[/snapback]

    The idea of many of the same data sets or Objects is the reason GOOP was created. Try looking into the OpenG Goop.

    If not how about

    Instead of one Cluster in your LV2 global why not use an Array of them. Then create a terminal that specifies which element in the array to

    operate on.

×
×
  • Create New...

Important Information

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