# RegisterVariable > Symcon documentation · English · generated on 2026-09-26 > Index: https://www.symcon.de/en/llms.txt Source: https://www.symcon.de/en/service/documentation/module-reference/core-instances/registervariable/ The RegisterVariable provides a data forwarding interface and data processing interface. ### Configuration If you have not set up your device, please follow the steps on this page: [embed devices] [2] The RegisterVariable module connects automatically with a parent instance. You need to select parent instance or create a new one. You can also add another splitter (e.g. cutter) to synchronize the incoming data directly before evaluation. The parent instance can be adjusted easily by using the function "Change Gateway" at the top of the configuration. ![Change Gateway](https://www.symcon.de/media/pages/service/dokumentation/modulreferenz/kern-instanzen/registervariable/b990342c74-1790424938/registervariable-gateway-aendern.png) The execution of scripts is __serial__. It means that you do not have to protect your scripts with semaphores. ### Date processing If the the parent instance (communication interface) receives new data, the target script of the RegisterVariable instance will be run. In this the received data over $ _IPS ['VALUE'] is available. There are data sources that provide a meaningful evaluation after receiving several data transmissions. Therefore, the received data is temporarily stored. Problem can occur, if you store binary data in a normal string variable in IP-Symcon (defective IP-Symcon configuration). There is the function RegVar_SetBuffer (integer $InstanzID, string $buffer) that stores the data in the buffer associated to the RegisterVariable instance. The data stored in the buffer can be read with the function RegVar_GetBuffer (integer $InstanzID). The function RegVar_SendText (integer $InstanzID, string $ text) can send data strings over the communication interface. Internally, the appropriate transmission function (e.g. COMPort_SendText) is executed. > **Note:** The buffer is cleared after restarting IP-Symcon > **Warning:** Please DO NOT use VARIABLE as a buffer. Otherwise, it may cause instability within IP-Symcon and at worst cause a completely destroyed configuration. Since this problem can also affect the incremental backup folder, you may not even have a backup configuration. Take advantage of the internal buffer of the instance, to cache data. > [RegVar_SetBuffer](registervariable.md) / [RegVar_GetBuffer](registervariable.md) ### Example The following example chaines received data and gives out by ; separated records at completion: ```php // wenn das Skript von einer RegisterVariable-Instanz aus aufgerufen worden ist if ($_IPS['SENDER'] == "RegisterVariable") { // bereits im Puffer der Instanz vorhandene Daten in $data kopieren $data = RegVar_GetBuffer($_IPS['INSTANCE']); // neu empfangene Daten an $data anhängen $data .= $_IPS['VALUE']; // wenn das Trennzeichen ; in $data gefunden worden ist if (strpos($data, ';')) { // $data in durch ; separierte Datensätze zerlegen $datasets = explode(';', $data); // alle nicht durch ; terminierten Datensätze ausgeben for ($i = 0; $i < count($datasets) - 1; $i++) { echo "empfangener Datensatz: ".$datasets[$i]."\n"; } // $data auf den Inhalt des letzten (unvollständigen) Datensatzes setzen $data = $datasets[count($datasets) - 1]; } // Inhalt von $data im Puffer der RegisterVariable-Instanz speichern RegVar_SetBuffer($_IPS['INSTANCE'], $data); } ``` Following example chaines received data and outputs blocks from a length of exactly 16 characters: ```php // wenn das Skript von einer RegisterVariable-Instanz aus aufgerufen worden ist if ($_IPS['SENDER'] == "RegisterVariable") { // bereits im Puffer der Instanz vorhandene Daten in $data kopieren $data = RegVar_GetBuffer($_IPS['INSTANCE']); // neu empfangene Daten an $data anhängen $data .= $_IPS['VALUE']; // wenn $data mindestens 16 Zeichen lang ist if (strlen($data) >= 16) { // $data in Blöcke von bis zu 16 Zeichen zerlegen $datasets = str_split($data, 16); // $data leeren $data = ""; // alle Datensätze durcharbeiten for ($i = 0; $i < count($datasets); $i++) { // vollständige Datensätze (genau 16 Zeichen lang) ausgeben if (strlen($datasets[$i]) == 16) { echo "empfangener Datensatz: ".$datasets[$i]."\n"; } else { // Unvollständige Datensätze in $data schreiben $data = $datasets[$i]; } } } // Inhalt von $data im Puffer der RegisterVariable-Instanz speichern RegVar_SetBuffer($_IPS['INSTANCE'], $data); } ``` ## RegVar_GetBuffer Source: https://www.symcon.de/en/service/documentation/module-reference/core-instances/registervariable/regvar-getbuffer/ `bool RegVar_GetBuffer(int $InstanceID)` **Parameters** - `$InstanceID` (int): ID of the device to be switched **Returns** (bool): String of the current buffer ID of the device to be switched **Example** ```php $buf = RegVar_GetBuffer(12345); $buf .= $_IPS['VALUE']; //Concatenating //verarbeiten ... RegVar_SetBuffer(12345, $buf); //Write back remaining buffer ``` ## RegVar_SendEvent Source: https://www.symcon.de/en/service/documentation/module-reference/core-instances/registervariable/regvar-sendevent/ `bool RegVar_SendEvent(int $InstanceID, int $ReportID, string $Text)` _Requires Symcon >= 4.1_ sends an event to the parent HID instance **Parameters** - `$InstanceID` (int): ID of the RegisterVariable-Instance - `$ReportID` (int): The record type as ReportID - `$Text` (string): Buffer to send **Returns** (bool): If the command succeeds, it returns __TRUE__, otherwise __FALSE__. Buffer to send **Example** ```php //Send an event “Hello World” to the parent instance with the ReportID 0 RegVar_SendEvent(12345, 0, "Hello World"); ``` ## RegVar_SendPacket Source: https://www.symcon.de/en/service/documentation/module-reference/core-instances/registervariable/regvar-sendpacket/ `bool RegVar_SendPacket(int $InstanceID, string $Text, string $ClientIP, string $ClientPort)` _Requires Symcon >= 4.1_ sends a data packet to the specified IP address **Parameters** - `$InstanceID` (int): ID of the RegisterVariable-Instance - `$Text` (string): Buffer to send - `$ClientIP` (string): IP address to send to - `$ClientPort` (string): Port to send to **Returns** (bool): If the command succeeds, it returns __TRUE__, otherwise __FALSE__. Port to send to **Example** ```php // Sends the packet "Hello World" via ServerSocket to IP:Port 192.168.1.2:1234 RegVar_SendPacket(12345, "Hello World", "192.168.1.2", 1234); ``` ## RegVar_SendText Source: https://www.symcon.de/en/service/documentation/module-reference/core-instances/registervariable/regvar-sendtext/ `bool RegVar_SendText(int $InstanceID, string $Text)` sends data to the parent instance **Parameters** - `$InstanceID` (int): ID of the device to be switched - `$Text` (string): Buffer to be sent **Returns** (bool): If the command succeeds, it returns __TRUE__, otherwise __FALSE__. Buffer to be sent **Example** ```php RegVar_SendText(12345, "Hallo World"); ``` ## RegVar_SetBuffer Source: https://www.symcon.de/en/service/documentation/module-reference/core-instances/registervariable/regvar-setbuffer/ `bool RegVar_SetBuffer(int $InstanceID, string $Buffer)` sets the internal buffer **Parameters** - `$InstanceID` (int): ID of the device to be switched - `$Buffer` (string): Data to be written into the buffer **Returns** (bool): If the command succeeds, it returns __TRUE__, otherwise __FALSE__. Data to be written into the buffer **Example** ```php $buf = RegVar_GetBuffer(12345); $buf .= $_IPS['VALUE']; //Concatenating //verarbeiten ... RegVar_SetBuffer(12345, $buf); //Write back remaining buffer ```