---
title: "debug_print()"
canonical: "https://docs.xirgoglobal.com/space/SD/262111260/debug_print()"
format: markdown
---
### <span style="color: #36b37e">Description</span>

Prints data to an initialized peripheral.

### <span style="color: #36b37e">Syntax</span>

`debug_print(debug_text[], data...);`

### <span style="color: #36b37e">Parameters</span>

| **Variable** | **Input** |
| --- | --- |
| `debug_text[]` | Can either be text: “demo text“, “demo text data: %i, %x, %X, %f“  
or it can be previously formed array. This function doesn’t allow use of %s. |
| `data` | data variables which user wants to pass for printing. Maximum amount of variables should not exceed 10. |

### <span style="color: #36b37e">Returns</span>

|  |  |
| --- | --- |
| **Return value** | **Return explanation** |
| **SCRIPT_OPERATION_SUCCESS** | Success |
| **SCRIPT_OPERATION_FAILED** | Failed |

### <span style="color: #36b37e">Function call example</span>

##### **Example of debug_print **

```java
#include <io>
#include <read>
#include <float>
#include <string>
#include <core>
#include <write>
#include <define>
#include <socket>
#include <debug>

#define RS232_SPEED         115200
#define WORD_LENGTH         WORDLENGTH_8
#define STOP_BITS           STOPBITS_1
#define PARITY              PARITY_NONE

new data_1 = 15;
new data_2 = 20;
new predefined_string[20] = "Use example No.4\r\n";

main()
{
    Init(RS232, RS232_SPEED, WORD_LENGTH, STOP_BITS, PARITY);
    debug_init(RS232);
    
    // Use example No.1:
    debug_print("Use example No.1");
    
    // Use example No.2:
    debug_print("Use example No.2.\r\n data_1: %i \r\n", data_1);
    
    // Use example No.3:
    debug_print("Use example No.3.\r\n data_1: %i \r\n %i \r\n", data_1, data_2);
    
    // Use example No.4:
    debug_print(predefined_string);

    while(1)
    {
        Delay(100);
    }
}
```

### <span style="color: #36b37e">Notes and Warnings</span>

In order to disable debug print messages user can remove `#include <debug>` and recompile script. To re-enable debug print messages user should add `#include <debug>` as shown in line 9 of an example.