It is curious that when we design a project there are always different ways to develop it to obtain the same result, however, although both designs can perform the same function, one will always be more attractive than the other.
When we design we must not only think about the operability of the design, we must also consider aesthetics and cost reduction without compromising quality.
In this article I will explain some techniques and resources that we can use in LabView to reduce the connection lines in our designs, this in addition to simplify the design gives us more space to work in the block diagrams and facilitates the understanding of the design.
Es curioso que cuando diseñamos un proyecto existen siempre distintas formas de desarrollarlo para obtener el mismo resultado, sin embargo, aunque ambos diseños puedan ejecutar la misma función siempre uno resultará más atractivo que otro.
Cuando diseñamos no solo debemos pensar en la operatividad del diseño, también hay que considerar la estética y la reducción de costos sin comprometer la calidad.
En este artículo voy a explicar algunas técnicas y recursos que podemos usar en LabView para reducir las lineas de conexion en nuestros diseños, esto además de simplificar el diseño nos da más espacio para trabajar en los diagramas de bloques y facilita la comprensión del diseño.
The first rule that we should already know because I exposed in another article is that the colors in the blocks and lines are not purely decorative, they correspond to the data types we are working with.
That said we must know that we cannot connect a boolean control to a numeric indicator for example, so each block can be connected to another one that is capable of handling the same type of data.
Let's suppose now that we want to handle 3 Boolean controls, 3 double numeric, 3 32Bits integer numeric and 3 String. Twelve data in total 3 of each type, 4 different types of data with a pointer for each of them. That sounds like a tongue twister so let's go with that the picture says more than a thousand words.
La primera regla que ya deberíamos saber porque expuse en otro artículo es que los colores en los bloques y las lineas no son puramente decorativos, corresponden a los tipos de datos con los que se estan trabajando.
Dicho esto debemos saber que no podemos conectar un control booleano a un indicador numérico por ejemplo, entonces cada bloque puede ser conectado con otro que sea capaz de manejar el mismo tipo de datos.
Supongamos ahora que deseamos manejar 3 controles booleanos, 3 numericos dobles, 3 numericos enteros de 32Bits y 3 String. Doce datos en total 3 de cada tipo, 4 tipos distintos de datos con un indicador para cada uno de ellos. Eso suena como un trabalenguas así que vamos con eso de que la imagen dice mas que mil palabras.
Since there are twelve controls connected to twelve indicators we will have a total of 24 blocks connected by 12 lines (please ignore the blocks we use for the while loop control).
We will be able to notice without fail that in spite of how bulky the block diagram looks it can fulfill its function very well.
Ya que son doce controles conectados a doce indicadores tendremos un total de 24 bloques conectados mediante 12 lineas (por favor ignoremos los bloques que usamos para el control del while loop).
Podremos notar sin falta que a pesar de lo voluminoso que se ve el diagrama de bloques puede cumplir muy bien su función.
Arrays |
|---|
Arrays are an effective way to simplify connections, let's think of an array as a box, yes... one of those cardboard ones 😉. Imagine you have in your room a lot of shoes, shirts, watches and cell phones.
If I give you four cardboard boxes to sort surely you are not going to mix shoes with phones and things like that, I know there are cases of cases but I don't want to think that about you, then surely you will put together things of the same type in a box.
The arrays fulfill the same function that those boxes, they allow us to group the elements according to their type of data in an array and then to connect them with other arrays or to take them according to our convenience simplifying this way the number of connections since instead of connecting the elements one by one a single connection is made by array.
Los Arrays son una forma efectiva de simplificar conexiones, pensemos en un arreglo como una caja, si... de esas de cartón 😉. Imagina que tienes en tu cuarto muchos zapatos, camisas, relojes y teléfonos celulares.
Si te doy cuatro cajas de cartón para ordenar seguramente no vas a mezclar zapatos con teléfonos y cosas asi, se que hay casos de casos pero no quiero pensar eso de vos, entonces seguro juntaras las cosas del mismo tipo en una caja.
Los arrays cumplen la misma función que esas cajas, nos permiten agrupar los elementos segun su tipo de datos en un arreglo y luego conectarlos con otros arreglos o tomarlos segun nos convenga simplificando así el número de conexiones ya que en lugar de conectar los elementos uno por uno se hace una sola conexión por array.
What we did is to create an array for each type of data, of course, separating the controls from the indicators.
Now instead of 24 elements with 12 lines we see 8 elements with 4 lines, in each array there could be many more elements and this would not alter the image of the diagram with arrays.
We have definitely simplified the first design in terms of block diagram and it will continue to perform the same function.
Lo que hicimos es crear un array para cada tipo de datos, por supuesto, separando los controles de los indicadores.
Ahora en lugar de 24 elementos con 12 líneas vemos 8 elementos con 4 líneas, en cada arreglo pudiesen haber muchisimos mas elementos y esto no alteraría la imagen del diagrama con arrays.
Definitivamente hemos simplificado el primer diseño en cuanto a diagrama de bloques y seguirá ejecutando la misma función.
Clusters |
|---|
Can we simplify this even more, of course we can!
Now let's think of a Cluster as a big box in which we can store everything in the room, shoes, shirts, phones, watches, everything!!! even the array boxes because unlike the array boxes are not limited to the elements being of the same type.
The only caveat is that you can not join controls with indicators, a cluster of controls will only carry controls and one of indicators only indicators.
¿Podemos simplificar esto aún más? ¡Claro que si!
Ahora pensemos en un Cluster como una caja grande en la que podemos guardar todo lo que hay en el cuarto, zapatos, camisas, teléfonos, relojes, todo!! incluso las cajas de array porque a diferencia de los array no se limitan a que los elementos sean del mismo tipo.
La única salvedad es que no se pueden juntar controles con indicadores, un cluster de controles solo llevará controles y uno de indicadores solo indicadores.
We could think that it is an unordered box but it really is not. The elements that are stored in arrays and clusters are ordered within these according to the way they are placed taking positions from 0 to n.
When a connection is made between an array and another, or a cluster and another automatically interconnect the elements according to their positions, it is important because if in position 1 of the control I have one of the boolean type but in position 1 of the indicator I have a numerical data there will be problems.
So, although it seems a bit messy, it requires much more care when ordering the elements.
But now with cluster we simplify from 24 elements and 12 lines (first design) to only 2 elements and one connecting line running the same function.
If that seems surprising to you I will tell you that 100 or more elements could have been simplified because a cluster allows it.
Podríamos pensar que se trata de una caja desordenada pero realmente no lo es. Los elementos que se almacenan en arrays y clusters se ordenan dentro de estos segun la forma que se van colocando tomando posiciones desde 0 hasta n.
Cuando se realiza una conexión entre un array y otro, o un cluster y otro automaticamente se interconectan los elementos segun sus posiciones, es importante porque si en la posición 1 del control tengo uno del tipo booleano pero en la posición 1 del indicador tengo un dato numérico habrán problemas.
Así que, aunque parezca algo desordenado requiere de mucho más cuidado a la hora de ordenar los elementos.
Pero ahora con cluster simplificamos de 24 elementos y 12 líneas (primer diseño) a solo 2 elementos y una línea de conexión ejecutando la misma función.
Si eso te parece sorprendente te dire que pudieron ser 100 o más elementos los simplificados porque un cluster lo permite.
Encantado de escribir otro artículo para ti espero que pueda serte de utilidad. Quedo atento a la sección de comentarios para conocer tus opiniones, dudas y sugerencias.