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 

 Addendum: SGN function does not work correctly Kategorie: Verschiedenes (von MaPi - 19.06.2011 1:35)
 Als Antwort auf Re: CCIUM2.0x OS Bug Roundup von MaPi - 15.06.2011 9:25
MaPi nutzt:  CC1-Unit V1.1, CC1-M-Unit V1.1, CC1-Station V1.1, C-Control 2
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:

Re: Addendum: SGN function does not work correctly (von Windt H.J. - 20.06.2011 17:36)
    Re: Addendum: SGN function does not work correctly (von MaPi - 20.06.2011 21:57)