The control of lights or outputs is usually done in an automated way, as we have done previously with different discrete outputs we program the sequence or conditions by which the outputs will take actions.
We have also seen how to control an LED matrix to represent characters and give some advertising utilities, but this time we will rely on LabView to control lights through a matrix array.
El control de luces o salidas generalmente se realiza de forma automatizada, como hemos hecho anteriormente con distintas salidas discretas se programa la secuencia o condiciones mediante las cuales las salidas tomarán acciones.
También hemos visto cómo controlar una matriz LED para representar caracteres y darle algunas utilidades publicitarias, pero en esta ocasión nos apoyaremos en LabView para controlar luces mediante un arreglo matriz.
In this prototype we are going to start creating the program logic using LabView, we are going to control 8 lights that we will represent with LEDs but they are discrete outputs that can be adapted to control any type of light or output.
We will start by placing those 8 LEDs on the front panel and then we will create an array to set the on and off control.
It is enough to create an array and then drag an LED towards it to then give it a representative control shape, then it is necessary to expand horizontally until obtaining the 8 outputs, then we give it the other dimension and expand vertically for the representations in time of the 8 outputs.
En este prototipo vamos a iniciar creando la lógica del programa usando LabView, vamos a controlar 8 luces que representaremos con LEDs pero son salidas discretas que se pueden adaptar para controlar cualquier tipo de luz o salida.
Iniciaremos colocando esos 8 LEDs en el panel frontal y luego crearemos una matriz para mediante ella establecer el control de encendido y apagado.
Basta con crear un array y luego arrastrar un LED hacia el para luego darle una forma de control representativo, luego es necesario expandir de forma horizontal hasta obtener las 8 salidas, luego le damos la otra dimensión y expandimos de forma vertical para las representaciones en el tiempo de las 8 salidas.
In the diagrams panel we are going to create a While loop that will contain all the blocks, we make our Array a control and by means of an index we extract the data corresponding to the rows, this we show it in an indicator.
En el panel de diagramas vamos a crear un bucle While que contendrá todos los bloques, hacemos que nuestro Array sea un control y mediante un index extraemos el dato correspondiente a las filas, este lo mostramos en un indicador.
In addition we assign each one of the values corresponding to the row to each one of the output lights so that these respond as indicated in the array.
By means of a shift register we are going to increment a counter, this will be compared with a value and by means of these the sequence of ignition will be taken, the execution will be from the highest row to the lowest one.
Además asignamos cada uno de los valores correspondientes a la fila a cada una de las luces de salida para que estas respondan segun se indique en el array.
Mediante un shift register vamos a incrementar un contador, este se comparara con un valor y mediante estos se llevara la secuencia de encendido, la ejecucion sera desde la fila más alta hasta la más baja.
A control for the comparison will serve us to indicate up to which row to count, when the value of the count is equal to the indicated one a restart occurs.
The lights that we turn on in the matrix will be reflected in the output, the delay between one row and another is the same present in the while loop.
Un control para la comparación nos servirá para indicar hasta qué fila contar, cuando el valor de la cuenta sea igual al indicado ocurre un reinicio.
Las luces que encendamos en la matriz se reflejarán en la salida, el retardo entre una fila y otra es el mismo presente en el bucle while.