Datenbank-Logging in Skript schalten!

Hallo,

habe versucht, im Forum, über das einschalten oder ausschalten von Datenbank-Logging einer Variable in einem Skript zu finden.
Leider war ich erfolglos.
Kann mir bitte einer auf die Sprünge helfen?

AC_SetLoggingStatus + IPS_ApplyChanges müsste sein :slight_smile:

paresy

Danke für die rasche Antwort.
IPS_ApplyChanges habe ich in der Befehlsreferenz gefunden.
Wenn ich es richtig verstanden habe dient dieser Befehl als Aktualisierung.

IPS_ApplyChanges ( ObjektID );
bringt -> Wrong parameter count for ac_setloggingstatus()

AC_SetLoggingStatus hatte ich im Beitrag von atmel
http://www.ip-symcon.de/forum/f18/funktion-ac_setloggingstatus-9622/
gefunden.

AC_SetLoggingStatus ( ObjektID, True );
bringt -> ips_applychanges: Instance #12784 not found!
:confused:

Und wo finde ich alle aktuellen Funktionen wie AC_SetLoggingStatus?
Habe einen Link von tdressler.net, wo es eine ALLFunktion gibt ( Stand? ).
Gibt es die hier?

18048 = ID Archivehandler
45967 = ID der Logging Variable

AC_SetLoggingStatus(18048,45967, false);
IPS_ApplyChanges(18048);

Viele get/set IPS Befehle sind intern und stehen nicht in der Doku.

Mit einem Skript von Thomas Dreßler die Funktionen von IPS in ein File schreiben lassen.

/**
 * IPS Functionslister
 * Exportiert alle IP-Symcon Funktionen mit einer Parameterliste
 * basiert auf IP-Symcon Dokumentation
 * (http://www.ip-symcon.de/service/dokumentation/befehlsreferenz/programminformationen/ips-getfunctionlist/)
 *
 * @package IPS
 * @subpackage AllFunctions
 * @copyright (C) Thomas Dreßler
 * @version V0.2 08.10.2010
 */

$instanceid = 0; //0 = Alle Funktionen, sonst Filter auf InstanzID
$fs = IPS_GetFunctionList($instanceid);
asort($fs);
$typestr = Array("boolean", "integer", "float", "string", "variant", "array");
$logfile="../ipsfunctions.php";
$log=fopen($logfile,"w");
$header='
/**
* IPS Functionsliste
* @author www.ipsymcon.de
* @package IPS
* @subpackage AllFunctions
*/
';
if ($log) {
   fwrite ($log,"<?php
");
   fwrite ($log,$header."
");
    foreach($fs as $f) {
        fwrite ($log,"
/**
");
        fwrite ($log,"* ".$f['FunctionName']."
");
        fwrite ($log,"* 
");
        fwrite ($log,"* @returns ".$typestr[$f['Result']['Type_']]. "
");
        $proto="function ".$f['FunctionName']."( ";
          $a = Array();
          foreach($f['Parameters'] as $p) {
           $enum=null;
             if(isset($p['Enumeration']) && sizeof($p['Enumeration']) > 0) {
               $b=Array();
              foreach($p['Enumeration'] as $k => $v) {
                    $b[] = $k."=".$v;
              }
              $type = "integer";
                $enum= "enum[".implode(", ", $b)."]";
             } else {
              $type = $typestr[$p['Type_']];
            }
            $pname=$p['Description'];
            $pname=preg_replace("/[\(\)]+/","",$pname);
           $proto.="$".$pname.",";
           fwrite ($log,"* @param ". $type. ' $'.$pname. "
");
              if ($enum) fwrite ($log,"*   ".$enum."
");
          }
          fwrite ($log,"*/

");
          $proto=substr($proto,0,strlen($proto)-1);
          $proto.=" ) {

}
";
          fwrite ($log,$proto);
    }
    fwrite ($log, "?>
");
     fflush($log);
    fclose($log);
}
$all=file_get_contents($logfile);
echo htmlentities($all);

Jetzt habe ich alle Funktionen in einem PHP-File.

Da ist zu lesen

/**
* AC_SetLoggingStatus
* 
* @returns boolean
* @param integer $InstanceID
* @param integer $VariableID
* @param boolean $Active
*/

function AC_SetLoggingStatus( $InstanceID,$VariableID,$Active ) {

}

Habe aber nur eine VariablenID und keine InstanceID.
In einer Kategorie sind die Variablen!
Oder übersehe ich da was?

UPS Antwort ist einstweilen von Thomas gekommen, Danke!
Gleich getestet!

Die Instanz ist die ID des Archivehandlers (unter Kern Instanzen).