On a more specific class or the variant

Which of these methods is preferred for the update of GUI? Any show hit with for Variant?

Out of curiosity and for a fan of Top Gear (real BBC version, not lame History Channel knock-off) colleague here are a few quick comparative data:

Another case where fear of stress points leads to evil.  Put in explicit conversion of the type variant slows things down a bit more than the specific class that I suspect (but didn't).  However, my strategy to connect life with the point red and right value help considerably, as the implicit conversion is as fast as a bound property node (laziness country off, yes!).  Inhabitants of smoke just PNs, but we knew that and I just wanted to see with my own eyes.

Tags: NI Software

Similar Questions

  • Cannot use casting "to more specific class ' function to the parent class of child class

    Hello

    I am using OOP for my request for data acquisition. I have different e/s analog and digital materials. I create a superclass named DAQ.lvclass. This class has four childs: analog in out analog, digital, and Digital Out. I am trying to invoke screws of the child of the parent class's class. For that I am throwing the class parent her child to aid "to a more specific class' function. But I get the below error.

    Error 1448 occurred at the more class specific in DAQ.lvclassMain.vi AQ

    Possible reasons:

    LabVIEW: Bad type cast. LabVIEW does not deal with the run-time value of this class of LabVIEW as an instance of the given class of LabVIEW.

    How can I handle these cases where I have to call child VI of the parent member?

    I have attached two screws 1 snapshot. Main DAQ: it's the class main VI parent who manages all functions. 2. read the analog inputs: this VI trying to set the parent class for its class of the child and child vi reads value of data acquisition task. I get the second error off VI.

    Kindly help.

    Honestly, I have NO idea on what you want to do.

    Inheritance of classes in EACH OOD (object-oriented design) requires to define common ground as the parent class. Children can add things like properties and methods.

    If you set children who have no points in common, you have made a mistake.

    If all children have too many different specific methods, your OOD is absent.

    Example:

    Parent defines the method A.

    1 child adds the B method.

    Child 2 adds method C.

    But method B will not be usable on 2 children while method C will not work with 1 child.

    It is an approach that you want to prevent. In any programming language oriented OBJECT. This adds unnecessary complexity leading to difficult to maintain the code, and it is prone to errors.

    However, if you're going to do, "to more specific class ' is the correct type cast. But your screenshots and error messages, it is obvious that refine you a particular child's casting only. You must extend the code to check the real child, specifically expressed and call the method. That being said, your code increases the complexity you want to add a bunch of case of structures which essentially nihilates all THE BENEFITS of the use of OOP.

    I'm sorry to say that.

    Norbert

  • Type mismatch and VI properties in 'for more specific classes.

    Dear all

    I have a Subvi trying to modify the properties of certain objects on the main pane of the front, in the example I have attached to this message it works well, but when I use the same Subvi in my main application which is a little bigger and has more hierarchical levels (that's why I join this one) it comes across some errors.

    Once running "to a more specific class' in the Sub - VI called ("MultpObj1N"), it gives this error that" LabVIEW: Type mismatch: object cannot be cast to the specified type.»

    I have no idea what could be the reason for this. Do you have any idea what it could be?

    Best regards

    Afshin

    Dear Darren

    Suddenly, I realized that my problem just happens to group objects (no cards) and like you said the type of data were different. Because I wanted to just access the visibility as you suggested, I've changed the strict form for normal and it worked.

    Thank you very much for your advice!

    BR

    Afshin

  • Close the reference (for a more specific class)

    I'm feeding a control reference to the node "to a more specific class.  When I finished, I understand that I have to close the order, but what I also close the reference that is the output of the node "to a more specific class?

    This is the same reference... There is no need to close the two.  And if you approve the automatic cleanup of references LabVIEW, you really do not need to close, as the references control must never be matched and will be automatically cleaned when your VI is inactive.

    For more information, here is a blog that just now, I wrote that talks about closing reference.

  • Properties of the component of modifing Cluster on sbRIO? No node "to more specific class?

    Hello

    I designed a fairly large RT application.  Our structure is to have our main vi RT with several large groups which pass into subvis that modify the components of the pole passed through its reference. (Easy) In addition, we have to change the properties of the cluster component as well. Other examples, to change the properties of a cluster of referral component, we do:

    (1) obtain controls [] property of the cluster

    (2) of the index in the [] for the component Control

    (3) class "to more specific" use with the exact type of the component

    (4) fix a property node to access the property of desirec

    It worked well except that we are currently making a sbRIO system. All the 'to more specific class' now are broken with the error message that this node "only is not supported on the current target".

    I spoke to a representative of OR who says that 'To more specific class' is NOT supported on the real-time hardware. If this is the case, how one is changing the properties of component a cluster without using the node "to more specific class?

    A simple example is attached. It shows a simple cluster of two components that must have their properties changed. It works fine on a material in real time (such as a host PC). It breaks on our sbRIO.

    Yet once how one change properties of a component cluster on a system in real-time like sbRIO?

    We use LabView 8.6.1 on a sbRIO 9642.

    -Paul

    I installed LabView 2009 today and here it is--the "to more specific class" node is now permitted on a real-time target. Nothing in the documentation indicates that it but I'm not complaining. You can now change the ownership of a cluster component in a subvi on a real-time target. Thanks to which it is fixed that!

  • "For more specific class" does not not on sbRIO 9636

    The application that I am forcing me to programmatically access arbitrary components of a nested group. Currently, I am doing the browsing the cluster using his property [] node recursively controls. Currently, my accessor VI to accomplish this works very well on a normal PC but does not work on my target in real time, a sbRIO 9636.

    After some research, I determined that the function "To more specific class" does not work on my target in real time. I have attached a code base that shows the heart of the problem. It works fine on a PC but will return an error 53 when running on my target in real time.

    A few questions:

    (1) is 'To more specific class' supported on the sbRIO 9636 or not?
    (2) if it is supported, what am I doing wrong?

    (3) if it is not taken in charge, what are other methods for access by the arbitrary elements of a nested cluster program?
    (4) if it is not supported, why LabVIEW allows me to place the feature even when the sbRIO 9636 is explicitly selected as my goal in my LabVIEW project? It seems prudent to restrict its use, if it is not supported. My day job has been effectively wasted because of this problem.

    For reference, here's a few previous discussions

    http://forums.NI.com/T5/real-time-measurement-and/modifing-cluster-component-properties-on-sbRIO-No-...

    http://forums.NI.com/T5/real-time-measurement-and/quot-Manager-call-not-supported-quot-when-typecast...

    Thank you
    JAnthony

    The other posts are correct, because it is currently not possible to use the function on a real-time target. This is a known issue and is being investigated for correction, but currently there is no work around. It is available on the pallets that this behavior is not intentional and should work.

    You have described your application requires that recursively through a table and access to specific data. Does this mean that the Data Structure might be different when the vi is run and you need to adapt to a changing data type? If this isn't the case, then all you need to do is to get the value of the reference and then ungroup the cluster as needed then store the changed values to the same reference.

    If you're going to have to settle you will encounter difficulties to be determined pragmatically you should do but I have a suggestion. Create a cluster with an enum and a Variant. You can use the enumeration to set the type of the variant in question. He chooses the type to convert the variant according to the code. It is a similar structure, like messages in queue manager and his messages that happening except that you will be passing a reference to this group that has both the message and the payload in one. The reference could be used to get the value and then the code must only be written to accept the Cluster of Enum and variant you can then convert the variant to the appropriate type for later use. For best performance, you also use in Place of the Structure element.

    It's only a means potentially accomplish what you want. If you describe your program and needs more in depth, we are able to offer a more suitable solution for your application that does what you need. I wish you a nice day!

  • to a more specific class: can't find not strictly digital, only digital

    Im trying to read a property of the control based on some controls that are in a cluster.

    I want to convert to a more specific class property reference: digital strict, but I find only 'digital' which leaves me with variant data.

    Any help?

    Right-click the control switch, and then create a reference. This reference to the entry "class of target" of the cast of the wire knot.

  • Cast: more specific type where the object EXPECTED

    I extend an interface that expects an argument of type Object. My implementation of this interface knows that the object passed is a specific class, I've defined. I can't compile my code no matter what I try, because of the error "incompatible types.

    In my case, I set my own observer / Observable class. Below is the method of observation which does not compile:

        public void update (Observable obj, Object arg) {
            if (arg instanceof Message ) {
                message = arg;
                if (message.success) {
                    System.out.println("received success notification ");
                    // do some other stuff
                } else {
                    System.out.println("received failure notification ");
                }
            } else {
                System.out.println("received notification without a valid Message");
            }
        }
    

    I tried a few other forms that do not work also. I like to keep my interface like that so that I can reuse it in other places. What I really want is to cast 'arg' of a generic object of type "Message", but this does not seem to be supported in the desktop. Thoughts?

    You are missing a cast. Also, I don't see where the variable 'message' has been declared.

    Try this:

    If (arg instanceof Message)

    Message message = arg (Message);

  • Web service for a more specific class when compiling

    Hello

    I just started using labview generator of the user Web interface and I have a problem when I generate the project.

    I recover data with the service and all works well when the application runs in the generator of the user Web interface of labview environment.

    But when I build the project, the Web API service is not recover my data. After a few debbuging, it seems that the problem comes from the block 'Parse Web Services', which returns nothing.

    Someone has an idea?

    Thank you

    I called the support OR and the response was:

    Name of the object should never have special characthers as e, to, o (in french) etc...

    The reason is that the application is generated by a server OR English on the web.

    So for the french, think of never having name determined that contains special characters.

    Otherwise, the application will run in the development environment but not after compilation by the server OR.

    Good bye

  • Tweak performance for node LV Classes and "more specific."

    Here's a tip for performance on the node "to more specific" and the classes of LabVIEW.

    This message is for those who really need every drop of performance rush of LabVIEW code. It won't make much difference in most applications, and make the code more difficult to read is generally not a minor speed bump. On the other hand, sometimes this trick can help you avoid a copy of important data.

    In general, it is best if you can simply add a dynamic distribution VI to your class hierarchy to make specific to the type of work, but there are cases where it's just not possible. When this happens, a programmer reaches for the node "to the more specific" test type. Here's a typical piece of code:

    This code works! Let me tell you: this code works. It does exactly what you expect: If the object is a particular type of child, she changes the subject. If the object is another type, it makes the object unchanged. And if the performance of your application are pretty good with the code above, I encourage you to leave him alone. It is easy to read, and a book of readability outweighs an ounce of performance. But if you hit a few bumps on road performance, read on.

    So, what's the problem? The problem is that this code makes a deep copy of the object. When the node to more specific runs, if the object is not the desired type, then the output is changed to become a default instance of the desired type. This means that the wire branch which has the original value of the object must be a copy of the object where the original value is preserved. Even if these two sons back together further downstream, it is impossible for the compiler to the LV to avoid making this copy in the meantime (I continue to ask the compiler to brainstorming team in this area in the hope of a cool breakthrough).

    Is there a solution? Almost. The following workaround solution did not work in LV 2011, but the compiler has learned a new trick in 2012 of LV, and I want to share with you all now so that any of you write code today will get improvement when you upgrade.

    LV 2012, the following code will prevent the copy of the object:

    We have taught the node to be more specific to be aware when its output is unwired and not tell the compiler that it changes the input object. This means that the first "to more specific" has simply type tests and never modifies the object even if the cast fails, then the original object remains available for the structure of the case. The second "to the more specific" is casting.

    This duplication of the node to more specific means that you do the control of type double, which is a minor performance overhead. For some very small classes, I can imagine that the time to duplicate the object can be smaller than the time to make the second type control, but I seriously doubt that's going to be true for any real type in one of these situations.

    So if you're writing this kind of code in 2011 (or sooner) type checking and the need for representation thrust, you can start using this model of "double to more specific. And then when you migrate to 2012, your screws will get the benefit. On the other hand, if your performance is today very well, leave the code alone and just let the compiler change over time until that one day he can avoid the copy in the case of simple code.

    Thanks for the tip.  Are there other primitives, on top of your head, that only perform a subset of their features, while some of their productions are unwired?

  • How he handles the labview to more generic class

    It's just a matter for my own knowledge of curious nerd. If you, say, have a cluster that contains a string, a Boolean value, and a digital control, a common method to reference the controls in the cluster is to create a cluster of reference and then to get the array of control from a property node. So let's say I wanted to put the Boolean value true, you can auto control array index and cast in more specific class boolean and set value via the property node (see below).

    Now my question is, to place controls of different types in a table must be returned by the property node, they must all be of the same class. How LabVIEW manages it? He cast as a more generic class backstage? If so, how this work because it is generally dangerous to come back from a class derived from a base class because the data can or will be lost.

    Furthermore, a standard molded type takes just a binary model and interperates as differently it based on the data type. So how is "of a more specific class" able to raise an error if a generic control reference cannot be transformed into a class more specific. For example, in the attached photo, a control string reference would be mistake out there, but how? They are all classes of generic control when they get out of the property node. Is there some type of indicator in the generic control reference indicating the type? Maybe I think about this fundemtally wrong. All I can think is that the more specific / are more generic vi no type casting (which I guess they are not because it has separate type cast feature).

    Can someone explain how this all works. Inquiring minds want to know.

    for (imstuck) wrote:

    Now my question is, to place controls of different types in a table must be returned by the property node, they must all be of the same class. How LabVIEW manages it? He cast as a more generic class backstage? If so, how this work because it is generally dangerous to come back from a class derived from a base class because the data can or will be lost.

    Furthermore, a standard molded type takes just a binary model and interperates as differently it based on the data type. So how is "of a more specific class" able to raise an error if a generic control reference cannot be transformed into a class more specific. For example, in the attached photo, a control string reference would be mistake out there, but how? They are all classes of generic control when they get out of the property node. Is there some type of indicator in the generic control reference indicating the type? Maybe I think about this fundemtally wrong. All I can think is that the more specific / are more generic vi no type casting (which I guess they are not because it has separate type cast feature).

    Can someone explain how this all works. Inquiring minds want to know.

    I don't know all the details, but I would say you got it mostly right - there is an implicit conversion to a more generic type.  You will see this in several places in LabVIEW, for example, you can wire references to different types of controls in "table to build" to get a picture of their more specific common parent.  Because you're only casting reference - not the data that it contains, there is no loss of data.  A LabVIEW reference is just an I32 is (I assume) an index into a lookup table somewhere.  The value of this I32 does not change when it is converted into a more generic reference.  When you do "to more specific Type", LabVIEW raises this reference in the table and uses the data it found to determine if she can make the cast.  Who help me?

  • More specific anti-aliasing prevents multiple images rendering at the same time after awhile

    Hi all.

    I am experiencing inconsistent memory, behaviour management when rendering my AE project that prevents me from making several images at the same time when some elements of film use accurate antialiasing.

    I have a processor 8-core i7 MacBook Pro with 8 GB of RAM and I am using AE CS5.5. I visited a project with several Illustrator layers imported to keep things nice and crispy. Here is a 3D with one camera, DOF, composition and they are continuously rasterized. On some of the vector assets I have to set the antialiasing for "More precise" in the dialog box interpret footage to address some problems with image quality. Here's what I noticed when rendering:

    1. when anti-aliasing on all assets of Illustrator is set on "Faster" return it without issues composition.

    2. I change the setting of antialiasing on some assets of the Illustrator to "More specific" to improve the quality of the image. Made of several images at the same time is off. Composition makes for a while, but eventually I get an error: "after effects error: unable to allocate enough memory for file antialias (50:5).

    3. to work around the error I load AE to empty the memory cache all 5 images or less via the Secret menu in the preferences. This prevents the error from happening and I can see the RAM being deallocated when from time to time as expected. This allows me to return the quality I need, but it is slower.

    4. in order to expedite things I light made simultaneous multiple images. I use the conservative settings: AE is to use only two hearts with 3 GB of RAM by heart (the maximum allowed). The rendering is accelerated. However, I see that the system "in use" RAM continues to increase at each image made up until the computer runs out, how AE automatically turns off made simultaneous multiple images and begins to display one image at a time. This does not happen whe all vector assets are defined to use fast antialiasing one I can make indefinitely with simultaneous multiple images rendering, but I don't get this way the desired quality. Please note that there is enough RAM for the carrots for multiple images rendering, but it seems as if having made a frame, the system is not free or reuse the memory when assets use specific anti-aliasing and will use another piece until there is no more.

    Also, I'm outputing to a sequence of images.

    Please help me to find a workaround for this problem. Thank you!

    This is probably a software design limitation (or bug) in the underlying code of Illustrator and there is no work around for this. You might dutifully report it here, but it's as good as it gets, and even when you do, you shouldn't be pregnant it be fixed anytime soon. In 12 years of use AE, that kind of thing never worked 100% right...

    Mylenium

  • Casting of object type to aid to more specific

    Hello

    I'm bit stuck in the legacies of the class in my current project. I implement a zero-coupling messaging architecture that uses variant tables to store objects to be cast to sample.

    The good news: it works in general, little we take a peek at some photos

    I tried the script of coulee before using an example that works as expected.

    Shows probe resulting:

    The Message of abstract [14] is cast to the more specific Message for the controller test [15], [9]

    Now, this implementation with the variants table, change things unfrotunately:

    The only thing that apparently changes is, as the class to be cast to a return value of a Subvi (actually reading the table variant) [12].

    As shown in the probe that the casting does not work this time... There is also no error on the terminal error.

    I have to admit, I'm quite confused... especially because in another class this exact methodiolgy works...

    Any thoughts?

    See you soon

    Oli

    Cast throws more specific to the type of object shown on the thread in the IDE, regardless of the type of the actual object passing along this thread (i.e. type of YARN and not DATA type).

    I bet that your wire to the Center terminal of the 'to more specific' is a son of the same type as the object you are trying to change but actually a more specific object.  The 'Cast to more specific"is a compiling decision, not a decision of execution. As such it takes the type of thread, not the object type for the casting.

    Look at the names on the left of your probes, they are all the same in the example below (all wires are nominally of the same type).  It's the onfo LV casting (assuming the names corresponding to the nominal type of the thread) not use content REAL of the wire.

    Shane.

    PS to make things clearer, give each hierarchy in your legacy a different aspect of wire.

  • How I write more specific instruction of if at the same time!

    I'm trying to use an IF / formula of EELS in JavaScript for autopopulate a text field in a table, but I get a syntax error.

    Could someone please help?

    and I want to write a specific text on the cells of a table, but before I want to check if this cell was empty or not, if it's empty (this cell1.rawValue = 'text') silt must go in the cell 2 silt and piloted at the other. And so on.

    Tabel1

    1Yes
    2None

    tabel2 |

    cell1"text".
    cell2
    cell3
    cell4

    something close with that can help you understand me more: (it's not really in the code)

    If tabel1.rawValue = 1

    and if tabel2.cell1.rawValue is nothing then

    tabel2.cell1.RawValue = "text".

    on the other

    If tabel2.cell2.rawValue == null then

    tabel2.cell2.rawValue = "text".

    Silt

    If tabel2.cell3.rawValue == null then

    tabel2.cell3.rawValue = "text".

    Silt

    If tabel2.cell4.rawValue = null then

    tabel2.cell4.rawValue = "text".

    Silt

    {

    xfa.host.messageBox ("there is no space in the table!");

    }

    Thnak you! I wish you can help me!

    Hello

    before understanding in JavaScript syntax, there are databases, you need to understand with operators

    JavaScript operators:

    the use of "=" is to assign a value to the value of the left side of the operator (this operator should not be in an if statement)

    the use of "is" is to compare the 2 values

    for another explanation on operators, search for 'Operators JavaScript' on google

    JavaScript syntax:

    "then" is omitted in JavaScript and {} is used instead

    don't forget to put the end of line (semicolon) on each line (excluding statements (if, switch, otherwise ElseIf, etc...))

    If (tabel2.cell1.rawValue == null) {}

    tabel2.cell1.RawValue = 'text ';

    } Else if (tabel2.cell2.rawValue == null) {}

    tabel2.cell2.RawValue = 'text ';

    } Else if (tabel2.cell3.rawValue == null) {}

    tabel2. CELL3. RawValue = "text";

    } Else if (tabel2.cell4.rawValue == null) {}

    tabel2.cell4.RawValue = 'text ';

    } else {}

    xfa.host.messageBox ("there is no space in the table!");

    }

    To help you understand how to fix your JavaScript syntax, you can use the validator to syntax like, Esprima: validator for syntax

    More information on the syntax JavaScript can be found on google, W3Schools is a good start

    I hope this will help you!

  • In the 11 elements, I would like to learn more about slideshows. The specific individual slide duration.

    In the 11 elements, I would like to learn more about slideshows. The specific individual slide duration.

    Donald,

    There are two ways to address still Image duration. One is global and applied prior to importation. We could determine the desired approximate time, come on in Edition > Preferences > General > always in time. Then, all imported pictures have that duration (as well as titles and new features, such as video of Black).

    Once this general term has been defined, we can again and on an Image by Image basis, click on + drag on the rest of the Image, tail or head, to adjust the duration. By doing this, I would have the info panel open and visible, to see exactly how long I've changed.

    Good luck

    Hunt

    PS - I think you will love the book of Steve.

Maybe you are looking for