| Hot plate | IKA C-MAG HS7 | Heated bed with temperature control | 
| Hot plate | IKA C-MAG HS7 | Heated bed with temperature control | 
| Digit Multimeter Tektronix | DMM4040 | Multimeter used to measure current | 
## Communication
## Communication
### Communication with `Digit Multimeter M3500A` and `System DC Power Supply 150 V / 10 A`
To communicate the `Digit Multimeter M3500A` and the `System DC Power Supply 150 V / 10 A` a USB cable was used through the VISA protocol (Virtual Instrument Software Architecture) which is a standard for configuring, programming and debugging instrumentation systems that include GPIB interfaces. To do this, you first have to download the NI-VISA software on the computer you intend to use since Python is used to communicate through the Python wrapper `pyvisa` which requires the real VISA installation on the system. Otherwise an error will be thrown.
To communicate the `Digit Multimeter M3500A` and the `System DC Power Supply 150 V / 10 A` a USB cable was used through the VISA protocol (Virtual Instrument Software Architecture) which is a standard for configuring, programming and debugging instrumentation systems that include GPIB interfaces. To do this, you first have to download the NI-VISA software on the computer you intend to use since Python is used to communicate through the Python wrapper `pyvisa` which requires the real VISA installation on the system. Otherwise an error will be thrown.
<br>It is installed `pyvisa`:
<br>It is installed `pyvisa`:
@ -36,7 +38,7 @@ If a series of codes are displayed in the Terminal, it means the instruments hav
```Terminal
```Terminal
'USB0::0x164E::0x0DAD::TW00013644::INSTR'
'USB0::0x164E::0x0DAD::TW00013644::INSTR'
```
```
### Communication with the Optris CTlaser pyrometer
### Communication with the Optris CTlaser pyrometer`OPTCTLLTSF`
Communication with the Optris CTlaser pyrometer was performed using the sensor's native binary protocol, using the Python programming language and the standard `pyserial` library for access to the COM port (virtual USB RS-232).
Communication with the Optris CTlaser pyrometer was performed using the sensor's native binary protocol, using the Python programming language and the standard `pyserial` library for access to the COM port (virtual USB RS-232).
<br>The sensor protocol consists of sending single-byte binary commands and receiving two-byte encoded responses, representing data such as temperature in `uint16` format.
<br>The sensor protocol consists of sending single-byte binary commands and receiving two-byte encoded responses, representing data such as temperature in `uint16` format.
<br>Libraries used:
<br>Libraries used:
@ -60,7 +62,7 @@ This command requests the process temperature (Tprocess). The sensor's response
```python
```python
temperatura = ((byte1 * 256 + byte2) - 1000) / 10
temperatura = ((byte1 * 256 + byte2) - 1000) / 10
```
```
All this information was obtained from the manufacturer's manuals which are attached to this repository.
All this information was obtained from the manufacturer's manuals which are attached to this repository. [CTR-commands](https://gitea.itmorelia.com/delfin-25a/Experimento-de-Laboratorio-temperatura/src/branch/main/CTlaser-manual.pdf) and [CTlaser-manual](https://gitea.itmorelia.com/delfin-25a/Experimento-de-Laboratorio-temperatura/src/branch/main/CTlaser-manual.pdf)
#### Minimum code for pyrometer reading
#### Minimum code for pyrometer reading
```python
```python
@ -83,150 +85,43 @@ else:
sensor.close()
sensor.close()
```
```
## Code
### Communication with `Digit Multimeter Tektronix DMM4040`
Para poder establecer comunicación entre el multímetro digital **Tektronix DMM4040** y la computadora mediante una interfaz **RS-232**, utilizando Python y la librería **Pyvisa**. La comunicación se realiza por comandos **SCPI** (Standar Commands for Programmable Instruments), ampliamente utilizados en istrumentación electrónica.
<br>Para poder comunicarnos con el multimetro es necesario tener un cable serial RS-232 a USB (adaptador compatible, ejemplo: PL2303, CH340, FTDI) y conectarlo tanto a la salida de datos serial del multimetro digital DMM4040 como a un puerto USB disponible en el computador, también, es necesario tener instalado el software de NI_VISA (Controlador requerido para comunicación serial por PyVISA), Python e instalar la librería `pyvisa`.
#### Código de ejemplo para conectar el multimetro DMM4040 con pyhton
```python
```python
import tkinter as tk
from tkinter import messagebox
import pyvisa
import pyvisa
import time
import time
import csv
# Crear administrador VISA
from datetime import datetime
import os
from decimal import Decimal
import serial
PUERTO = 'COM9' #Puerto COM en donde se encuetra el Pyrometer
BAUDRATE = 115200
COMANDO_TEMPERATURA = bytes([0x01]) # Según protocolo binario del sensor