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

Tags: NI Software

Similar Questions

  • 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

  • "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.

  • 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!

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

  • You cannot use a remote location like a cache of the project folder.

    I get this message when you try to activate SCORM in my project, how can I publish?

    You cannot use a remote location like a cache of the project folder. Please enter a valid address to continue.

    Any ideas are appreciated!

    Hello

    Can you check edit > Preferences > General settings.

    and check the location of the cache folder and the project preferences.

    This location by defalt is: C:\Users\ user\Documents\Adobe put Captivate cached ongoing projects

    Please check this and respond

    Thank you.

  • need to know how to block the ophcrack from running, my child uses this to get my password and in the parental controls in vista

    you want to know how to block the ophcrack from running, my child uses this to get my password and in the parental controls in vista. I have 3 accounts going 2 for children and one for the parents/administrator. I found ophcrack in several places on the computer. any help would be greatly appreciated

    The only question the idea of Malkeleah, that is when you put a password on BIOS, all you need to do is pop the battery from the motherboard and the password is gone. Faronics has in some programs such as anti-executable and a few other programs that may block the name or ID of a process and prevent it from running (some antiviruses have that option, such as Avast, but usually is a pain in the ass to configure)

  • Question about cast of more generic class

    I refnum controls and pages refnum and I want to know where is the best:

    (1) let LabVIEW doing work

    or (2) use the 'more generic class type conversion.

    In both cases the VI works fine.

    Thank you

    Jean-Marc

    'that's better... »

    I can't say definatively, but I've generally will do top-cast to build a table that you have illustrated LV.

    EDIT

    I just noticed your case apperas to have 50 more digital cases. What you do with this code? We may be able to offer alternatives (maybe).

    Ben

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

  • DB used space much more that I loaded into the DB

    Hello

    I use OBI and the default database that is created by the Setup program. Through the Warehouse Builder I loaded a total of 100 MB of data in the database, but
    the space used in the USERS tablespace shows more than 800 MB. The SYSTEM tablespace is not small either.
    Why are my big storage space? I use of total space to 2 GB? -C' is 20 times the size of the actual data that I loaded.

    [Print the screen size and storage spaces | http://www.metallon.org/test/space.png]

    I would be grateful for any ideas.

    If you insert into a table and then delete, remains the high-water mark.

    If a table is empty, you can truncate to reclaim space. If it is not empty you can reduce it.

    Alternatively, you can rebuild the big index to recover the space.

  • Is it possible to call a function in a parent of a child component component in Flex 3?

    It is probably a very basic question, but ask for this for awhile.

    I need to call a function in a parent component and the appeal of its child element in Flex 3. Is there a way to access an element functions of the child element parent? I know that I can send an event for children and add a listener in the parent to call the function, but just wanted to know if could also directly call a function of parent of a child (similar to how you can call a function in the main mxml file using Application.application). Thank you

    There are no performance issues, but it's ok if you use the child component in a single category. Suppose that you want to use the same component as a child to a lot of parents then if all the following

    public interface IParentImplementation{
    
         function callParentMethod();
    }
    

    and the parent of the class has to implement this 'IParentImplementation '.

    usually to the next line

     public class parentClass extends Canvas implements IParentImplementation{
              public function callParentMethod():void{
         //code
              }
         }
    

    in children, you should do something like that.

    (this.parent as IParentImplementation).callParentMethod();
    

    Here the use of Interfaces, we're to decouple the parent and child

    If this post answers your question or assistance, please mark it as such.

  • 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

  • Cannot use touch screen when you reload, ghosts in the machine.

    Fellow, Hello forum members

    I have a few questions:

    1. when my Atrix is plugged into a wall outlet, the touch screen is no longer works, is this normal or is at - it a way to change this?

    2. I have the setting to exit the screen on when charging, when I leave it all night, I'll be back in the morning and strange things have taken place, the phone is located in the middle of an application, or text message or something weird, like ghosts in the machine, you cannot disable the app/text until you unplug , because of the #1, so I don't think its someone accidentally touch.

    Thank you

    TGH

    The Atrix is very picky with the Chargers. Use the one supplied with the phone. I had the same problem with my old HTC charger. The panic phone. I changed the charger HTC on an another outlet and it worked. I always recommend no. to use your "old" Chargers

  • TestStand 4.1.1 crashes when you use two or more "perform asynchronous VI" at the same time

    I'm under a terminal constantly reading window from a serial port running in a different thread using "Run asynchronous VI".

    Towards the end of the test, I open a separate VI in another thread also uses "asynchronous Execute VI.  This VI reads constantly the Ethernet packets.

    I'm running the sequence in the user interface of C++ and for some reason, once in a while TestStand crashes and in the dialog box it said it

    "The MFC example user interface has encountered a problem and needs to close.  We are sorry for the inconvenience. »

    The error signature:

    AppName: testexec.exe AppVer: 4.1.1.55 ModName: msvcr80.dll

    Any of you have an idea as to why he would do this?  Also, what is the best way to open and close these threads?

    Any help would be greatly appreciated.


Maybe you are looking for

  • My Macbook Pro equipped of El Capitan system seems to use about 50% of my HD space!

    My Macbook Pro (mid-2015), El Capitan system seems to use about 50% of my disk space is this normal? So much so that I can't install updates of applications - y at - it something I can do?

  • How to enable text search in my work Microsoft Office account with 12 Firefox

    I just upgraded to 12 of Firefox, and I have a problem. When I connect to my Microsoft Outlook work e-mail account remotely, the new Firefox does even not recognize that there is a search text field where I can type in my Outlook window. It happens e

  • How to change an email eprint?

    I just set up my printer OfficeJet 4620 e and has been assigned an e-mail address for that I would change. Is this possible?

  • Stucks bootcamp.

    Hello, it is not the first time that I install Windows 10 to my macbook pro retina end 2013. Although this time I experienced anything unusual. When the installation process of bootcamp reach the Realtek drivers, it stuck there forever. I tried to in

  • OSX Server Postfix does not start - help!

    Hi all I inherited a 10.7.5 os x server. He currently acts as a mail (IMAP) server. When I click on start mail - it stops just again. Clients use the imap Protocol to send or receive mail, they had on another account. The used imap server as a storag