• No results found

2.2 METHODS FOR DETERMINING THE STIFFNESS OF ASPHALT

2.2.2 Predictive equations

Esta formulario permite cargar en pantalla los parámetros de operación del hardware según la práctica escogida en la formulario “Expermiento”, estos parámetros son leídos en tiempo real por medio de una interfase de adquisición de datos (I-DAQ).

Este formulario contiene controles Components Works de la National Instruments de manera que puede interactuar con la tarjeta de adquisición de datos (La IDA-Q diseñada por National Instruments) de manera que es posible escribir sobre ella para reflejar cambios sobre el hardware y posteriormente leer datos de él. Así, se establecen las prácticas expermentales.

El código asociado a esta formulario es: Dim arranque As Boolean

Dim ConexionTipo As String Dim distin As Integer

Private Sub Toma()

'********Definiciones necesarias para la subrutina****** Dim MedUno As Variant

Dim MedDos As Variant Dim MedTres As Variant Dim VPrim As Variant Dim VSec As Variant Dim ISec As Variant

Dim Vector_Vp(10) As Single Dim Vector_Vs(10) As Single Dim Vector_Is(10) As Single

' Se toman medidas de de la tabla.sfk

'******************************************************* AjusteVp = Data3.Recordset.Fields("AVp") AjusteVs = Data3.Recordset.Fields("AVs") AjusteIs = Data3.Recordset.Fields("AIs")

'Se inicializan las variables de medida Vp_prom = 0 Vs_prom = 0 Is_prom = 0 VPrim = 0 VSec = 0 ISec = 0

'Toma de medidas iterativa se llena un vector de 10 valores. For j = 1 To 10

Progre.Value = j

Label3.Caption = "Tomando Datos " & j * 10 & "%" For i = 1 To 50 ' *******************

Toma_Vp.SingleRead MedUno Toma_Vs.SingleRead MedDos Toma_Is.SingleRead MedTres If VPrim < MedUno Then VPrim = MedUno End If

If VSec < MedDos Then VSec = MedDos End If

If ISec < MedTres Then ISec = MedTres End If DoEvents Next i '******************** Vector_Vp(j) = VPrim Vector_Vs(j) = VSec Vector_Is(j) = ISec Next j ' ************************** For k = 1 To 10

Vp_prom = Vp_prom + Vector_Vp(k) Vs_prom = Vs_prom + Vector_Vs(k) Is_prom = Is_prom + Vector_Is(k) Next k

' Determinación de los voltajes medidos con el uso de los transformadores de Tensión y de Corriente.

VoltajePrim = Vp_prom / (Sqr(2) * 10) * AjusteVp VoltajeSec = Vs_prom / (Sqr(2) * 10) * AjusteVs CorrienteSec = Is_prom / (2 * Sqr(2) * 10) * AjusteIs Mostrar_Control

SelecCarga AsigDataTabla

'Se asignan los valores a los cuadros de salida de la interface. V_Entrada.Value = VoltajePrim

V_Entrada3.Value = VoltajeSec V_Entrada4.Value = CorrienteSec Reset_Salidas

End Sub

Private Sub WritePort0() Select Case Var_Paso Case 1 To 4 Entrada = 104 ConexionTipo = "Monofásico" Tabla_Mono Case 5 If Var_Paso_1 = 1 Then Entrada = 112 ConexiónTipo = "Y d" ElseIf Var_Paso_1 = 2 Then Entrada = 168

ConexiónTipo = "D y" ElseIf Var_Paso_1 = 3 Then Entrada = 104

ElseIf Var_Paso_1 = 4 Then Entrada = 176 ConexionTipo = "D d" End If Tabla_TF Case 6 Entrada = 70 ConexionTipo = "Y z5" Tabla_TF Case 7 If Var_Paso_1 = 5 Then Entrada = 141 ConexionTipo = "D yy" ElseIf Var_Paso_1 = 6 Then

Entrada = 77

ConexionTipo = "Y yy" End If

Tabla_TF

Case 8 'Información para el paralelo Entrada = 32

'Cargas_Paso = 16

ConexionTipo = "Transformadores en Paralelo" End Select

If Var_Paso = 8 Then 'Conexión en Paralelo CWDIO1.Ports.Item(2).SingleWrite 40

Else 'Conexiones diferentes Select Case Cargas_Paso

Case 0 CWDIO1.Ports.Item(2).SingleWrite 0 Case 1 CWDIO1.Ports.Item(2).SingleWrite 1 ' 600 Ohms Case 2 CWDIO1.Ports.Item(2).SingleWrite 2 ' 300 Ohms Case 3 CWDIO1.Ports.Item(2).SingleWrite 4 ' 150 Ohms Case 4 CWDIO1.Ports.Item(2).SingleWrite 3 ' 200 Ohms Case 5 CWDIO1.Ports.Item(2).SingleWrite 5 ' 120 Ohms Case 6 CWDIO1.Ports.Item(2).SingleWrite 6 ' 100 Ohms Case 7 CWDIO1.Ports.Item(2).SingleWrite 7 ' 85.714 Ohms End Select End If '*************************************************

CWDIO1.Ports.Item(0).SingleWrite Entrada ' Se Establece la conexión Timer1.Enabled = True

ConexionForm.Caption = " Conexión Tipo: " & ConexionTipo 'Toma

End Sub

Private Sub Tabla_Mono() ' Carga los valores desde la tabla de datos (tabla.sfk) Data1.Recordset.MoveFirst Sn = Data1.Recordset.Fields("Sn") + 0 Rp = Data1.Recordset.Fields("Rp") + 0 Rs = Data1.Recordset.Fields("Rs") + 0 P0 = Data1.Recordset.Fields("Po") + 0 Vpcc = Data1.Recordset.Fields("Vpcc") + 0 Ppcc = Data1.Recordset.Fields("Ppcc") + 0 Ipcc = Data1.Recordset.Fields("Ipcc") + 0 End Sub

Private Sub Tabla_TF() ' Carga los valores desde la tabla de datos (tabla.sfk) Data1.Recordset.MoveLast Sn = Data1.Recordset.Fields("Sn") + 0 Rp = Data1.Recordset.Fields("Rp") + 0 Rs = Data1.Recordset.Fields("Rs") + 0 P0 = Data1.Recordset.Fields("Po") + 0 Vpcc = Data1.Recordset.Fields("Vpcc") + 0 Ppcc = Data1.Recordset.Fields("Ppcc") + 0 Ipcc = Data1.Recordset.Fields("Ipcc") + 0

Data2.Recordset.FindFirst "Conexion = '" & ConexiónTipo & "'" Desfase = Data2.Recordset.Fields("Ang")

End Sub

Private Sub Form_Activate()

Data1.DatabaseName = App.Path & "\tabla.skf" Data2.DatabaseName = App.Path & "\tabla.skf" Data3.DatabaseName = App.Path & "\tabla.skf" Data1.RecordSource = "Tabla" Data2.RecordSource = "Desfase" Data3.RecordSource = "Ajuste" Data1.Refresh Data2.Refresh Data3.Refresh End Sub

Private Sub Form_Load() Me.Height = 1005 Progre.Min = 0 Progre.Max = 10

Timer2.Enabled = True distin = 0

End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Image2.Picture = ImageList1.ListImages(1).Picture Image3.Picture = ImageList1.ListImages(3).Picture Image4.Picture = ImageList1.ListImages(5).Picture Image5.Picture = ImageList1.ListImages(7).Picture Image1.Picture = ImageList1.ListImages(9).Picture End Sub

Private Sub Form_Unload(Cancel As Integer) If Qsalir = 0 Then principal.Toolbar1.Buttons.Item(4).Enabled = True End If If distin = 0 Then Reset_Salidas Entrada = "" Cargas_Paso = 0 Var_Paso = 0 Var_Paso_1 = 0 Teoria_Form.Show Unload Me Else Exit Sub End If End Sub

Private Sub Image1_Click() If Var_Paso = 0 Then

MsgBox "Debe escoger una práctica", vbOKOnly, "Atención" Exit Sub

End If

'Si no hay archivo de ayuda para este proyecto, mostrar un mensaje al usuario 'puede establecer el archivo de Ayuda para la aplicación en el cuadro

'de diálogo Propiedades del proyecto If Len(App.HelpFile) = 0 Then

MsgBox "No se puede mostrar el contenido de la Guía. No se puede encontrar el archivo de ayuda asociado.", vbInformation, Me.Caption Else

On Error Resume Next Select Case Var_Paso Case 1

HH_DISPLAY_TOPIC, 0&) Case 2

h = HtmlHelp(Me.hWnd, App.Path & "\Guías\Guía2.chm", HH_DISPLAY_TOPIC, 0&)

Case 3

h = HtmlHelp(Me.hWnd, App.Path & "\Guías\Guía3.chm", HH_DISPLAY_TOPIC, 0&)

Case 4

h = HtmlHelp(Me.hWnd, App.Path & "\Guías\Guía4.chm", HH_DISPLAY_TOPIC, 0&)

Case 5

h = HtmlHelp(Me.hWnd, App.Path & "\Guías\Guía5.chm", HH_DISPLAY_TOPIC, 0&)

Case 6

h = HtmlHelp(Me.hWnd, App.Path & "\Guías\Guía6.chm", HH_DISPLAY_TOPIC, 0&)

Case 7

h = HtmlHelp(Me.hWnd, App.Path & "\Guías\Guía7.chm", HH_DISPLAY_TOPIC, 0&)

Case 8

h = HtmlHelp(Me.hWnd, App.Path & "\Guías\Guía8.chm", HH_DISPLAY_TOPIC, 0&)

Case 9

h = HtmlHelp(Me.hWnd, App.Path & "\Guías\Guía9.chm", HH_DISPLAY_TOPIC, 0&) End Select If Err Then MsgBox Err.Description End If End If End Sub

Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

Image1.Picture = ImageList1.ListImages(10).Picture Label4.Caption = "Guía de la Práctica"

End Sub

Private Sub Image2_Click()

'si no hay archivo de ayuda para este proyecto, mostrar un mensaje al usuario 'puede establecer el archivo de Ayuda para la aplicación en el cuadro

'de diálogo Propiedades del proyecto If Len(App.HelpFile) = 0 Then

MsgBox "No se puede mostrar el contenido de la Ayuda. No se puede encontrar el archivo de ayuda asociado.", vbInformation, Me.Caption

On Error Resume Next

h = HtmlHelp(Me.hWnd, App.Path & "\Ayuda\Ayuda3.chm", HH_DISPLAY_TOPIC, 0&) If Err Then MsgBox Err.Description End If End If End Sub

Private Sub Image3_Click() Buscar_Temas.Show Buscar_Temas.SetFocus Unload Me

principal.guía.Enabled = False End Sub

Private Sub Image4_Click() Reset_Salidas Entrada = "" Cargas_Paso = 0 Var_Paso = 0 Var_Paso_1 = 0 Experimento.Show distin = 1 Unload Me principal.guía.Enabled = False End Sub

Private Sub Image5_Click() distin = 1

Qsalir = 1 Cálculo.Show Unload Me End Sub

Private Sub Timer1_Timer() Dim n As String If n <> CStr(Time) Then Iexc = Data1.Recordset.Fields("Iexec") ' RV VPrim = Data1.Recordset.Fields("Vnp") If Entrada = 70 Then CWDIO1.Ports.Item(1).SingleWrite 3 ' Se energiza el circuito

ElseIf Entrada = 32 Then

' CWDIO1.Ports.Item(1).SingleWrite 2 Else

CWDIO1.Ports.Item(1).SingleWrite 3 End If Toma End If Timer1.Enabled = False End Sub

Private Sub Mostrar_Control() Shape1.Visible = True 'Etiquetas

Label3.Caption = "DATOS DEL TRANSFORMADOR" Label1.Visible = True Label6.Visible = True Label7.Visible = True CargaTxt.Visible = True RpTxt.Visible = True RsTxt.Visible = True P0Txt.Visible = True VpccTxt.Visible = True PpccTxt.Visible = True IpccTxt.Visible = True

' Cuadros de texto (Salidas) V_Entrada.Visible = True V_Entrada3.Visible = True V_Entrada4.Visible = True CargaTx.Visible = True RpTx.Visible = True RsTx.Visible = True P0Tx.Visible = True VpccTx.Visible = True PpccTx.Visible = True IpccTx.Visible = True 'Barra de progreso Progre.Visible = False End Sub

Private Sub AsigDataTabla() 'Muestra en los cuadros de texto los parámetros leídos de las tablas

CargaTx.Text = Carga & " Ohms" RpTx.Text = Rp & " Ohms"

RsTx.Text = Rs & " Ohms" P0Tx.Text = P0 & " W" VpccTx.Text = Vpcc & " V" PpccTx.Text = Ppcc & " W"

IpccTx.Text = Ipcc & " A" End Sub

Private Sub Timer2_Timer() Dim n As String If n <> CStr(Time) Then WritePort0 End If Timer2.Enabled = False End Sub

Public Sub Reset_Salidas()

CWDIO1.Ports.Item(0).SingleWrite 0 CWDIO1.Ports.Item(1).SingleWrite 0 CWDIO1.Ports.Item(2).SingleWrite 0 End Sub

Private Sub Image2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

Image2.Picture = ImageList1.ListImages(2).Picture Label4.Caption = "Ayuda"

Label4.Left = Shape1.Left + (Shape1.Width - Label4.Width) / 2 End Sub

Private Sub Image3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

Image3.Picture = ImageList1.ListImages(4).Picture Label4.Caption = "Teoría"

Label4.Left = Shape1.Left + (Shape1.Width - Label4.Width) / 2 End Sub

Private Sub Image4_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

Image4.Picture = ImageList1.ListImages(6).Picture Label4.Caption = "Atrás"

Label4.Left = Shape1.Left + (Shape1.Width - Label4.Width) / 2 End Sub

Private Sub Image5_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

Image5.Picture = ImageList1.ListImages(8).Picture Label4.Caption = "Test Evaluativo"

Label4.Left = Shape1.Left + (Shape1.Width - Label4.Width) / 2 End Sub