# \#c-cpp

**URL:** https://community.br-automation.com/tag/c-cpp/93.md

[Latest](https://community.br-automation.com/latest.md) · [Categories](https://community.br-automation.com/categories.md) · [Tags](https://community.br-automation.com/tags.md)

---

## [Using C++11 (and later) standard library](https://community.br-automation.com/t/using-c-11-and-later-standard-library/9037)

<div class="topic-metadata">

**Author:** [@Lukas\_Kimme](https://community.br-automation.com/u/Lukas_Kimme)\
**Replies:** 8\
**Last updated:** [August 20, 2026, 7:32am UTC](https://community.br-automation.com/t/using-c-11-and-later-standard-library/9037 "2026-08-20T07:32:38Z")

</div>

Hi community, I was trying to compile a minimal example of a C++ program using a function from the standard library, that is available only in C++11 and newer, namely std::log2 from the cmath header. However, I am getti…

---

## [How to get the time from a X20-system without using AsTime och std::chrono in C++](https://community.br-automation.com/t/how-to-get-the-time-from-a-x20-system-without-using-astime-och-std-chrono-in-c/10029)

<div class="topic-metadata">

**Author:** [@johan.dehn](https://community.br-automation.com/u/johan.dehn)\
**Replies:** 2\
**Last updated:** [February 6, 2026, 10:53am UTC](https://community.br-automation.com/t/how-to-get-the-time-from-a-x20-system-without-using-astime-och-std-chrono-in-c/10029 "2026-02-06T10:53:01Z")

</div>

Does anyone know how to get the time using C++ without using AsTime or std::chrono. Customer is running Compact S (ARM), but should also work on standard PC / Simulation. Kind Regards // Johan

---

## [Encode/decode with AES algorithm](https://community.br-automation.com/t/encode-decode-with-aes-algorithm/9494)

<div class="topic-metadata">

**Author:** [@Lothar\_Waibel](https://community.br-automation.com/u/Lothar_Waibel)\
**Replies:** 4\
**Last updated:** [January 12, 2026, 7:46am UTC](https://community.br-automation.com/t/encode-decode-with-aes-algorithm/9494 "2026-01-12T07:46:32Z")

</div>

Does anyone have exprience with encoding / decoding data with AES algorithm? I am looking for a sample code. Thanks for informations. Lothar

---

## [Using #define in C code](https://community.br-automation.com/t/using-define-in-c-code/8036)

<div class="topic-metadata">

**Author:** [@kenneth.tham](https://community.br-automation.com/u/kenneth.tham)\
**Replies:** 5\
**Last updated:** [August 22, 2025, 2:01am UTC](https://community.br-automation.com/t/using-define-in-c-code/8036 "2025-08-22T02:01:24Z")

</div>

Hi, I faced some issue using #define in C code. It was ok in C++ code. An example is below: #define NO\_OF\_INPUTS 3 int connections\[NO\_OF\_INPUTS\]; I was not able to compile the code in a C file in B&R studio. Is this …

---

## [Dropped frames with AsHttp](https://community.br-automation.com/t/dropped-frames-with-ashttp/5010)

<div class="topic-metadata">

**Author:** [@c453531](https://community.br-automation.com/u/c453531)\
**Replies:** 3\
**Last updated:** [January 3, 2025, 12:17pm UTC](https://community.br-automation.com/t/dropped-frames-with-ashttp/5010 "2025-01-03T12:17:16Z")

</div>

Hi, We are using the AsHttp library for REST communication between our X20CP0410 and a robot. The communication is working most of the time, but we have an issue where we are sometimes missing frames, and we are not su…

---

## [Equivalent for C++ Sleep](https://community.br-automation.com/t/equivalent-for-c-sleep/5249)

<div class="topic-metadata">

**Author:** [@kenneth.tham](https://community.br-automation.com/u/kenneth.tham)\
**Replies:** 3\
**Last updated:** [December 17, 2024, 9:43am UTC](https://community.br-automation.com/t/equivalent-for-c-sleep/5249 "2024-12-17T09:43:14Z")

</div>

Hi, Is there an equivalent of the C++ Sleep function for BnR Automation C++? Thanks and Regards, Kenneth

---

## [ArEventLog utility functions in C++](https://community.br-automation.com/t/areventlog-utility-functions-in-c/3615)

<div class="topic-metadata">

**Author:** [@kenneth.tham](https://community.br-automation.com/u/kenneth.tham)\
**Replies:** 3\
**Last updated:** [June 26, 2024, 7:59am UTC](https://community.br-automation.com/t/areventlog-utility-functions-in-c/3615 "2024-06-26T07:59:36Z")

</div>

Hi, I am developing a utility file for ArEventLog in C++ for use in my PLC code. The code is largely built upon another member contribution from my earlier queries. I was wondering if there were any suggestions of possib…

---

## [Default argument in C++](https://community.br-automation.com/t/default-argument-in-c/3578)

<div class="topic-metadata">

**Author:** [@kenneth.tham](https://community.br-automation.com/u/kenneth.tham)\
**Replies:** 2\
**Last updated:** [June 21, 2024, 2:14pm UTC](https://community.br-automation.com/t/default-argument-in-c/3578 "2024-06-21T14:14:32Z")

</div>

I am trying to develop a function LogMsg with a default argument. It seems that when I try to override the argument in a function call, the default argument value is still used. Does anyone encounter this issue? My func…

---

## [Passing argument 3 of "ExtGetHostPkt" from incompatible pointer type \[-Wincompatible-pointer-types\]](https://community.br-automation.com/t/passing-argument-3-of-extgethostpkt-from-incompatible-pointer-type-wincompatible-pointer-types/2693)

<div class="topic-metadata">

**Author:** [@Lukas\_Angst](https://community.br-automation.com/u/Lukas_Angst)\
**Replies:** 3\
**Last updated:** [March 28, 2024, 3:13pm UTC](https://community.br-automation.com/t/passing-argument-3-of-extgethostpkt-from-incompatible-pointer-type-wincompatible-pointer-types/2693 "2024-03-28T15:13:46Z")

</div>

Hello There I’m new to the B&R Community and happy to be here :slight\_smile: I’m using target-for-Simulink to generate c-code from my Simulink model. The code generation works fine. I can generate the code from my mode…

---

## [Best Practice C++](https://community.br-automation.com/t/best-practice-c/1582)

<div class="topic-metadata">

**Author:** [@SchmidtF](https://community.br-automation.com/u/SchmidtF)\
**Replies:** 8\
**Last updated:** [February 21, 2024, 7:26am UTC](https://community.br-automation.com/t/best-practice-c/1582 "2024-02-21T07:26:03Z")

</div>

Hello everyone, are there people here who write libraries or tasks in c++ on the plc? I tried it once and realised that the Automation Studio help quickly reaches its limits. Would you have some basic tips and tricks …

---

## [Immediate C++ system crashes](https://community.br-automation.com/t/immediate-c-system-crashes/1618)

<div class="topic-metadata">

**Author:** [@hvt](https://community.br-automation.com/u/hvt)\
**Replies:** 0\
**Last updated:** [December 18, 2023, 8:29pm UTC](https://community.br-automation.com/t/immediate-c-system-crashes/1618 "2023-12-18T20:29:06Z")

</div>

Hi. I want to share two problems with c++ i encountered and which cause an immediate system crash. In both cases there is no chance to use the debugger - they have to be solved statically. The problems are related to va…
