Eugen Graf Posted June 15, 2008 Report Share Posted June 15, 2008 Hello, I have to generate a random unsigned integer from 0 to max. possible. So I take "Random Number 0-1.VI" and multiple it's output with eg. 65536 (for U16). Ok, but if I would change the representation to U32, so I want programmaticaly know that I have to take 2^32 for my max. value. Is it possible to get the representation of the wire? Should I flatten it to binary and use type string for it? Here the screenshot Quote Link to comment
Yair Posted June 15, 2008 Report Share Posted June 15, 2008 I don't understand what it is you want to do. If you want to change the output based on the type of the input the easiest and most reliable way is to use a polymorphic VI. Another option is to just use DBL which should cover most other representations, I believe. OpenG has a function which does exactly this and accepts DBL. It might have polymorphic versions, but I don't think it does - the cleanest thing is probably to output the double value and then convert it after it leaves the subVI. Quote Link to comment
Eugen Graf Posted June 15, 2008 Author Report Share Posted June 15, 2008 QUOTE (Yen @ Jun 14 2008, 09:54 PM) I don't understand what it is you want to do. If you want to change the output based on the type of the input the easiest and most reliable way is to use a polymorphic VI.Another option is to just use DBL which should cover most other representations, I believe. OpenG has a function which does exactly this and accepts DBL. It might have polymorphic versions, but I don't think it does - the cleanest thing is probably to output the double value and then convert it after it leaves the subVI. Yeah, polymorphic VI is the right solution for this, I think. Thank you, Yen 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.