You are on page 1of 8

Enva o Recibe un archivo por puerto serie. La accin predeterminada es Recibir.

Cuando se est en modo recepcin, se comprueba cada 500ms a ver si hay datos en el puerto. Como la transmisin se hace con el protocolo DTR/DSR, cuando se llena el buffer de entrada, la PC transmisora espera para seguir enviando. El cable debe ser FULL DUPLEX. Cuando se cambia el modo a Enviar se abre un cuadro de dilogo pidiendo el archivo a enviar y lo enva. El transmisor tambin enva el hash MD5 para que el receptor verifique que la transferencia fue correcta.

stop Puerto VISA resource name specifies the resource to be opened. This control also specifies the session and class. Accin Accin: Enviar o Recibir el archivo. Baudios Velocidad de transmisin. Ambos programas, emisor y receptor, deben tener configurada la misma velocidad de transimisin.

Merge Errors.vi

C:\Archivos de programa\National Instruments\LabVIEW 8.6\vi.lib\Utility\error.llb\Merge Errors.vi


File Dialog

File Dialog
RecibirArchivoPuerto.vi

C:\Documents and Settings\Daniel\Mis documentos\facu\5to\Digitales 3\1\Practico\RecibirArchivoPuerto.vi


EnviarArchivoPuerto.vi

C:\Documents and Settings\Daniel\Mis documentos\facu\5to\Digitales 3\1\Practico\EnviarArchivoPuerto.vi


Enva un archivo por puerto serie. Abre el archivo en modo binario y extrae su contenido. Si hay error al leer el archivo, termina el programa. Sino, extrae el nombre y MD5 del archivo y lo une con el contenido en un cluster. En primer lugar se enva el tamao del cluster recin armado y luego el cluster. Se cierra la conexin y termina el programa.

Archivo a enviar Ruta del archivo a enviar. Puerto (COM1) VISA resource name specifies the resource to be opened. This control also specifies the session and class. Baudios (57600) Velocidad de transferencia. Debe ser la misma que en la otra PC. error in error in can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

Right-click the error in control on the front panel and select Explain Erroror Explain Warning from the shortcut menu for more information about the error.
status status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.

Right-click the error in control on the front panel and select Explain Error or Explain Warning from the shortcut menu for more information about the error.
code code is the error or warning code.

Right-click the error in control on the front panel and select Explain Error or Explain Warning from the shortcut menu for more information about the error.
source source describes the origin of the error or warning.

Right-click the error in control on the front panel and select Explain Error or Explain Warning from the shortcut menu for more information about the error.
error out error in can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

Right-click the error in control on the front panel and select Explain Erroror Explain Warning from the shortcut menu for more information about the error.
status status is TRUE (X) if an error occurred or FALSE (checkmark) to

indicate a warning or that no error occurred.

Right-click the error in control on the front panel and select Explain Error or Explain Warning from the shortcut menu for more information about the error.
code code is the error or warning code.

Right-click the error in control on the front panel and select Explain Error or Explain Warning from the shortcut menu for more information about the error.
source source describes the origin of the error or warning.

Right-click the error in control on the front panel and select Explain Error or Explain Warning from the shortcut menu for more information about the error.

MD5Checksum File.vi

C:\Archivos de programa\National Instruments\LabVIEW 8.6\vi.lib\Utility\MD5Checksum.llb\MD5Checksum File.vi


VISA Configure Serial Port (Instr).vi

C:\Archivos de programa\National Instruments\LabVIEW 8.6\vi.lib\Instr\_visa.llb\VISA Configure Serial Port (Instr).vi


VISA Configure Serial Port

C:\Archivos de programa\National Instruments\LabVIEW 8.6\vi.lib\Instr\_visa.llb\VISA Configure Serial Port


Recibe un archivo por puerto serie. Se abre la conexin y se comprueba si hay bytes esperando para ser ledos en el puerto (estaran almacenados en el cach). Si no hay bytes esperando, se cierra la conexin y termina. Si hay bytes esperando, se leen 4 bytes, que representa un int y que contiene el tamao del cluster, en bytes, que se espera recibir. Luego se lee esa cantidad de bytes desde el puerto y se arma el cluster. Se pide al usuario un nombre de archivo, sugiriendole el mismo nombre que tena en la otra PC. Se crea el archivo con el nombre sugerido, se guardanen l los datos y se cierra el archivo. Se comprueba si el hash MD5 del archivo recin creado es el mismo que el recibido de la otra PC. Sino, se enva un mensaje de error. Se podran hacer otras comprobaciones, como por ejemplo si el usuario cancel la operacin presionando cancelar cuando se le pidi un nombre para el archivo. Pero si ocurre esto, simplemente habr un error al crear el archivo con un nombre no vlido en el siguiente paso y se propagar por los siguientes SubVIs. Y simplemente se terminar con un error.

Puerto (COM1) VISA resource name specifies the resource to be opened. This control also specifies the session and class. Baudios (57600) Velocidad de transferencia. Debe ser la misma que en la otra PC. error in error in describes error conditions that occur before this VI or function runs. status status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE. code code is the error or warning code. The default is 0. source source specifies the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string. error out error in can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs.

Right-click the error in control on the front panel and select Explain Erroror Explain Warning from the shortcut menu for more information about the error.
status status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.

Right-click the error in control on the front panel and select Explain Error or Explain Warning from the shortcut menu for more information about the error.
code code is the error or warning code.

Right-click the error in control on the front panel and select Explain Error or Explain Warning from the shortcut menu for more information about the error.
source source describes the origin of the error or warning.

Right-click the error in control on the front panel and

select Explain Error or Explain Warning from the shortcut menu for more information about the error.

VISA Configure Serial Port

C:\Archivos de programa\National Instruments\LabVIEW 8.6\vi.lib\Instr\_visa.llb\VISA Configure Serial Port


VISA Configure Serial Port (Instr).vi

C:\Archivos de programa\National Instruments\LabVIEW 8.6\vi.lib\Instr\_visa.llb\VISA Configure Serial Port (Instr).vi


Merge Errors.vi

C:\Archivos de programa\National Instruments\LabVIEW 8.6\vi.lib\Utility\error.llb\Merge Errors.vi


MD5Checksum File.vi

C:\Archivos de programa\National Instruments\LabVIEW 8.6\vi.lib\Utility\MD5Checksum.llb\MD5Checksum File.vi


File Dialog

File Dialog

You might also like