-
Posts
259 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Downloads
Gallery
Posts posted by Aitor Solar
-
-
I've using for years the "anyservice.dll" way described in http://forums.ni.com/t5/LabVIEW/running-labview-program-as-system-service/td-p/878148 and it works great. Unfortunately, original Chen's post seems to be gone, but basically you call asynchronously the DispatchService call in that DLL, and in turn when OS needs them it calls methods BeginService and EndService in a server.dll you provide . You can put the code you need in those two methods, I usually just take the EndService to close my application. Then register your exe as a service (thtrough "sc create" command, for example) and it's done.
Regards,
Aitor
-
Well, recently I've been working with a class that does a lot of simple tasks, but a sub-group of them have become increasingly complex and sensitive. Now I would like to further isolate that set of properties from the rest of the class VIs to be sure no old and forgotten code messes it all.
I'm going to add a new class inside the old class and move the critical fields to it, but that will force me to implement some encapsulation in the original class (to allow the external code call those methods). Your suggestion would be a step in simplifying the problem, but what I'd really need is a "this field can only be modified by this subset of VIs".
Saludos,
Aitor
-
Thank both of you, it seems logical when you think of it, but I had always thought that leaving that wire unconnected was exactly the same as using "localhost" .
Saludos,
Aitor
-
Hi, people.
I've found a surprising behavior in the TCP Open Connection VI.
Simply put, if you open a TCP connection from LabVIEW to another application in the same computer, using the "TCP Open Connection.vi", and you don't wire anything to the address input, connection works ok. But if then you unplug the ethernet cable from the machine, your connection will be closed in a few seconds (the OS, I'm guessing). Now, if you explicitly use as address "localhost" or 127.0.0.1 in that VI, the TCP connection will survive any plugging / unplugging of the ethernet cable.
Moreover, if you start the connection with cable unplugged, the connection will survive any further plug/unplug even if you didn't explicitly set it to localhost. This on Windows XP at least.
You can easily test this behavior with the Simple Data Client.vi and Simple Data Server.vi examples found on LV. Run as they are provided and unplug the cable: ok. Disconnect the address wire on de client, repeat process and get error 66 in a few seconds.
Saludos,
Aitor
-
You can also prepare your own XML and send it through the "Write Response.vi". Just configure the method VI output type to Stream instead of Terminal. I think this is the best solution as you can format the XML just the way you need, and avoid all that "name - value" tags.
Saludos,
Aitor
-
Here you are. The "read characters from file" primitive has been automatically replaced with open - read - close VIs.
Saludos,
Aitor
-
Right-click in the Register Event Callback node (put the mouse over the "VI Ref" input) and select "Create Callback VI". Et voilá
Saludos,
Aitor
- 2
-
-
-
If you still want to test the variant type before trying the variant casting, the 6th byte in the typedesc will tell you the refnum type (value 7 is for ActiveX Automation references). Though I do agree the other way is probably faster.
Saludos,
Aitor
-
Name: XNode Manager
Submitter: LAVA 1.0 Content
Submitted: 03 Jul 2009
File Updated: 03 Jul 2009
Category: XNodes
LabVIEW Version: 8.2
Version: 1.5.2
License Type: BSD (Most common)
Potentially make this available on the VI Package Network?: Yes
Copyright © 2007, Aitor Solar
All rights reserved.
Author:
Aitor Solar
--see readme file for contact information.
Description:
This is an application for creation and management of XNodes. The program allows to open or create XNodes, to add or remove abilities and to easily access the ability VIs. It's prepared for all the LV82 abilities.
Dependancies:
The application requires the Internet Toolkit for LabVIEW 8.2
Change Log:
1.5.2: Added managament of the XNode icon.
1.5.0: Added descriptions for the XNode (read/write) and the abilities (only read).
1.4.3: Now, removing an ability also disconnects the VI from the XNode Library. Solved the "absolute path" bug.
1.4.0: Initial release in the Repository Code
-
-
-
Well, I would make the listbox an indicator, with no customizing. Then detect a mouse-click event over the second row, position an invisible numeric control over the selected cell and make it visible, so the user can enter a number. Detect the value change event, convert it to string and put it in the listbox. Iy's easy and avoids the possibility of entering a text instead a number. But surely there are many other approaches.
Saludos,
Aitor
-
I haven't tested the VI, but I see you are waiting events for refnum value changes. The refnum value won't change until the reference is disposed, since is just the memory address. I think you are looking for a value change event and, in addition, don't use events in the subVI but in the top VI since it's there where the controls are.
Saludos,
Aitor
-
-
QUOTE (Norm Kirchner @ Jul 28 2008, 08:33 PM)
I would reccommend making a 'Brat' VI (as in child... not sausage). I'll describe what this means in a minute.This VI would sit outside of any loops in your VI that contains the numeric.
-
You would pass a reference or array of numeric reference into this Brat VI with the limits and colors corresponding
-
Inside of the Brat you would take the reference and register it for the value changed event.
-
Then you would setup the brat to respond to the event and change the background based upon the limits and colors passed in.
Interesting idea this "brat" . The (minor) problem I see is the need to stop the brat loop from outside. You don't always stop the top VI with a stop button (there could be stop conditions, external command, etc.), and though you could solve it calling a "value (signaling)" event, I find more elegant to use a callback event, as shown:
http://lavag.org/old_files/monthly_07_2008/post-1450-1217313173.jpg' target="_blank">
This way, you can forget the brat VI (and nobody wants to keep an eye on a brat, true?).
Saludos,
Aitor
-
You would pass a reference or array of numeric reference into this Brat VI with the limits and colors corresponding
-
I think it's better if you describe a detailed example. I'm sure there is a good way of handle it in LV without the necessity of creating new objects at run time, but it depends on what's your goal.
Saludos,
Aitor
-
QUOTE (mamingcao @ Jul 24 2008, 03:08 AM)
My company are considering use LabView to do the GUI designed.But could LabView add GUI component at runtime ? like a button or a indicator.
It hard to find Doc about this. Thanks!
It would be really difficult (if possible) and involves scripting, dinamic calling of VIs, etc. But maybe it's not necessary, if you just need indicators or buttons to appear in some cases, create them and make them visible / invisible / disabled depending on the case.
Saludos,
Aitor
-
Well, some dialogs can show up in remote panels when the remote user has control of the VI, but fail when the remote is just viewing. In any case the file dialog doesn't work in remote panels, either controlling or viewing, and throws the error 43 you are experiencing, so using your own file dialog VI as Neville advises is the answer. Moreover, you probably don't want the remote user to play with any file in your computer, so a file dialog limiting his scope is twice better.
Saludos,
Aitor
-
QUOTE (Mads @ Jul 15 2008, 02:10 PM)
This is not a bug, it's the established way LV decides the order in which to do things: If you have a property node it will execute the actions on it from top to bottom. All you have to do in the first case is to swap the positions of the properties.I know, but that doesn't explain why it works in the development environment and not in the executable. And I can't see why it shoudn't work, anyway: first I set the port I want to use (while the server is off) and then I activate the server through that port. In fact, seems to be more logical for me than the other way (first activate the server through a default port and then changing that port). What if there's already some application using the default port? It will launch an error before you can change that port to avoid conflicts.
Saludos,
Aitor
-
Maybe this is too easy to workaround to be considered a bug, but is annoying anyway.
This code activates the TCP interface to the VI Server, the only difference between the two cases (true and false) is the property order. In the development environment, both cases work fine. But in an exe, only the second one (first activate, then assign port number) works, the other reports using port 3363 (LV default port, IIRC) even if you have designed another one.
BTW, the INI file fot he exe is empty.
Saludos,
Aitor
-
QUOTE (Xrockyman @ Jul 11 2008, 01:25 PM)
Hello, I am using a "log-in" system and I want do disable some controls. To do that I'm using the property node "Disable". The problem is that I have a lot of controls to disable, is not possible to create a "property node" for a group of control or other objects?Thanks in advance.
Not that I know. There's a private property to retrieve the references of a group of objects, but is unsupported. Usually there are simpler solutions. For example, to have your controls in tabs, so just disabling the tab disables all its objects. Or to have an invisible control on top of the other controls you wan to disable: make it visible and it will block everything behind.
Saludos,
Aitor
-
Well, the [0,1,2] array was just an example, obviously consecutive arrays can be generated easier but I was referring to any kind of array. Say you have a boolean array defining different properties of an object. You would like to generate n copies of the default configuration array for n objects in your application and treat them as a 2D array for easy comparison.
Sure this woundn't be a essential modification, since is the first time I have encountered this problem in all these years, but still it would be useful in some cases.
Saludos,
Aitor
BTW, when testing if the initialize array function admits a cluster with an array inside (it does) I have discovered that if you take a waveform constant and try to duplicate the cluster elements inside the cluster, LV crashes. Funny.
Running LabVIEW executable as a Windows Service
in LabVIEW General
Posted
True, "sc create" and "sc config" are very useful commands to register your app as a service, and don't demand to reboot the machine
Regards,
Aitor