Professional Documents
Culture Documents
LABORATORIO N° 09
I. OBJETIVOS:
Adquiere y analiza los datos con el LabVIEW y realiza aplicaciones con los sensores de medición.
Haciendo uso de estructura Fórmula Node.
II.- SEGURIDAD:
Advertencia:
En este laboratorio está prohibida la manipulación del hardware,
conexiones eléctricas o de red; así como la ingestión de alimentos o
bebidas.
MARCO TEORICO
Note: It is considered good programming practice to keep the inputs on the left border and the outputs on
the right border of the Formula Node. This helps you follow the data flow in your VI and keep your code
organized.
8. Enter the expressions below in the Formula Node. Make sure that you complete each command with a
semicolon. Notice, however, that the if statement does not require a semicolon after the first line.
if (x*y>0)
z1 = 3*x**2 - 2*y**3;
else z1 = 0;
z2 = sinh(z1);
9. Create controls and indicators for the inputs and outputs.
1. Right-click on each input and select Create»Control from the shortcut menu.
Nro. DD-106
Programación Aplicada a la Industria - Laboratorio Página 4 de 35
2. Right-click on each output and select Create»Indicator from the shortcut menu.
10. Place a While Loop with a stop button around the Formula Node and the controls. Be sure to include
a Wait (ms) function inside the loop to conserve memory usage. Your block diagram should appear as
follows.
11. Click the Run button to run the VI. Change the values of the input controls to see how the outputs
change.
In this case, the Formula Node helps minimize the space required on the block diagram. Accomplishing
the same task without the use of a Formula Node requires the following code.
Nro. DD-106
Programación Aplicada a la Industria - Laboratorio Página 5 de 35
Resources
For more information on the Formula Node syntax or the functions available, see the LabVIEW Help by
pressing the <Ctrl-H> keys while you are developing your code. This opens the Context Help window,
which includes information about the feature that your mouse is hovering over. In the Context
Help window, select Detailed help for more information.
Using the MathScript Node
Complete the following steps to create a VI that performs various operations on a 1D array in LabVIEW.
1. Open a blank VI from the toolbar by selecting File»New VI.
2. Place a MathScript Node on the block diagram.
1. Right-click on the diagram and navigate to Programming»Structures»MathScript Node.
2. Click and drag the cursor to place the MathScript Node on the block diagram.
3. In the same manner as you implemented in the Formula Node exercise, right-click on the border and
select Add Input from the shortcut menu. Label the input x.
4. Right-click the border and select Add Output from the shortcut menu. Repeat this process to create
three outputs labeled y, y1, and d. For LabVIEW 2010 and later select Add Output»Undetected
Variable.
5. Place an array of numeric controls on the front panel. Label the array x and wire it to the x input of
the MathScript Node on the block diagram.
6. In the MathScript Node, enter the following expressions:
y = x.^2;
y1 = y(1);
d = dot(x,y);
7. Create indicators for each of the three outputs by right-clicking each output and
selecting Create»Indicator from the shortcut menu.
8. Place a While Loop with a stop button around the MathScript Node and the controls. Be sure to
include a Wait (ms) function inside the loop to conserve memory usage. Your block diagram should
appear as follows.
9. On the front panel, expand the arrays to show multiple elements. With the cursor, grab the bottom
middle selector of the array and drag it down to show multiple elements.
Nro. DD-106
Programación Aplicada a la Industria - Laboratorio Página 6 de 35
10. Begin by placing a 1, 2, and 3 in the first three elements of the x control. Your front panel should look
similar to the one below. Note that the fourth and fifth elements are grayed out. This is because they
are not initialized. You can initialize them by clicking inside the cell and entering a value. To
uninitialize a cell, right-click the element and select Data Operations»Delete Element from the
shortcut menu.
11. Click the Run button. Change the values of the elements in the array to see how the outputs change.
V.- PROCEDIMIENTO:
A. DAQ CONFIGURATION
2. This DAQ only read in voltage. You are going to acquire a signal input voltage
4. Configure the voltage input Setup in the window Express Task. This DAQ can change the Full
Scale Range. You can chose, +-4, +-5, +-10, +-20V. The resolution will change based on the scale
you use. For now select +-5V.
5S
3S
Res 1 bit=219.4-214.2=4.8mV
4S
1S 2S
1 muestra en 1seg
Nro. DD-106
Programación Aplicada a la Industria - Laboratorio Página 10 de 35
5 − (−5 )
= 2.6𝑚𝑉
2𝑛 − 1
𝑙𝑛(4167.7)
𝑛=
𝑙𝑛(2)
𝑛 = 11.9
La resolución del DAQ es de:
𝒏 = 𝟏𝟐 𝒃𝒊𝒕
1. Observe como se calcula la resolución “n” que es el número de bits del DAQ
La resolución LSB de este convertidor (Voltaje de un escalón en mV) o voltaje por 1 bit
𝑅𝑎𝑛𝑔𝑜 𝑑𝑒 𝑉𝑜𝑙𝑡𝑎𝑗𝑒 10 − (−10 )
Resolución LSB = = = 4.8𝑚𝑣
2𝑅𝑒𝑠𝑜𝑙𝑢𝑐𝑖ó𝑛 − 1 2𝑛 − 1
20
2𝑛 − 1 =
4.8 × 10−3
2𝑛 = 4166.7 + 1 = 4167.7
𝑙𝑛(2𝑛 ) = 𝑙𝑛(4167.7)
Nro. DD-106
Programación Aplicada a la Industria - Laboratorio Página 11 de 35
𝑛 ∗ 𝑙𝑛(2) = 𝑙𝑛(4166.7)
𝑙𝑛(4167.7)
𝑛=
𝑙𝑛(2)
𝑛 = 12
Capture una pantalla y analice cual es la resolución para 1 bit en mV y halle la resolución del DAQ
que se le ha entregado en el laboratorio
https://www.youtube.com/watch?v=y0Ey6h0Tr64
Nro. DD-106
Programación Aplicada a la Industria - Laboratorio Página 14 de 35
Resultados de la experiencia
Nro. DD-106
Programación Aplicada a la Industria - Laboratorio Página 15 de 35
Se observa que al poner un voltaje de 4V en el “data” de nuestro panel frontal, se observa que en
nuestra salida de nuestro DAQ obtenemos 3.998V.
Nro. DD-106
Programación Aplicada a la Industria - Laboratorio Página 16 de 35
1. Elabore un programa (interfaz) desde Labview que permita escribir valores en la salida analógica.
Mida con un voltímetro la salida generada. Muestre el programa desarrollado.
ACTIVIDD 2: Elabore un programa (interfaz) desde Labview que permita escribir valores en la
salida analógica y que haga una rampa de 0 a 10V. Mida con un voltímetro la salida generada tipo
rampa. Muestre el programa desarrollado.
DESARROLLO ACTIVIDAD 2.
Connect Analog Out CH0 to Analog In CH1 on the DAQ Signal Accessory.
Resultados de la actividad 2
Nro. DD-106
Programación Aplicada a la Industria - Laboratorio Página 20 de 35
Conexión de un “write to measurement file” para obtención de datos exportarlos al Excel para su
visualización
Nro. DD-106
Programación Aplicada a la Industria - Laboratorio Página 21 de 35
Assistant Express VI, located on the Functions>>Output palette, in the For Loop. Complete the
following steps to configure this Express VI to generate an analog output voltage.
4. Click the OK button to close the Analog Output Voltage Task Configuration dialog box. This
saves the settings specified for the task in the DAQ Assistant Express VI.
Actividad 2: Open PDF LAB 08 PART 2 pro digital inputs and outputs
Programa realizado
Se observa en las imágenes que al poner un numero en array se enciende los leds.
Array es igual a 2
Nro. DD-106
Programación Aplicada a la Industria - Laboratorio Página 25 de 35
Actividad 3: Mediante el Software de Labview realice una interface que permita el encendido de cinco
LEDs, para una entrada variable de 0 a 10 V utilizando una tarjeta de adquisición de datos; los leds se
deben encender respectivamente en 2V, 4V, 6V, 8V y 10V.
Simulación
Nro. DD-106
Programación Aplicada a la Industria - Laboratorio Página 28 de 35
Nro. DD-106
Programación Aplicada a la Industria - Laboratorio Página 29 de 35
Como vemos en nuestro programa se enciende los leds de manera secuencial, mientras se aumenta el
valor de tensión.
Actividad 3: Una bomba debe llenar agua a un tanque cuando se arranca su motor por intermedio del
pulsador de arranque S0 o cuando el nivel de agua es mínimo. Del mismo modo, la bomba deja de
funcionar cuando se activa el pulsador de parada (S1) o cuando el nivel de agua está en máximo. El
control automático se da por intermedio de un sensor de nivel por resistencia variable, el cual se conecta
a una tarjeta de entrada analógica (DAQ), tal que, 10V indica que el tanque se encuentra lleno (5
metros) y 0V se encuentra vacío (0 metros). Por lo tanto, la bomba debe funcionar en operación manual
a través de (S0 y S1) o automático por el sensor de nivel (R).
El sistema incluye un panel de lámparas indicadoras (H0, H1, H2), cuando la bomba funciona, la lámpara
H0 se enciende permanentemente, en caso de una falla en el motor de la bomba por sobrecarga, el
encendido de la lámpara H0 pasa a ser intermitente, con una frecuencia de 250Hz; si el tanque está lleno,
la lámpara H1 estará encendida y finalmente si el tanque está vacío, la lámpara H2 estará encendida.
D
A (muy B C
(Requiere
bueno) (bueno) (Regular)
Ing Alex Tapia Mejora) PESO
4 3 2 1
Trabaja en grupo, es proactivo, Trabaja
con Seguridad, responsabilidad y 4 3 2 1 20%
puntualidad y EPP. Realiza exposición
Configura el DAQ y realiza una
Gráfica y visualización de tanque con 4 3 2 1 20%
una entrada variable de 0-5V
Escribir valores en la salida analógica
del DAQ. Mida con un voltímetro la 4 3 2 1 20%
salida generada
Nro. DD-106
Programación Aplicada a la Industria - Laboratorio Página 33 de 35
3. ¿Cuáles son las Herramientas de Análisis disponibles para LabVIEW? De ejemplos y explique
En una sistema de control existe una plata que debemos controlar, la interfaz hombre maquina la ofrece
LabVIEW con su módulo de adquisiciones datos.
VIII.- OBSERVACIONES:
Para hacer operación dentro de un nodo formula es importante conocer el tipo de variable
que estamos utilizando, para evitar posteriores errores.
Observamos la resolución del DAQ es de 12 bits, lo compramos con la formula.
La máxima frecuencia de muestro de esta tarjeta fue de 10Khz, si sobrepasamos este
valor nos mostrara error.
Nro. DD-106
Programación Aplicada a la Industria - Laboratorio Página 35 de 35
IX.- CONCLUSIONES:
Se obtuvo Señales de entrada/salida una señal de entrada o salida física es normalmente de
tensión o corriente. La señal de tensión suele ser 0 a 5v, 0 a 10v y la señal de corriente
entre 4 a 20mA, 0 a 20mA.
El nodo de fórmula es un nodo conveniente, basado en texto, que puede usar para realizar
operaciones matemáticas complicadas en un diagrama de bloques utilizando C
Se realizó la exportación de datos en Excel para su previa visualización de un gráfico que
nos ayuda a ver el comportamiento de la señal.