ejrcicios matlab
DESCRIPTION
kkjkljTRANSCRIPT
![Page 1: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/1.jpg)
INSTRUMENTACIÓN AVANZADA
LABVIEW
MANEJO DE ARCHIVOS
CLASE 5
![Page 2: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/2.jpg)
INSTRUMENTACIÓN AVANZADA
•Funciones FILE I/O
•Abrir y cerrar archivos
•Grabar y leer datos:
• Texto .txt
• Binarios .dat
• Planilla de cálculo .csv
• “LabVIEW Measurement File”, (LVM).
Manejo de Archivos desde LabVIEW
![Page 3: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/3.jpg)
INSTRUMENTACIÓN AVANZADA
![Page 5: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/5.jpg)
INSTRUMENTACIÓN AVANZADA
Escribir desde una aplicación texto a un archivo
Ejemplo
![Page 6: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/6.jpg)
INSTRUMENTACIÓN AVANZADA
Escribir desde una aplicación texto a un archivo
Ejemplo
![Page 8: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/8.jpg)
INSTRUMENTACIÓN AVANZADA
Escribir desde una aplicación texto a un archivo
(Manejo de Errores)
Ejemplo
![Page 9: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/9.jpg)
INSTRUMENTACIÓN AVANZADA
Leer desde un archivo de texto
Ejemplo
Ejemplo Error Automático
Ejemplo Error Manual
![Page 10: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/10.jpg)
INSTRUMENTACIÓN AVANZADA
Convertir números a
cadena de texto
![Page 11: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/11.jpg)
INSTRUMENTACIÓN AVANZADA
Conversión números a cadena de textoWrite to Text File
![Page 12: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/12.jpg)
INSTRUMENTACIÓN AVANZADA
Escribir desde una aplicación texto a un archivo
Ejemplo
![Page 14: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/14.jpg)
INSTRUMENTACIÓN AVANZADA
Funciones de bajo nivel: Open, Write, Close
Ejemplo
Abrir archivo y escribir
CerrarAbrir/Crear Escribir Archivo
![Page 16: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/16.jpg)
INSTRUMENTACIÓN AVANZADA
Ejemplo
Escribir registros múltiples de lecturas
![Page 17: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/17.jpg)
INSTRUMENTACIÓN AVANZADA
Ejemplo
Escribir registros múltiples de lecturas
![Page 18: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/18.jpg)
INSTRUMENTACIÓN AVANZADA
Escribir registros múltiples de lecturas con datos adicionales:
Ejemplo
![Page 19: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/19.jpg)
INSTRUMENTACIÓN AVANZADA
Escribir registros múltiples de lecturas: agregando texto con Build Text
Ejemplo
![Page 20: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/20.jpg)
INSTRUMENTACIÓN AVANZADA
Escribir registros múltiples de lecturas: agregando texto con Build Text
Ejemplo
![Page 21: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/21.jpg)
INSTRUMENTACIÓN AVANZADA
Escribir registros múltiples de lecturas: agregando texto con Build Text
Ejemplo
![Page 23: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/23.jpg)
INSTRUMENTACIÓN AVANZADA
ESCRIBIR ARCHIVO HOJA CALCULO
T: TRASPONE
.3fFraccional con
3 decimales
Ejemplo
![Page 24: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/24.jpg)
INSTRUMENTACIÓN AVANZADA
![Page 27: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/27.jpg)
INSTRUMENTACIÓN AVANZADA
Funciones Para Grabar y Recuperar “Waveform”
![Page 28: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/28.jpg)
INSTRUMENTACIÓN AVANZADA
Funciones Para grabar y recuperar “waveform”
![Page 36: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/36.jpg)
INSTRUMENTACIÓN AVANZADA
Strings
• Como crear controles e indicadores string
• Aplicación de funciones string
![Page 37: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/37.jpg)
INSTRUMENTACIÓN AVANZADA
String Modos Display
• Normal display
• Password display
• \ code display
• Hex display
• \b backspace• \n nueva linea• \r return• \t tab• \s espacio
![Page 38: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/38.jpg)
INSTRUMENTACIÓN AVANZADA
Funciones String: Match Pattern (Patrón de coincidencia)
Ejemplo
![Page 39: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/39.jpg)
INSTRUMENTACIÓN AVANZADA
Funciones String: Scan From String
Ejemplo
Rescatar de un “string” el valor numérico de una medición:
![Page 40: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/40.jpg)
INSTRUMENTACIÓN AVANZADA
Ejemplo
Presentación de resultados en Tablas
![Page 42: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/42.jpg)
INSTRUMENTACIÓN AVANZADA
Mostrar resultados en Tablas
TableCreate Property Node Column Header String
Change to Write
Array Constante
Ejemplo
![Page 43: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/43.jpg)
INSTRUMENTACIÓN AVANZADA
Ejercicio
Mostrar resultados en Tablas
![Page 44: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/44.jpg)
INSTRUMENTACIÓN AVANZADA
Ejercicios
Guía 6
![Page 45: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/45.jpg)
INSTRUMENTACIÓN AVANZADA
Ejercicio 1 -6
Ejercicio 1.- Construir un VI con las siguientes opciones: Adquirir, Grabar, Borrar, Recuperar y Salir. En
“ADQUIRIR” debe capturar 50 lecturas de la tarjeta de adquisición de datos USB (entrada analógica) y luego
mostrarla en una gráfica. Con la opción “GRABAR” debe almacenar las lecturas a un archivo TXT.
Agregar la opción “BORRAR”, para limpiar el gráfico y llevar a cero el voltímetro, antes de recupera el archivo.
En la opción “RECUPERAR” debe rescatar el array con los datos registrados y graficarlos.
El voltímetro debe medir las lecturas de tensión en tiempo real.
![Page 46: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/46.jpg)
INSTRUMENTACIÓN AVANZADA
![Page 49: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/49.jpg)
INSTRUMENTACIÓN AVANZADA
BORRAR
![Page 54: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/54.jpg)
INSTRUMENTACIÓN AVANZADA
Ejercicio 2-6
Ejercicio 2. A partir del promedio de 10 lecturas obtenidas con el SubVI “Entrada
Analógica”, construir una cadena de texto con la función Build Text desde el panel
frontal con los datos que se detallan en la Figura y posteriormente grabarla a
archivo TXT (funciones Open, Write y Close File).
![Page 60: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/60.jpg)
INSTRUMENTACIÓN AVANZADA
Ejercicio 3. Utilice las funciones “Simulate Signal” y “Write To
Measurement File”, para generar y grabar una señal de onda sinusoidal
de 310V de amplitud y 50 Hz. Incorpore un medidor de la tensión en RMS
y la opción de recuperar la onda grabada en archivo.
Ejercicio 3-6
![Page 65: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/65.jpg)
INSTRUMENTACIÓN AVANZADA
Ejercicio 4.- Como variante del ejercicio anterior reemplace las funciones de
grabado y lectura de señales con “Write Waveform to file” y “Read Waveform
from file”:
Ejercicio 4-6
![Page 67: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/67.jpg)
INSTRUMENTACIÓN AVANZADA
Ejercicio 5. Construya la aplicación siguiente para grabar un archivo que contenga 20 muestras de lecturas de tensión
(adquiridas desde la placa USB PIC), en formato csv (valores separados por coma). Debe tomarse una lectura por
segundo, reflejando los resultados en un XY Graph.
La tabla grabada en el archivo csv tiene que tener la apariencia siguiente:
Agregue la opción Recuperar para restablecer en la gráfica los
datos grabados. Agregue una gráfica que represente las lecturas
en función del tiempo.
![Page 72: ejrcicios matlab](https://reader031.vdocuments.pub/reader031/viewer/2022012316/563dbab4550346aa9aa75935/html5/thumbnails/72.jpg)
INSTRUMENTACIÓN AVANZADA
Ejercicio 6. Utilizando un analizador virtual desarrollado en LabVIEW, se obtuvieron señales de
corriente de una pc+monitor y de una lámpara fluorescente compacta (LFC), grabadas en archivos
binarios independientes.
Desarrolle una aplicación que permita a partir de esos archivos obtener el espectro armónico y el
THDI% de cada una de las cargas.
Adicionalmente agregue la posibilidad de obtener el THDI% resultante si se combinan en una
instalación cantidades variables de LFCs y PCs.
Ejercicio 6-6