Jump to content

Michael Aivaliotis

Administrators
  • Posts

    6,196
  • Joined

  • Last visited

  • Days Won

    103

Posts posted by Michael Aivaliotis

  1. You have to use VI server to open a reference to the SubVI and then use methods like "Set Control Value" or "Set Control Value [Variant]".

    1136[/snapback]

    PJM's example works well. Using a variant means that you don't really have to get the datatype correct, however the datatype should be in the same family like numeric or string.

    Along the same line is this previous post:

    http://forums.lavausergroup.org/index.php?...=findpost&p=338

    To answer your question about re-entrancy. There should be no problem. I assume you know about the feature included with the open VI reference function? This allows you to dynamically call a reentrant VI.

    post-2-1089677447.gif?width=400

  2. I have an instrument set up to my computer that measures the current, voltage, and power of a system.  I am using the Instrument I/O assistant to acquire three (3) seperate data signals that I am then attempting to save all to a single file. So far I have not been able to do this.

    1123[/snapback]

    What data-type are the signals? Waveform datatype, arrays or scalars?

    I was wondering if there was a way of accomplishing this while still using the write to file commands.

    1130[/snapback]

    Which functions do you mean? The Write to Measurement File Express VI's, the write to spreadsheet VI's or the Write File function?

    The example that Bryan gave you shows using the low level LV primitives (functions). Here are some other examples:

    post-2-1089652079.gif?width=400

    post-2-1089652528.gif?width=400

  3. I also wish to start a vi for graphing data from within another vi, but in my case the main vi is a loop which must continue to run.  I have compiled the second vi and called it with the system exec vi, which does work, but I would much rather leave it as a vi so that when I compile, I will end up with only one exe.  I believe that the vi server is what I need to use, but I have had no experience using it.  Any help in this area would be appreciated.

    574[/snapback]

    Here is an image of a diagram that performs a dynamic call:

    post-2-1089530157.gif?width=400

  4. I m doing a small proj where in their is a main menu screen having buttons that call different plant section.When i click on any of the btn's i shud go to that screen or VI & vice versa.

    Well, the easiest way to do this would be to use the event structure to handle button presses. When you press a button, a VI would be called and it would pop-up its front panel. The VI's to be called can be just placed on the diagram of the main VI. Follow this link for more info on how to create a pop-up VI:

    http://forums.lavausergroup.org/index.php?...=findpost&p=255

    Once the VI terminates (by pressing a button on the front panel) the front panel will close and you will be returned to the main VI. This method will work but is limited because you can only interact with one screen at a time. You cannot have multiple screens running in parallel. If you want to do this then you need to call the VI's dynamically using VI server.

    post-2-1089529460.gif?width=400

    This implementation will allow you to have the main menu VI running while the screens are open.

    If you need to run a process in parallel, I would suggest using a parallel loop. You can also place this parallel loop inside a subVI (to reduce diagram space) and place the subVI next to your main menu loop which will handle the screen launching.

  5. i know code how i should activate it,
    You do? Where did you get this code? Is it an example for another language? If so, what language? Do you have a programming manual for this instrument? :book: This would list all the commands required to perform interaction with the instrument. Once you know this then it is a breeze to do the rest. GPIB is easier to use than say Serial.

    First of all, if you want to execute the commands as they are listed in your example you can launch a command prompt interactive terminal and just type in the statements as you list them in your post:

    post-2-1089441388.png?width=400

    post-2-1089441803.png?width=400

    SCAN = ibdev (0, 24, NO_SAD, T100ms, 1, 0)

    This just sets up the GPIB device.

    T100mS works for my machine, errors when less than 100 uS

    Yes, this is the timeout value.

    ibconfig (SCAN, IbcEOT, 0); // Sets EOS bit to 0

    Yes the EOS...

    ibwrt (SCAN, "A00\n", 4);

    Well the last line is really the command. This tell the scanner to do something "A00\n". Without the manual I don't know really what this does. The 4 means write 4 bytes.

    but i cant find any example  where i should write this commands,

    Well, you can use the interactive control I mentioned above to test the commands and see if you have device communication. Of course this is not LabVIEW programming but it can give you a comfort feeling to know that your computer can communicate with your device\scanner. What you really want is to get into some LabVIEW code right?

    Here is all you need to get started. You'll say: "really"? Yes... really. :blink:

    post-2-1089442716.png?width=400

  6. Well, you can create the semi-circles in a drawing package and import them into the center button. To avoid the overlap issue why not send the center button to the all-back layer? They would then be covered by the surrounding buttons.

  7. The File Dialog function is used to display a dialog. It does not Create, Open or Write a file. The only purpose of the File Dialog function is to give you a "nice" user friendly way of navigating to a file or directory on your computer. It is doing exactly what it's suppose to do.

    If you wire in a filepath. You are just telling the function what the start directory is, that's all. LabVIEW (by default) prompts you to Save As. This text can be changed by wiring the "prompt" input with your own text.

  8. :question: Each boolean control has 3 visible parts. The square and round LED also have decal.

    Correct!

    And why is this significant? It is nice because the decal is a clickable object which toggles the logic on the boolean. This is great because you can replace it with a custom graphic and use it as an additional part of the control which can be clicked.

  9. To start off, just to clarify. The LAVA Forums are not OpenG. I realize that some OpenG contributors hang-out here but if you want to give praise to OpenG, the best way to do this is to go to the OpenG forums and tell them how much you love them in person. While you're there you can also donate some money ;) :

    OpenG Website

    ---

    OK... About custom controls. Do you know about the control editor? That's the first place to start. There are many ways to access it but the best is to right-click on a front-panel control and select Advanced>>Customize. This will pop-up a window called the control editor. Once your in there you can manipulate all the objects to your hearts content.

    One thing you have to realize is that each control is composed of many parts. You can manipulate these parts and even replace them with pictures of your own. To see these parts you must click on the icon on the button bar that looks like a wrench. This will cause labview to break apart the control into several components. You will see each element highlited with a white box. If you use your mouse pointer you can click and drag each part of the control and spread it about.

    So now how do many people create cool controls. Simple, you just hack away at the control using the control editor and replace the parts you want with pictures of your own. The radio button control you mention is actually a slider. Yes! The black dot of the radio button is the slider pointer that has been replced by a black dot. The circles are pictures of circles copied from a dialog button radio control of windows.

    I hope I gave you an idea of how this is all done. Cheers! :beer:

    :arrow: Here's a challenge question for you control editor experts out there: Each boolean control has 3 visible parts. The label, caption and boolean text. There is one exception to this, what is it?

  10. Here is an example VI (LV7.0) that shows how to manipulate text in a text box. The focus of this example is the Selection Start + Selection End property. This can be very powerful in performing custom live formatting of front panel text.

    The trick here is to perform formatting on the text after you highlite the section of interest. The Font property is then used within the same property node.

    text_hi_lite.vi - Image:

    post-2-1089818933.gif?width=400

    Download File:post-19-1088657566.vi

  11. regarding the textbox, i would like the messages to store in it, so i could use the scrollbar to look at the previous messages

    I thought Alex explained it quite nicely but just to clarify I've attached a dead simple method. I think the main idea is to read the previous data and concatinate the new data to the previous data using a end-of-line between the new and old data. Of course there are other logistics issues you have to take care of yourself but the framework should work as shown.

    post-19-1088048641.png?width=400

  12. Ok, being the picky bastard that I am, I decided to post a slightly modified version of your example. It is functionally the same however it's slightly improved on code clarity. Feel free to attack my design...

    The major change is that I stop the top loop by destroying the notifier Refnum. I check for errors on the wait on notification . Any error (such as a bad Refnum) stops the loop. Another change is that I use the timeout output of the same function to determine if there is a new message. This adds a bit of flexibility since you can easily expand this configuration to decode a number of datatypes (not just a Boolean out). So if there is no timeout that means there is something there... decode it.

    I'm not saying that your version does not work, it works well. I always like to program-in inherent flexibility (no matter how small) to accommodate system expansion.

    post-10-1088045045.png?width=400

  13. A late response here but I would recommend that you create a VI that counts a fixed number of transitions (low to high crossing a given threshold). Do this for a certain sample set. Let's say 1000 samples. Then I would compare the count of transitions to the total number of samples collected. If you have fewer transitions for the given samples, you have a problem.

  14. After reading Conway-Watts I've started putting all 'constants' in INI files. There just seemed to be a desire from some to have a 'cleaner' compile-time constant, so I made a suggestion. I can think of other things I would like to see in LabVIEW first.

    Yes the Conway-Watts book you refer to has some great examples of this.

    As far as the value of posted suggestions\wishes, we have quite a bit of influence in the direction of future versions of LabVIEW as long as the wishes get posted to the right location:

    LAVA wish list policy.

    My opinion is just that, an opinion and does not indicate right or wrong. Keep those opinions and suggestions comming, they are all welcome! :thumbup:

  15. When Dynamic Events were introduced in LV7 I tried so hard to figure out a place for them in my design architectures. I am attaching an implementation where a user defined dynamic event is used to pass data from a dynamically called VI to a main VI caller. I actually used this implementation in a real project.

    Any comments or suggested improvements are welcome. The code is LV7.0.

    Download File:post-12-1087954972.llb

  16. Is the length of the array going to be limited?

    How big can it actually get.

    There are some creative solutions that you can implement, but most can not be used on an array that has a large and/or indefinite length.

    What is the interface trying to accomplish?

    This question may also bring about other solutions.

    Yes, for example, if only 10 elements are visible at a time then you can overlay 10 transparent booleans overtop each element of the array. Using logic you can enable\disable each boolean for the coresponding element of the array that needs handling.

  17. I guess there is a place for a new type of constant however I don't feel that it is really such a big issue.

    Personally I prefer to use a sub-VI for placing constants. I don't understand why you need to have one VI per constant. Most of the time constants belong in groups. For example you would have DAQ settings or Instrument settings. You would then place all constants on the diagram of a subVI. Of course you would put them inside of a cluster then output that cluster to a terminal of the VI. A simple unbundle will give you what you need. If you don't like clusters and unbundle then use multiple output terminals instead. Why is this so hard?

    There is also a hidden potential here that is not evident at first but I will explain. If you created a VI for each functional group of constants you could easily convert them (down the road) from static hard coded data objects into flexible variables that can be abstracted and manipulated externally, even as a built executable. Each constant VI can be edited and replaced with a read\write from ini file. This allows you to implement code

×
×
  • Create New...

Important Information

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