05-12-2015 06:13 AM - edited 05-12-2015 06:14 AM
Hi All,
I am not an expert on Labview, but recently I adapted some serial protocols created some years ago for an acquisition system.
I have two different boards to communicate with, both have their own protocol. I have two SubVIs just to communicate to witch one at a time. They are in everything similar, the only thing that changes are delays, timeouts and the serial message.
I manage to combine both in only one and I am feeding the input data in a cluster, though the list of commands just doubled.
Similar to most of the modulus available to work. Is there any cleaver way of somehow dynamically change the input types and combo boxes default depending on other input we link on the calling VI?
For instance, when we simply build an array if we connect to it a number the rest of the inputs expect a number too and automatically give an error if I try to connect a string to it!
In this case I would like that the board address for instance, automatically adapt other inputs to the expected commands of the that especific built in protocol.
05-12-2015 06:45 AM
This does not sound like a good place to combine your code. It would be best to have two different lilbraries for each board.
Now, as far as adapting to inputs, you could look at polymorphic VIs. But they can only adapt to data types, not values.
05-12-2015 07:11 AM
I understand your opinion! Was a doubt in the beggining too, but it works fine like this and is less a sub vi in the folder...
I did not knew how to do that, I guess I can manage a way to develop something from that!
Thak you!