The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

Problem with debug HP prime program, somebody help me?
Message #1 Posted by Carlos CM (Mexico) on 4 Dec 2013, 5:27 p.m.

Hi to all user's. I'm new in the forum, I'm from Mexico and I need your help.

Recent I buy my hp prime...I did a problem with the DEBUG in a program...

when i check in the process... in a line exclusively the DEBUG reset my prime...

I'm a new programmer, i have no much experience...

EXPORT VSR() BEGIN

"CONTENT OF MY PROGRAM BLA BLA BLA" ... ... ... A:=0.9*b*d^2*fbpc; Dp:=A^2 - 2*A*FCG*ABS(Mp*1E5); <The last formula is the ultimate calculus done and the machine reset my prime every time in the same line...)

Why?

>>> CONTINUE MY PROGRAM...

Thanks so much!

      
Re: Problem with debug HP prime program, somebody help me?
Message #2 Posted by Patrice on 4 Dec 2013, 6:39 p.m.,
in response to message #1 by Carlos CM (Mexico)

The problem is located at "BLA BLA" :)
Please list your program, so someone can try to reproduce the problem.

            
Re: Problem with debug HP prime program, somebody help me?
Message #3 Posted by Carlos CM (Mexico) on 4 Dec 2013, 6:56 p.m.,
in response to message #2 by Patrice

EXPORT VSR() BEGIN LOCAL b:=15, d:=37, fc:=200, fy:=4200, Mp:=1, Mn:=1, V:=1, FCG:=1.4; LOCAL fac,fbpc,romin,robal,romax,A; LOCAL Dp,Dn,wp,wn,rop,ron,ro,Asp; LOCAL Asn,lambda,alfa,beta,Vcr; LOCAL Vc1,Vc2,s1,s,Av,fyv;

INPUT ({b,d,Mp,Mn,V,fc, fy,FCG}, "VIGAS NTC RDF 04", {"b =", "d =", "M(+) =", "M(-) =", "V =", "f'c =", "fy =", "FC ="}, {"en cm", "en cm", "en Ton*m", "en Ton*m", "en Ton", "en kg/cm^2", "en kg/cm^2", "Factor de carga adimensional" } , "" );

CHOOSE (N, "ELIJA ESTRIBOS", {"1/4 plg","3/8 plg", "1/2 plg"} );

CASE IF N==1 THEN Av:= 0.64; fyv:=2350 END; IF N==2 THEN Av:=1.42; fyv:=4200 END; Av:=2.54; fyv:=4200; END;

fac:=0.8*fc;

IF fac < 280 THEN beta:=0.85 ELSE beta:=1.05 - (fac/1400) END;

fbpc:=beta*fac;

romin:=0.0033; robal:= fbpc*6000/(fy*(fy+6000)) ; romax:=0.85*robal;

A:=0.9*b*d^2*fbpc; Dp:=A^2 - 2*A*FCG*ABS(Mp*1E5); Dn:=A^2 - 2*A*FCG*ABS(Mn*1E5);

IF Dp > 0 AND Dn > 0 THEN wp:=(A- vDp)/A; wn:=(A- vDn)/A; rop:=wp*fbpc/fy; ron:=wn*fbpc/fy;

//Cálculo de la cuantía necesaria

IF rop < romax AND ron < romax THEN

IF rop<romin THEN rop:=romin ELSE rop:=wp*fbpc/fy END; IF ron<romin THEN ron:=romin ELSE ron:=wn*fbpc/fy END; //Se selecciona la cuantía máxima... ro:=MAX(rop,ron);

//Cálculo del acero necesario

Asp:=rop*b*d; Asn:=ron*b*d;

//Diseño por cortante

lambda:= 1 - 0.004 * (10*d - 700);

IF d < 70 THEN alfa:=1.0 ELSE IF lambda < 0.8 THEN alfa:=0.8 ELSE alfa:=1.0 END; END;

IF ro<0.015 THEN Vcr:= alfa*0.8*b*d*(0.2 + 20*ro)* vfac ELSE Vcr:= alfa*0.8*b*d*(0.5)* vfac END;

Vc1:= 1.5*Vcr / (0.2 + 20*ro); Vc2:= 2.5*Vcr / (0.2 + 20*ro); s1:= 0.8*Av*fyv*d / ((FCG*1E3*V) - Vcr);

IF (FCG*1E3*V) < Vc2 THEN

CASE IF (FCG*1E3*V) < Vcr THEN s:= d/2 END; IF (FCG*1E3*V) <Vc1 THEN s:= MIN(s1, d/2) *1_cm END; s:= MIN(s1, d/4) *1_cm END; //Impresión de resultados: PRINT("RESULTADOS DEL DISEÑO:"); PRINT( "b = " + b +"cm"+ " ; " + "d = " + d +"cm"); PRINT( "M(+) = " + Mp +"Ton*m"); PRINT( "M(-) = " + Mn +"Ton*m"); PRINT( "f'c = " + fc +"kg/cm^2"); PRINT( "fy = " + fy +"kg/cm^2"); PRINT( "ro (+)= " + rop + " ; " + "As(+)=" + Asp+ "cm^2" ); PRINT( "ro (-)= " + ron + " ; " + "As(-)=" + Asn+"cm^2" ); CASE IF N==1 THEN PRINT("E 1/4 plg @ " + s) END; IF N==2 THEN PRINT("E 3/8 plg @ " + s) END; PRINT("E 1/2 plg @ " + s) END; IF (FCG*1E3*V) < Vcr THEN PRINT(" (Acero mínimo por cortante) ") END;

ELSE PRINT ("FALLA POR CORTANTE") END;

ELSE PRINT ("FALLA: CUANTÍA MAYOR A LA MÁXIMA PERMITIDA"); END; ELSE PRINT ("FALLA: DIMENSIONES ESCASAS"); END; END;

                  
Re: Problem with debug HP prime program, somebody help me?
Message #4 Posted by Damien on 4 Dec 2013, 7:44 p.m.,
in response to message #3 by Carlos CM (Mexico)

I think that you have forgotten to declare 3 variables: vDp, vDn and vfac. I don't see them with LOCAL statement.

Regards,

Damien.

                  
Re: Problem with debug HP prime program, somebody help me?
Message #5 Posted by Patrice on 4 Dec 2013, 8:06 p.m.,
in response to message #3 by Carlos CM (Mexico)

I see an ill construct

  CASE
    IF N==1 THEN Av:= 0.64; fyv:=2350 END;
    IF N==2 THEN Av:=1.42; fyv:=4200 END;
    Av:=2.54; fyv:=4200;
  END;
You should use "DEFAULT" keyword for last part.
  CASE
    IF N==1 THEN Av:= 0.64; fyv:=2350 END;
    IF N==2 THEN Av:=1.42; fyv:=4200 END;
    DEFAULT Av:=2.54; fyv:=4200;
  END;
and you have an other one in
        CASE
          IF (FCG*1E3*V) < Vcr THEN s:= d/2 END;
          IF (FCG*1E3*V) <Vc1 THEN s:= MIN(s1, d/2) *1_cm END;
        s:= MIN(s1, d/4) *1_cm END;
and
        CASE IF N==1 THEN PRINT("E 1/4 plg @ " + s) END;
          IF N==2 THEN PRINT("E 3/8 plg @ " + s) END;
        PRINT("E 1/2 plg @ " + s) END;

and it looks like an "END" is missing somewhere
      
Re: Problem with debug HP prime program, somebody help me?
Message #6 Posted by Han on 4 Dec 2013, 10:21 p.m.,
in response to message #1 by Carlos CM (Mexico)

Have you performed a firmware update?

            
Re: Problem with debug HP prime program, somebody help me?
Message #7 Posted by Carlos CM (Mexico) on 5 Dec 2013, 3:07 p.m.,
in response to message #6 by Han

I did The firmware updates today and I repair the STATEMET "DEFAULT" but the problem continues...
I'll check it with patience

Thanks to all...see you in a new post


[ Return to Index | Top of Index ]

Go back to the main exhibit hall