Jump to content

John Lokanis

Members
  • Posts

    797
  • Joined

  • Last visited

  • Days Won

    14

Posts posted by John Lokanis

  1. Try this:

    Open LabVIEW 8.2

    Create an empty project

    Right click on the My Computer in the project and create a New VI

    Drop a tree control or multicolumn listbox or table onto the front panel

    Try to resize the column widths with the resize tool (looks like this: <-||->)

    If you can do this, it is because you do not have a source control system setup with LabVIEW.

    If you do have source control setup (I am using Perforce) and find that you cannot resize the columns (like me), try this:

    Locate the App Instance indicator on the lower left corner of the front panel.

    Change this from My Computer to Main Application Instance

    Now try to resize the columns in the tree or listbox or table. It should work.

    This must be the most bizzare bug I have ever seen in LabVIEW...

    -John

  2. This is quite close to what I need, except I also need it to copy the background color of each cell. Not sure if I can mod it to do that.

    Another solution that just occured to me is to use sub panels to display the different VI's I am trying to monitor from my top level app's FP. That might be the simplest way to achive the desired results.

    -John

  3. Hi,

    I have a need to programmatically copy an object's data and attributes to another object of identical type. My application has a top level display window with a tree control. I spawn several copies of a sub process that collects data and formats it for display. Each copy of this sub process has a tree control on it's FP that it writes data to and sets attributes of (symbols, colors, etc). My top level application has a selector that chooses which of the running sub processes to monitor. When I select one, I need to copy the data and attributes of it's tree control to the tree control on the top level app's FP.

    I don't see any way to do this. There does not seem to be a 'get all attributes' and 'write all attributes' feature anywhere. Since they are the same datatype, this seems like it should be possible. Has anyone put together some code that does this?

    thanks,

    -John

  4. I am in desperate need of a solution today. If you have ever experienced this problem and know a work around, please let let me know how you solved it.

    The problem:

    I have a test machine with two networks cards in it. One is for connection to the corporate net and one is for connection to a local test net where my DUTs are attached.

    I have another machine on the corp net side that is running a LabVIEW app as a server.

    The test machine needs to connect as a client to the server app and send commands to control part of the test system.

    When I run the client code, I get error 1379: LabVIEW: The user failed a security authentication check.

    If I disable the network card in the client that is on the local test net (leaving the corp net connected) then everything works fine.

    It appears that if you have 2 network cards, then open application reference gets hosed up and will not connect.

    There must be a way to make this work. Thanks for any help anyone can offer in solving this. I have until the end of the day to get this system working.

  5. Hi,

    I need to create a LV app that will talk with other LV apps on several machines in our network. This app will allow one machine to connect to it at a time and process requests for controlling some hardware. I am trying to figure out what the best approach would be for the interface over the network. Here are the options I am considering:

    Straight TCP/IP

    Data socket

    Shared Variable

    The calling machine needs to request access, wait for it to be granted and then send and receive some data (most likely a cluster).

    The 'server' machine needs to accept connections from many different machines but only allow one at a time to manipulate the hardware resource.

    Does anyone have any experience with this sort of setup? What worked/didn't work for you?

    thanks,

    -John

  6. 1. If you close the only reference, then yes the vi will be unloaded. But you store the ref into a global, therefore it never unloads.

    2. I didn't meant the ref to the vi you should close, but the subsequent refs. The one to the panel and the ones to all the ctrls on this panel (see picture).

    post-253-1144821285.png?width=400

    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

  7. If I'm allowed: In your "Write to Text display.vi" you should close the references (panel & controls[]), or your memory consumption might become bigger and bigger (especially if you use this tool quite often). Each call from this vi creates new instances of the references.

    Didier

    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

  8. 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

  9. 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

  10. 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

  11. 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. :angry:

    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

  12. 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. :nono:

    My first thought was to open it and do a save as, but that option is greyed out. :angry:

    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

  13. 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? :P

    -John

    Download File:post-2411-1133462658.zip

  14. 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

  15. 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

  16. 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

  17. :lightbulb: Yes, this can be used on any html page that you want to get off the web. Once the data is received you can just parse out the important content.

    I made a VI that gets the nymber of registered LAVA forum users. I attached an image that shows how to do this. As you see, once the html page is retrieved, the rest of the process is just plain text string manipulation.

    285[/snapback]

    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.