Jump to content

Tomi Maila

Members
  • Posts

    849
  • Joined

  • Last visited

  • Days Won

    9

Posts posted by Tomi Maila

  1. There are two types of events 1) static events and 2) dynamic events. Static events are directly subscribed by the event structure and cannot be unregistered. Dynamic events on the other hand can be registered and unregistered as you wish. When an event is registered, it can be catched with event structure. When an event is unregistered, it will be ignored by the event structure. To register events, use register for events node and wire your boolean control reference as the event source. To unregister events, use the same node but this time use existing dynamic event registration refnum and wire null reference to the to the event source input. So actually you change your event to listen to a non-existing boolean button instead of your real one. Then you can change it back when you feel like it.

    For more details see an example VI Dynamically Register for Events.vi shipped with LabVIEW located in labview\examples\general\dynamicevents.llb

    Cheers,

    Tomi

  2. QUOTE(Gavin Burnell @ Jan 8 2008, 12:07 PM)

    Has anyone out there succeded in adding an XNode to a LabVIEW class ?

    I don't think it's possible to get XNodes to even work with LabVIEW classes. LabVIEW simply crashes when a class type wire in connected to an XNode. At least this is my experience. Do you have some knowledge that would allow using XNodes with LabVIEW classes? I would really love to use XNodes with LabVIEW classes.

  3. QUOTE(Aristos Queue @ Jan 6 2008, 09:10 PM)

    There is no programming language in existence that allows this. None.

    Actually there are languages that allow recursive types without reference mechanism. However I think at least in eager languages there must be a mechanism to end the recursion. Lazy languages could possibly allow infinite recursion that simply is not evaluated until needed. C++ pointer mechanism that AQ referred to is one way to end the recursion. Anohter way to end the type recursion is to allow a variable to be of type 1 or type 2. Let's use symbol '|' to denote for this type of or. Then we can define a recursive class

    Class A(y) {

    x : A | Nothing
    = y

    }

    where the class A has a variable x that can either be of class A or of class Nothing. The class Nothing is a empty Class with not functions and not private data. We now can define a few variables of class a.

    a1 : A(Nothing);

    a2 : A(a1);

    a3 : A(a2);

    A lazy language could have something like this

    Class
    NaturalNumber
    (
    initialValue
    ) {

    next
    :
    NaturalNumber
    (
    initialValue
    +1)

    function
    getValue
    { return
    initialValue
    }

    }

    The constructor parameter initialValue is a number that is passed to the class when created. We assume that constructor parameters are stored byt the language as a class private data automatically. The class has a private data called next. However next not initialized until referred to; lazy languages compute data only when the data is actually needed. Now we can define all natural numbers the following way

    naturalNums = NaturalNumber(0); // initialize class NaturalNumber with constructor parameter 0.

    We can get the three first natural numbers with the following lines

    naturalNums.getValue; // returns 0

    naturalNums.next.getValue // evaluates initialValue (1) of naturalNumber.next and returns it

    naturalNums.next.next.getValue // evaluates initialValue (2) of naturalNumber.next.next and returns it

    So to conclude, AQ, never say never;)

    APPENDIX - Notation

    Class definition:

    Class ClassName(list of constructor parameters) {

    class body

    ...

    }

    Function deifinition;

    function functionName(list of arguments)

    {

    function body

    ...

    }

    Variable definition:

    varname : VarType | AlternateType | AlternateType [= initial_value]

    Variable definition with constructor parameters:

    varname : VarType(constructor arguments)

    Class construction:

    • Class argument list is stored as if it was private data.
    • Class body is executed

    Edited several times, last edit at 8.17 pm GMT

    --

    Tomi

  4. Actually one thing came into my mind. Opening a web page using ActiveX intefrace may be a security issue. As a result it may be that some security software such as virus protection or malware protection may disable this feature from Windows. So I suggest you investigate if disabling your virus protection has an affect to this HTML help issue.

    Tomi

  5. Thank you all! I really enjoy your company, otherwise I wouldn't have made that many posts :) Don't stop keeping interesting discussion going on... I'll keep up trying to participate these discussions regularily and I also try to occasionally keep posting thse hurts-the-brain issues. ;)

  6. QUOTE(Jim Kring @ Dec 27 2007, 12:35 AM)

    Then you should set the XP process scheduling system to work the same way as in Windows 2003 server where the front most processes don't get extra "boost". The instructions how to disable the boost for front most applications can be found for example in this blog entery. The blog also instructs how to modify the time slice used for process scheduling. Surely you can also run your LabVIEW apps under Windows 2003 server as well if you don't want to use the tricks. If you don't need to do this programmatically, you can disable the front most application boost from Control Panel -> System -> Advanced -> Pefromance -> Advanced -> Processor Scheduling.

    The second thing you may want to do is to set your application priority above normal. This can be done by calling the Windows API function SetPriorityClass. I don't know if LabVIEW uses this API directly as well to set the priority of different scheduling systems. You propably can call this function directly from LabVIEW by configuring call library node to use Kernel32.dll. Also take a look at these lecture notes, beginning from page 30 the Windows XP process scheduling system is covered.

    I must confess I've never used these tricks, I just know they exist. So you're on your own if you try these. Please report if you had any success.

    Tomi

  7. In LabVIEW 8.5 there is something called Native 3D Graph under the folder

    LabVIEW 8.5\Native 3D Graph

    Anyone has any experience with this package? Is this something supported or something forthcoming that was accidentally included into the build? Seems interesting though, especially the 3D XControl. Though I'd like to be able to draw multiple surfaces and set suface properties such as transparency for each surface separately.

    Tomi

  8. There are a few alternatives to call Matlab code directly from LabVIEW. First in the latest LabVIEW version 8.5 there is a new structure called MathScript node. This structure can execute Matlab scripts directly within LabVIEW. However not all Matlab functionality, especially toolkits are available. Then there is an older structure called MATLAB Script node that uses ActiveX under Windows to communicate with Matlab installed on your computer. Third option is to call Matlab directly via the ActiveX interface. Refer to Matlab documentation to find out how the ActiveX interface can be used to call Matlab from external programs.

  9. QUOTE(mballa @ Dec 13 2007, 09:13 AM)

    I had two vis with the same name "Build FLD Record". One owned by a class and one that wasn't

    If I were to remove the owned one from the class lvlib I would have two vis with identical names.

    If this is the case then you can simply rename the VI you want to remove and then remove. What always works is removing items from a class by editing the .lvclass file with a text or an XML editor. This never fails :)

    Tomi

  10. QUOTE(Paul_at_Lowell @ Dec 11 2007, 07:11 PM)

    What does a black border on a class (LVOOP variety) indicator mean? (Usually the border is gray, as in the first example, but sometimes the border is black--see the second example. I vaguely remember reading somewhere what this means, but I can't remember where.)

    I think it means that the value of the class constant differs from the class default value.

  11. You don't need to place all VIs within the executable but you can also add VIs outside the executable into one or more support folder. If this is not a problems for you, then you can add your VIs you need to list into a support folder and list the content of that folder. I'm not sure if the content of LabVIEW executable is listable. If it is, there is no guarantee that it will remain such in future LabVIEW versions. So to play safe, you shouldn't rely on listing the content of the executable. Another thing you can do is to store the names of the VIs within the executable into an external file. Then use this file to get the list of the VIs in the executable.

×
×
  • Create New...

Important Information

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