Label 1

Solo disponible en BuenasTareas
  • Páginas : 2 (304 palabras )
  • Descarga(s) : 0
  • Publicado : 26 de mayo de 2011
Leer documento completo
Vista previa del texto
'Declaraciones
Dim Vol As Single
Dim Temp As Single
Dim m1, m2, m3, mT As Single
Dim n1, n2, n3, nT As Single
Dim P1, P2, P3, PT As Single
Dim V1, V2, V3, VT As Single
Const PM1 = 16, PM2 =30, PM3 = 44, k1 = 1000, R = 0.08205
Const k2 = 28.31682
Private Sub mnucalcular_Click()
'Lectura de datos
m1 = Val(txtMG1.Text)
m2 = Val(txtMG2.Text)
m3 = Val(txtMG3.Text)
TxtM.SelText ="Metano: " & m1 & "kg" & vbCrLf
TxtM.SelText = "Etano: " & m2 & "kg" & vbCrLf
TxtM.SelText = "Propano: " & m3 & "kg" & vbCrLf
'Proceso de datos
n1 = m1 * k1 / PM1
n2 = m2 * k1 / PM2
n3 = m3 * k1 / PM3nT = n1 + n2 + n3
TxtM.SelText = " n1 (Metano) = " & n1 & " mol " & vbCrLf
TxtM.SelText = " n2 (Etano) = " & n2 & " mol " & vbCrLf
TxtM.SelText = " n3 (Propano) = " & n3 & " mol " & vbCrLfTxtM.SelText = " nT (Mezcla) = " & nT & " mol " & vbCrLf
Vol = Val(txtV.Text)
Temp = Val(txtT.Text)
TxtM.SelText = "Volumen del contenedor: " & Vol & "ft3" & vbCrLf
TxtM.SelText = "Volumen delcontenedor: " & Vol * k2 & "lt" & vbCrLf

TxtM.SelText = "Temperatura de trabajo: " & Temp & "K" & vbCrLf

P1 = n1 * R * Temp / (Vol * k2)
TxtM.SelText = " P1 = " & P1 & " atm " & vbCrLf
P2 = n2 * R *Temp / (Vol * k2)
TxtM.SelText = " P2 = " & P2 & " atm " & vbCrLf
P3 = n3 * R * Temp / (Vol * k2)
TxtM.SelText = " P3 = " & P3 & " atm " & vbCrLf
PT = P1 + P2 + P3
TxtM.SelText = " Pt = " & PT & "atm " & vbCrLf
V1 = n1 * R * Temp / PT
TxtM.SelText = " V1 = " & V1 & " lt " & vbCrLf
V2 = n2 * R * Temp / PT
TxtM.SelText = " V2 = " & V2 & " lt" & vbCrLf
V3 = n3 * R * Temp / PT
TxtM.SelText= " V3 = " & V3 & " lt" & vbCrLf
VT = V1 + V2 + V3
TxtM.SelText = " Vt = " & VT & " lt" & vbCrLf

End Sub

Private Sub mnulimpiar_Click()

Dim Limpiar As Integer
Limpiar = MsgBox("¿deseaslimpiar?", vbQuestion + vbYesNo, "Limpiar")
If Limpiar = vbYes Then TxtM.Text = ""
End Sub

Private Sub mnusalir_Click()
Dim Salir As Integer
Salir = MsgBox("¿deseas Salir?", vbQuestion +...
tracking img