Jump to content

John Lokanis

Members
  • Posts

    797
  • Joined

  • Last visited

  • Days Won

    14

Everything posted by John Lokanis

  1. Yes, I store the ref in a global. In the example code, I do close that ref when the user exits. With regards to the references to the controls accessed via property nodes, since these 'references' were never opened, there is no need to 'close' them. They exist in memory as long as the VI that they belong to exists. They are really just pointers or 'sub-references' of the VI and not independant instances of the control in question. A good experiment would be to open several instances to a single VI, then close them one at a time and test your references after each close to see if they are still valid. You should see that the references not closed are still valid, since the VI is still in memory until the last reference to it is closed. Now, open a single reference to a VI and then access the references to the controls on that VI's front panel. Test each of these control references to see if they are vaild. Now, close the reference to the VI and re-test the control references, you should see that they are now invalid, since the VI is no longer in memory, even though you never 'closed' the references to the controls. A reference to a VI adds 1 to the # of callers list and causes it to stay in memory as long as the callers list is >1. This is the same way Windows works with DLLs. A reference to a control is neither opened or closed and is just a 'far pointer' to a data/display element of a VI in memory. I hope that clears things up a bit. See the attached VI as a demonstration of this. -John Download File:post-2411-1145311174.vi
  2. Hmmm.... If I close the only open reference to the VI, won't it be unloaded from memory? :question: Besides that, by only opening the reference on 'first call' and then storing it in a global (which is used on subsequent calls), there never should be more than one open reference, right? -John
  3. This set of VIs demonstrates how to setup an independant VI that displays text sent from anywhere in you application and also appends the text to the bottom of the window and autoscrolls up. I used VI server to implement the independant display VI and control it. You could adapt this code easily to direct the data to a FP display on another VI by passing it's reference around. You would still need to implement a parallel loop in you VI with the display to handle the scrolling of the indicator. I hope this is useful to some of you. -John Download File:post-2411-1144691172.zip
  4. Can the LV PDA toolkit create a VI that can display and interact with a remote panel from a standard (desktop) installation of LV? -John
  5. Hi, I am trying to setup a remote control panel in LabVIEW that can be accessed over the web. I want to be able to display a small vi (160x240) on a web page and have the user interact with it to remotely control my LabVIEW code. So far, my experiments have shown a few limitations: 1. I only want my small 160x240 VI to appear on the webpage. Instead, I get a large box with my VI in the upper corner and a wide band above my VI (where the header text would go?). How do I control what is displayed? 2. I am using the 'embedded' option for publishing this VI. I also enabled the 'request control' option. When I connect, if the VI is already running, I cannot control it without releasing control and then re-requesting control. If the VI is not running, I do get control and can press the run button, then control my VI. I do not want the user to have to 'run' the VI. It should already be running when they connect and they should not have to request control. 3. My end goal is to access this remote web interface via a PDA with WiFi and a web browser. Since controlling a VI this way requires the run time installed, is it possible to do this on a PDA? Do I need the PDA toolkit? Is there another way? Thanks for any help! -John
  6. Hi, This VI is the result of a problem I ran into and solved with some help from the Info-LabVIEW list. The problem: How to get a VI with a standard event structure to fire a continuous stream of the same event while a button was held down, but then stop as soon as the button was released. The solution: With a combination of a case statement, an event structure and some 'switch until released' buttons, all within a single while loop, I got the desired result. It was suggested that I post it here to share with others. Some issues with my solution: While the code is processing the 'held down' event, no other events can occur. Not sure if they will be queued up or not. I didn't test for that. Some benefits of this solution over others: There is only one loop. So, there is no need to deal with killing two asyncronous loops when the exit event it fired. I hope this code is of some use to you one some project someday. I know I get a great deal of help from all of you and just want to give some back. -John Download File:post-2411-1141673638.vi
  7. I am running into a problem using listboxes in LV8. I often use these in my UIs to get operator input. Normally, I will populate these at runtime with a list of choices. Because of this, I do not know in advance how many selections there will be. In development, I will create a few items and set the font size to something that works well with my UI. All items in the listbox would get the same font size automatically. Well, with LV8, they now allow each item to have it's own font. So, when I populate my listbox, many of the items at the bottom have the default system font instead of the larger font I intended. This is really annoying. After reviewing the properties, there appears to be only one way to fix this: After populating the listbox, set each cell to be the active cell one-by-one and then set it's cell font to the desired font. There has got to be a better way. I need to set a default font for the listbox so that new cells will inherit this font as the list grows. Looks like they added a feature that actually takes away from the usefulness of the old feature! :headbang: Any ideas? -John
  8. Didn't get any responses on Info-LabVIEW to this so I thought I would try here... -------------------------------------- This may have a really simple answer, but how do you move a project from one spot on your HD to another? The project seems to have a bunch of absolute paths so when I move it, it gets really upset. My first thought was to open it and do a save as, but that option is greyed out. I generated this project by converting a 7.1 build script. The problem is, I don't want to keep the project in the same dir that I had the build script in originally. thanks for any help... -John
  9. I have gotten so many requests from Info-LabVIEW users for a copy of my XML code that I decided to post it here and give them the link instead of emailing everyone individually. So below is the information on the file and attached is a zip of the code. Written with LabVIEW 7.1. ----------------------------------- The top VI is specific to one of my projects, but it shows how to use the underlying tools. I also included the xml and xsd files that work with this implementation. You will need the NI Internet Toolkit and the OpenG Vis to make this work. I use XMLSpy to generate XML and XSD files. I edit my XML files in notepad. I only read XML at this point. I have not written any tools for updating/writing yet but plan to in the future. ----------------------------------- Hope everyone finds this useful. Sorry it is not very throughly documented, but LabVIEW is self-documenting, right? -John Download File:post-2411-1133462658.zip
  10. Hi, I am working with another developer on an ActiveX DLL that I am trying to interface with LabVIEW. The main issue we are running into is he has implemented an event that LabVIEW does not seem to like to work with. I am able to register for the event and create a callback VI where it recognizes the string passed from the DLL to LabVIEW. The only problem is, when I try to run my LabVIEW app, the events do not arrive. I have followed the instructions for events and modeled my code after the examples. There seems to be no reason why it will not work. Also, we created a simple VB app that can interface to the DLL fine and sees all the events. Is there some special recipe for ActiveX events that LabVIEW requires? We are so close to getting this to work (all the ActiveX methods work fine) but are stuck on this one bug. thanks for any help, -John
  11. Just had an idea for a simple feature request for LabVIEW. When editing, I wish there was a 'recently used' panel of VIs that I could select from to place on the diagram. When refactoring code, I often need to go in and add a new subvi to several VIs. Currently, I leave the last VI's diagram open so I can drag a copy of the new subvi over and wire it into the next VI I am updating. Often there are several subvis that need to be added from several different directories. If only I had a dynamic panel that would keep track of the last 10 VIs I had opened or placed. It's a small thing but it would be nice. Anyone come up with a nice hack to do this already? -John
  12. Hi, I have a GUI with a bunch of controls. Several of the controls are identical clusters. I want to be able to detect when a user clicks on one of these clusters. I have created an event to trigger when the user performs a mouse down on any control. This event returns the control ref of what was clicked on. Now, I need to ask if this control ref is the same class type that my clusters are. I can make a reference to one of my clusters and I have this generic reference from the event, but I don't know how to access the class of these two and then compare them to see if they clicked on one of my clusters. Any thoughts on how to pull this off? Also, once I determine that they clicked on a cluster I am interested in, how do I then see what control in the cluster was selected or acted upon? I need to know if they clicked the 'show details' button for a particular cluster. This is like a value change event on a particular control in the cluster. The problem is, there are a bunch of these clusters, so I don't want to create specific event cases for every 'show details' button in every cluster. I would rather have one generic version that uses the 'passed-in' cluster reference to determine which cluster to look at. I guess basically what I want is a 'which control in which cluster triggered the mouse down event' event. Does that make any sense? Thanks for any help or suggestions on this. -John
  13. It should be noted that unless your URL ends with ".html" then you may need to add " " (note the space) to your URL string to get this to work right. Maybe ftp sites need something simular to get them to work?-John
×
×
  • Create New...

Important Information

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