I need a c++ function which counts down a time. how can I use the internal clock?
Hello Marcel, I guess using the “ctime” or “chrono” std:: libs will supply the functions you need… → find examples here “cppreference.com”
Or you can use the Commons Class “/Arp/System/Commons/Chrono/Timer” → it is partly documented already in the header.
A Documentation and Examples regarding this will be uploaded sometime in the next month.
Hello, I want to build a TON function using C++ and the ctime library. Unfortunately when I transfer the program to the controller, I’m always having the PLC on FAIL state. I tested the programm and it’s working. Here are the .cpp file and .hpp file This program is just outputing the seconds from the 1st January 2018. Did i missed something ?
Hello Dom, can you send a copy of your “/opt/plcnext/logs/Output.log” file? I don´t see any obvious errors. What does your “MyProgram.progmeta” file look like? Are you using the correct SDK for your controllers FW?
There was a big change between FW 1.0 +SDK and FW 1.0.2 + SDK.
Hello Oliver, False alarm … I was using an old library which I wasn’t changing actually. Made a clean library from my C++ program, double checked the progmeta and everything is working now ! Thank you for your advice on looking for the log file.
