Está en la página 1de 9

'

Cota_T = Altura_Cabina + 215 'Los 215 es la distancia desde el techo


de la cabina hasta la parte superior del travesaño del chasis que
chocaría con el tope de la estructura
L_estructura = Foso + Recorrido + Sobrerecorrido_Sup + Cota_T + 110
'Los 110 es la distancia que hay de más por el tope en la
altura de la estructura
'La CotaCabecero es la altura que mide esto, que depende del tipoHCA.
Para HCA100 mide 450 por ser una polea mas pequeña. Para HCA150 y
HCA200 mide 520 por ser una polea más grande
If Tipo_HCA = "HCA100_2a1" Then
CotaCabecero = 450
ElseIf Tipo_HCA = "HCA150_2a1" Or Tipo_HCA = "HCA200_2a1" Then
CotaCabecero = 520
End If
H_mocheta = L_estructura - Recorrido - Sobrerecorrido_Sup -
Sobrerecorrido_Inf - 110 - 80 - CotaCabecero - 110 'los 110 son de
el recorrido que no se usa en la camisa del piston abajo que queda
neutro por el cerramiento del pistón en este punto. Y los 80 de
arriba, es la punta del vástago que no sirve para el recuento del
recorrido ya que se introduce en el cabecero.
H_cabezapiston = ((Recorrido + Sobrerecorrido_Sup +
Sobrerecorrido_Inf)/2)+110

'Cálculo de las distancias entre travesaños (de parte superior a parte


superior del travesaño, donde se pondrían las escuadras.
If L_estructura > 7000 And L_estructura < 8200 Then
'2tramos:
L_tramo1 = H_mocheta + H_cabezapiston - 350 - 320
L_tramo2 = L_estructura - L_tramo1
'Valor de altura entre un travesaño estandar y otro:
H_travesaño1 = (Round(((H_mocheta - 150 - 120) / 3) /
5)) * 5 'Distancia entre "Travesaño_Mocheta" y
"Travesaño_Intermedio1" // Sería sencillamente: (H_mocheta-150-120,
pero para redondear el valor a 5 o a 0.
H_travesaño2 = (Round(((H_mocheta - 150 - 120) / 3) /
5)) * 5
'El siguiente travesaño lleva a 150 por encima la
cogida de la cabeza de la mocheta
H_travesaño3 = (H_mocheta - 150 - 120) -
(2*((Round(((H_mocheta - 150 - 120) / 3) / 5)) * 5)) 'Sería
sencillamente: (H_mocheta-150-120)
H_travesaño4 = (Round(((L_tramo1 - 200 - H_mocheta +
150) / 2) / 5)) * 5 'Sería sencillamente: (L_tramo1-200-
H_mocheta+150)/2
'El siguiente travesaño lleva a 200 por encima el final
del tramo 1 y el incio del tramo 2
H_travesaño5 = (L_tramo1 - 200 - H_mocheta + 150) -
((Round(((L_tramo1 - 200 - H_mocheta + 150) / 2) / 5)) * 5) 'Sería
sencillamente: (L_tramo1-200-H_mocheta+150)/2
'El siguiente travesaño lleva a 350 por encima la
cogida de la cabeza del piston
H_travesaño6 = 520
H_travesaño7 = (Round(((L_tramo2 -
320)/4)/5))*5 'Sería sencillamente: (L_tramo2 - 320)/4)
H_travesaño8 = (Round(((L_tramo2 -
320)/4)/5))*5 'Sería sencillamente: (L_tramo2 - 320)/4)
H_travesaño9 = (Round(((L_tramo2 - 320) / 4) / 5)) *
5 'Sería sencillamente: (L_tramo2 - 320)/4)
ElseIf L_estructura >= 8200 And L_estructura < 10400 Then
'3 tramos (Desde 8200 hasta 10.000 mm, 13 travesaños):
L_tramo1 = (Round(((H_mocheta - 150) + ((H_cabezapiston + 150 -
350 - 520) / 3) + 200)/5))*5
L_tramo2 = (Round((320+ 2*((H_cabezapiston + 150 - 350 - 520) /
3)+ (L_estructura-H_mocheta - H_cabezapiston+350-520)/4 + 200)/5))*5
L_tramo3 = L_estructura - L_tramo1 - L_tramo2
'Valor de altura entre un travesaño estandar y otro:
H_travesaño1 = (Round(((H_mocheta - 150 - 120) / 3) /
5)) * 5 'Sería sencillamente: (H_mocheta-150-120)/3)
H_travesaño2 = (Round(((H_mocheta - 150 - 120) / 3) /
5)) * 5 'Sería sencillamente: (H_mocheta-150-120)/3)
'El siguiente travesaño lleva a 150 por encima la
cogida de la cabeza de la mocheta
H_travesaño3 = H_mocheta - 150 - 120 - (2 *
(Round(((H_mocheta - 150 - 120) / 3) / 5)) * 5)
'El siguiente travesaño lleva a 200 por encima el
cambio de tramo 1 a tramo 2
H_travesaño4 = (Round((L_tramo1 - H_mocheta - 200 +
150)/5))*5 'Sería sencillamente: (L_tramo1 - H_mocheta -
200 + 150)
H_travesaño5 = 520
H_travesaño6 = (Round((L_tramo1 - H_mocheta - 200 +
150) / 5)) * 5 'Sería sencillamente: (L_tramo1 - H_mocheta -
200 + 150)
'El siguiente travesaño lleva a 350 por encima la
cabeza de la camisa del piston
H_travesaño7 = (H_mocheta + H_cabezapiston) -(L_tramo1
+ 320 + ((Round((L_tramo1 - H_mocheta - 200 + 150) / 5)) * 5) + 350)
'El siguiente travesaño lleva a 200 por encima el
cambio de tramo 2 a tramo 3
H_travesaño8 = (Round(((L_estructura - (H_mocheta +
H_cabezapiston) + 350 - 520) / 4)/5))*5 'Simplemente:
(L_estructura - (H_mocheta + H_cabezapiston) + 350 - 520) / 5)
H_travesaño9 = 520
H_travesaño10 = (Round(((L_estructura - (H_mocheta +
H_cabezapiston) + 350 - 520) / 4) / 5)) * 5 'Simplemente:
(L_estructura - (H_mocheta + H_cabezapiston) + 350 - 520) / 5)
H_travesaño11 = (Round(((L_estructura - (H_mocheta +
H_cabezapiston) + 350 - 520) / 4) / 5)) * 5 'Simplemente:
(L_estructura - (H_mocheta + H_cabezapiston) + 350 - 520) / 5)
ElseIf L_estructura >= 10400 And L_estructura < 12000 Then
'3 tramos (desde 10.000 mm hasta 12.000 mm, 15 travesaños):
L_tramo1 = (Round(((H_mocheta - 150) + (2*(H_cabezapiston + 150
- 350 - 520) / 4) + 200)/5))*5
L_tramo2 = (Round((320+ 2*((H_cabezapiston + 150 - 350 - 520) /
4)+ 2*(L_estructura-H_mocheta - H_cabezapiston+350-520)/5 + 200)/5))*5
L_tramo3 = L_estructura - L_tramo1 - L_tramo2
'Valor de altura entre un travesaño estandar y otro:
H_travesaño1 = (Round(((H_mocheta - 150 - 120) / 3) /
5)) * 5 'Sería sencillamente: (H_mocheta-150-120)/3)
H_travesaño2 = (Round(((H_mocheta - 150 - 120) / 3) /
5)) * 5 'Sería sencillamente: (H_mocheta-150-120)/3)
'El siguiente travesaño lleva a 150 por encima la
cogida de la cabeza de la mocheta
H_travesaño3 = H_mocheta - 150 - 120 -
2*((Round(((H_mocheta - 150 - 120) / 3) / 5)) * 5)
'El siguiente travesaño lleva a 200 por encima el
cambio de tramo 1 a tramo 2
H_travesaño4 = (Round(((L_tramo1 - H_mocheta - 200 +
150)/2) / 5)) * 5 'Sería sencillamente: (L_tramo1 -
H_mocheta - 200 + 150)
H_travesaño5 = L_tramo1 - H_travesaño1 - H_travesaño2 -
H_travesaño3 - H_travesaño4 - 200 - 120
H_travesaño6 = 520
H_travesaño7 = (Round((((H_mocheta + H_cabezapiston) -
(L_tramo1 + 320 + 350))/2)/5))*5
'El siguiente travesaño lleva a 350 por encima la
cabeza de la camisa del piston
H_travesaño8 = (H_mocheta + H_cabezapiston)-(L_tramo1 +
320 + 350)-H_travesaño7
'El siguiente travesaño lleva a 200 por encima el
cambio de tramo 2 a tramo 3
H_travesaño9 = (Round(((L_estructura - (H_mocheta +
H_cabezapiston) + 350 - 520) / 5)/5))*5 'Simplemente:
(L_estructura - (H_mocheta + H_cabezapiston) + 350 - 520) / 5)
H_travesaño10 = (Round(((L_estructura - (H_mocheta +
H_cabezapiston) + 350 - 520) / 5) / 5)) * 5 'Simplemente:
(L_estructura - (H_mocheta + H_cabezapiston) + 350 - 520) / 5)
H_travesaño11 = 520
H_travesaño12 = (Round(((L_estructura - (H_mocheta +
H_cabezapiston) + 350 - 520) / 5) / 5)) * 5 'Simplemente:
(L_estructura - (H_mocheta + H_cabezapiston) + 350 - 520) / 5)
H_travesaño13 = (Round(((L_estructura - (H_mocheta +
H_cabezapiston) + 350 - 520) / 5)/5))*5 'Simplemente:
(L_estructura - (H_mocheta + H_cabezapiston) + 350 - 520) / 5)

ElseIf L_estructura >= 12000 And L_estructura < 14000 Then


'4 tramos (desde 12.000 mm hasta 14.000 mm, 17 travesaños):
L_tramo1 = H_mocheta-150 + 200 + ((Round((((H_cabezapiston +
H_mocheta)-(H_mocheta-150)-350-520-520)/4)/5))*5)
L_tramo2 = H_mocheta + H_cabezapiston - L_tramo1 - 320 - 350
L_tramo3 = 520 + 3*(Round(((L_estructura-L_tramo1 - L_tramo2 -
320 - 520)/6)/5))*5
L_tramo4 = L_estructura - L_tramo1 - L_tramo2 - L_tramo3
'Valor de altura entre un travesaño estandar y otro:
H_travesaño1 = (Round(((H_mocheta - 150 - 120) / 3) /
5)) * 5 'Sería sencillamente: (H_mocheta-150-120)/3)
H_travesaño2 = (Round(((H_mocheta - 150 - 120) / 3) /
5)) * 5 'Sería sencillamente: (H_mocheta-150-120)/3)
'El siguiente travesaño lleva a 150 por encima la
cogida de la cabeza de la mocheta
H_travesaño3 = H_mocheta - 150 - 120 -
2*((Round(((H_mocheta - 150 - 120) / 3) / 5)) * 5)
'El siguiente travesaño lleva a 200 por encima el
cambio de tramo 1 a tramo 2
H_travesaño4 = (Round((((H_cabezapiston + H_mocheta)-
(H_mocheta-150)-350-520-520)/4)/5))*5 'Sería sencillamente:
((H_cabezapiston + H_mocheta)-(H_mocheta-150)-350-520-520)/4
H_travesaño5 = 520
H_travesaño6 = (Round((L_tramo1 - H_mocheta - 200 +
150) / 5)) * 5 'Sería sencillamente: (L_tramo1 - H_mocheta -
200 + 150)
H_travesaño7 = (Round((L_tramo1 - H_mocheta - 200 +
150) / 5)) * 5 'Sería sencillamente: (L_tramo1 - H_mocheta -
200 + 150)
'El siguiente travesaño lleva a 350 por encima la
cabeza de la camisa del piston
H_travesaño8 = L_tramo2 - H_travesaño6 - H_travesaño7 -
320- 200
'El siguiente travesaño lleva a 200 por encima el
cambio de tramo 2 a tramo 3
H_travesaño9 = 520
H_travesaño10 = (Round(((L_estructura-L_tramo1 -
L_tramo2 - 320 - 520)/6)/5))*5
H_travesaño11 = (Round(((L_estructura-L_tramo1 -
L_tramo2 - 320 - 520)/6)/5))*5
H_travesaño12 = (Round(((L_estructura-L_tramo1 -
L_tramo2 - 320 - 520)/6)/5))*5
H_travesaño13 = 520
H_travesaño14 = (Round(((L_estructura-L_tramo1 -
L_tramo2 - 320 - 520)/6)/5))*5
H_travesaño15 = (Round(((L_estructura-L_tramo1 -
L_tramo2 - 320 - 520)/6)/5))*5

ElseIf L_estructura >= 14000 And L_estructura < 16100 Then


'4 tramos (desde 14.000 mm hasta 16.100 mm, 21 travesaños):
L_tramo1 = H_mocheta-150 + 200 + 2*((Round((((H_cabezapiston +
H_mocheta)-(H_mocheta-150)-350-520-520)/6)/5))*5)
L_tramo2 = (Round((H_mocheta + H_cabezapiston - L_tramo1 - 320
- 350)/5))*5
L_tramo3 = 520+4*(Round(((L_estructura-L_tramo1 - L_tramo2 -
320 - 520)/8)/5))*5
L_tramo4 = L_estructura - L_tramo1 - L_tramo2 - L_tramo3
'Valor de altura entre un travesaño estandar y otro:
H_travesaño1 = (Round(((H_mocheta - 150 - 120) / 3) /
5)) * 5 'Sería sencillamente: (H_mocheta-150-120)/3)
H_travesaño2 = (Round(((H_mocheta - 150 - 120) / 3) /
5)) * 5 'Sería sencillamente: (H_mocheta-150-120)/3)
'El siguiente travesaño lleva a 150 por encima la
cogida de la cabeza de la mocheta
H_travesaño3 = H_mocheta - 150 - 120 -
2*((Round(((H_mocheta - 150 - 120) / 3) / 5)) * 5)
H_travesaño4 = (Round((((H_cabezapiston + H_mocheta) -
(H_mocheta - 150) -350 - 520 - 520) / 6) / 5)) * 5 'Sería
sencillamente: ((H_cabezapiston + H_mocheta)-(H_mocheta-150)-350-520-
520)/4
'El siguiente travesaño lleva a 200 por encima el
cambio de tramo 1 a tramo 2
H_travesaño5 = L_tramo1 - H_mocheta+150-200 -
(Round((((H_cabezapiston + H_mocheta)-(H_mocheta-150)-350-520-
520)/6)/5))*5
H_travesaño6 = 520
H_travesaño7 = (Round((((H_cabezapiston + H_mocheta)-
(H_mocheta-150)-350-520-520)/6)/5))*5
H_travesaño8 = (Round((((H_cabezapiston + H_mocheta) -
(H_mocheta - 150) -350 - 520 - 520) / 6) / 5)) * 5
H_travesaño9 = (Round((((H_cabezapiston + H_mocheta)-
(H_mocheta-150)-350-520-520)/6)/5))*5
'El siguiente travesaño lleva a 350 por encima la
cabeza de la camisa del piston
H_travesaño10 = L_tramo2 - 520 -
(3*(Round((((H_cabezapiston + H_mocheta)-(H_mocheta-150)-350-520-
520)/6)/5))*5)
'El siguiente travesaño lleva a 200 por encima el
cambio de tramo 2 a tramo 3
H_travesaño11 = 520
H_travesaño12 = (Round(((L_estructura-L_tramo1 -
L_tramo2 - 320 - 520)/8)/5))*5
H_travesaño13 = (Round(((L_estructura-L_tramo1 -
L_tramo2 - 320 - 520)/8)/5))*5
H_travesaño14 = (Round(((L_estructura-L_tramo1 -
L_tramo2 - 320 - 520)/8)/5))*5
H_travesaño15 = (Round(((L_estructura-L_tramo1 -
L_tramo2 - 320 - 520)/8)/5))*5
H_travesaño16 = 520
H_travesaño17 = (Round(((L_estructura-L_tramo1 -
L_tramo2 - 320 - 520)/8)/5))*5
H_travesaño18 = (Round(((L_estructura-L_tramo1 -
L_tramo2 - 320 - 520)/8)/5))*5
H_travesaño19 = (Round(((L_estructura-L_tramo1 -
L_tramo2 - 320 - 520)/8)/5))*5
End If

iLogicVb.UpdateWhenDone = True
'Activación/supresión de travesaños:
If L_estructura > 7000 And L_estructura < 8200 Then
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):10") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):11") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):12") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):13") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):14") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):15") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):16") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):17") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):18") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):19") = False
ElseIf L_estructura >= 8200 And L_estructura < 10400 Then
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):10") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):11") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):12") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):13") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):14") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):15") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):16") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):17") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):18") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):19") = False
ElseIf L_estructura >= 10400 And L_estructura < 12000 Then
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):10") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):11") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):12") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):13") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):14") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):15") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):16") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):17") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):18") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):19") = False
ElseIf L_estructura >= 12000 And L_estructura < 14000 Then
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):10") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):11") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):12") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):13") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):14") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):15") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):16") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):17") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):18") = False
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):19") = False
ElseIf L_estructura >= 14000 And L_estructura < 16100 Then
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):10") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):11") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):12") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):13") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):14") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):15") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):16") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):17") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):18") = True
Component.IsActive("HCA-40-9-L (Travesaño estandar EG1200 2a1
HCA100):19") = True
End If

iLogicVb.UpdateWhenDone = True

También podría gustarte