04-03-2013 02:06 PM
HI!
I am making a project were I should fill matrix with selected data type, but I have problem with selecting different data type.And this will be a part (subVi) for matrix project.
Firstly I made a case structure, but there is a problem with case output terminal, because it returns only one data type.
The second one was polmorphic VI, where I made case structures for all data types (similar in picture above), but it didnt work how I wount, because user should set only matrix type not change some properties in code.
I know that it is maybe very easy, but please help me, because I have no more ideas how to do this.
04-03-2013 02:13 PM
Hi enapolo,
you can't change the datatype of an output at runtime. It will be fixed while editing and is determined by the "biggest" datatype is has to take.
Please don't mix "array" with "matrix". LabVIEW distinguishs between them as "matrix" is used for special math functions, whereas "array" can be of any type and dimension!
04-03-2013 03:12 PM
But how for example in add function we can get in output different data type?
04-03-2013 03:25 PM
Hi Andy,
first you should note I can't open your due to it's LabVIEW version...
Second: your case structure output tunnel can only have one datatype. The datatype is determined by the "largest" datatype inside the case structure wired to it. You cannot change the datatype of a wire/control at runtime!
04-03-2013 03:26 PM
LabVIEW propigates the data type behind the scenes for most primitives (like Add) during the compile process. In order to get there the compiler must be taught how many different data types the primitive can handle. You can't change the compiler to teach it new tricks for your vi.
Polymorphic vis can behave sort of like the primitives but the data type must still be known and static at run time.
With LVOOP and dynamic dispatching you can create methods to operate on differnt data types and select the data type at run-time. There is a lot of good information in the LabVIEW help file about LVOOP.
04-03-2013 03:33 PM
Hi GerdW,
I add a new file. Yes, I know that it returns the largest data type, maybe You have some ideas how to solve this problem in another?
Thank you for your help and your time. Its really important for me.
04-03-2013 03:36 PM
Hi,
Thank you I will look about LVOOP.