Das Open-Control-Projekt - Die Alternative zur C-Control-I


Das Forum zur C-Control-1
Welche C-Control-Varianten existieren?
Übersicht - Suchen - Neueste 50 Beiträge - Neuer Beitrag - Login - Registrieren
INFO - FAQ - CC2-Forum - CCPro-Forum 

 Re: Addendum: SGN function does not work correctly Kategorie: Programmierung Basic (von MaPi - 20.06.2011 21:57)
 Als Antwort auf Re: Addendum: SGN function does not work correctly von Windt H.J. - 20.06.2011 17:36
MaPi nutzt:  CC1-Unit V1.1, CC1-M-Unit V1.1, CC1-Station V1.1, C-Control 2
Hello,
I have seen your conversation on the other discussion board especially made for CControl 1 V2.0.
Well, changing a manual is much easier than looking for the bug and to fix it.
Now I was searching the data base there and found already some comments regarding the SGN function where no manual was intended to be aligned.

Fazit: The "V2.0" adder means much more hard work and sleepless nights than anyone could think.
It doesn't matter if the SGN needs a new manual or if it has a bug. "V2.0" is not a solution for my projects. I stay with CControl1.1 and consider to discover OM versions.

By the way, the example I made below contains a bug (unfortunately I don't have an excuse):
"IF C < 0 THEN GOTO Kleiner_Null" must be "IF sw_Function1_Return < 0 THEN GOTO Kleiner_Null"

Kind regards,
MaPi

> > Just an addendum as a result of my recent work:
> > I just found out that the SGN function in CControl 1 V2.0 does not work correctly.
> > When evaluating a positive number, for example SGN(5), the function replies (0) instead of (1).
> > I made a workaround with some IF THEN lines as shown below:
> >
> > 'ROUTINE ALS ERSATZ DER DEFEKTEN SGN-FUNKTION
> > 'in wird zu pruefender Wert uebergeben
> >
> > #Signum_Funktion
> > IF C < 0 THEN GOTO Kleiner_Null
> > IF sw_Function1_Return = 0 THEN GOTO Gleich_Null
> > IF sw_Function1_Return > 0 THEN GOTO Groesser_Null
> > #Kleiner_Null
> > sw_Function1_Return = -1
> > RETURN
> > #Gleich_Null
> > sw_Function1_Return = 0
> > RETURN
> > #Groesser_Null
> > sw_Function1_Return = 1
> > RETURN
> >
> > MaPi

 Antwort schreiben

Bisherige Antworten: