FSVZ Posted May 4, 2006 Report Share Posted May 4, 2006 I'm stuck right now, so I thought give it a try. This is what I want to achieve: I have one Vi to inside another Vi. Lets call the first one "inner" and the second one "outer". The "inner" Vi is a Vi which communicates to a python server (tcp-connection). The protocol is already implemented and works for sending over strings which are provided by the "outer" Vi. The procotol is designed in such a way that not only strings should be transmited, but also boolean and numbers. Now the problem rised. The outer Vi provides a value of a certain type. The inner Vi should figure out which value and type is provided by the outer vi, so that it can fit it into the protocol. In other words, the inner Vi should be made more general in accepting values and data types. In this way it can act as a blackbox to which an value is given. I hope someone can help me out. Quote Link to comment
Louis Manfredi Posted May 4, 2006 Report Share Posted May 4, 2006 Hi FSVZ: Try searching LabView help on "Variant" data types and "Polymorphic" vis. I'm pretty sure what you want to do can be done & from the way you form the question sounds like you'll be able to get a good start-- if not the whole answer-- searching on those terms. Good luck, keep us posted. If you run into difficulties some of us (not me unfortunately ) know quite a bit about how to impliment these things. Best Regards, Louis Quote Link to comment
didierj Posted May 5, 2006 Report Share Posted May 5, 2006 Try searching LabView help on "Variant" data types and "Polymorphic" vis. I'm pretty sure what you want to do can be done & from the way you form the question sounds like you'll be able to get a good start-- if not the whole answer-- searching on those terms. Regarding the "poymorphic", check the ini-file functions in your palette. You don't have to use the full complexity, but it gives the idea. Have separate vi's for opening and closing the port, and a set of vi's (grouped into a polymorphic vi) that do the transmission for a specific datatype. This way you can add a new vi with a new datatype when need rises. If you prefer the variant datatype, check OpenG. There you'll get (by installing OpenG commander and downloading the packages) a whole set of vi's to work with variants. Didier Quote Link to comment
FSVZ Posted May 5, 2006 Author Report Share Posted May 5, 2006 Regarding the "poymorphic", check the ini-file functions in your palette. You don't have to use the full complexity, but it gives the idea. Have separate vi's for opening and closing the port, and a set of vi's (grouped into a polymorphic vi) that do the transmission for a specific datatype. This way you can add a new vi with a new datatype when need rises.If you prefer the variant datatype, check OpenG. There you'll get (by installing OpenG commander and downloading the packages) a whole set of vi's to work with variants. Didier I'm fairly new to labview and I'm the only one using it for my thesis. Anyway I created a Polymorphic Vi and I can now connect all the wanted data types I want to it. However to create a connector (to another Vi) a control is needed. But when I create a connecter the type is bound and a polymorphic vi turns into a static Vi. So if there exists a "polymoric" control my problem is solved If anyone has an idea for this, your welcome to post. Gr FSVZ Quote Link to comment
didierj Posted May 5, 2006 Report Share Posted May 5, 2006 However to create a connector (to another Vi) a control is needed. But when I create a connecter the type is bound and a polymorphic vi turns into a static Vi. So if there exists a "polymoric" control my problem is solved It is normal that the poly-vi is turned into a static vi. LV is datatype bound and so your "outer vi" supplies a value of a known datatype. LV recognizes it an on a double-click on the "innner vi" opens the correct "static" vi. That's the reason why you make poly-vi's. They are just a container for a collection of similar vi's (same operations, same connector panes, but different datatypes as input/output). While plopping a poly-vi onto the block diagram, it recognizes the needed datatype and places the correct collection member on the block diagram. Quote Link to comment
FSVZ Posted May 7, 2006 Author Report Share Posted May 7, 2006 After a , I changed the scope of the Vi's by adding a few sub-Vi (in that way the scope of the Poly-VI has been changed). Solved my problem, but it's a pitty that there are no poly-data-type wires. Quote Link to comment
jpdrolet Posted May 7, 2006 Report Share Posted May 7, 2006 ..., but it's a pitty that there are no poly-data-type wires. There is and it is called a Variant. Re-read previous answers more carefully. Quote Link to comment
PJM_labview Posted May 9, 2006 Report Share Posted May 9, 2006 There is and it is called a Variant. Re-read previous answers more carefully. and there is a EXAMPLE - Python Client to LabVIEW Server using variant to convert data to and from python here PJM Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.