<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Get the numer of day </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2788f4ae67/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2788f4ae67/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/2788f4ae67/</id><updated>2023-09-15T05:10:44.530000Z</updated><subtitle>Recent posts to Get the numer of day </subtitle><entry><title>Get the numer of day </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2788f4ae67/?limit=25#29cb" rel="alternate"/><published>2023-09-15T05:10:44.530000Z</published><updated>2023-09-15T05:10:44.530000Z</updated><author><name>fefefede</name><uri>https://forge.codesys.com/u/fefefede/</uri></author><id>https://forge.codesys.com5bc5e3f8fc3720627b9f14512a7ada3f9bec5c54</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello and thank you so much for your replay. I'm a beginner and i have install the library but i cant use..how can i use a library and function on codesys?&lt;/p&gt;
&lt;p&gt;I try to insert on my POU VAR &lt;/p&gt;
&lt;p&gt;rtcInstance: SysTimeRtc.ReadTime;  // Dichiara una variabile per la funzione di lettura&lt;/p&gt;
&lt;p&gt;And then on my program&lt;/p&gt;
&lt;p&gt;// Leggi il tempo reale&lt;br/&gt;
rtcInstance();&lt;/p&gt;
&lt;p&gt;But have this error&lt;/p&gt;
&lt;p&gt;"C0035: Program name, function or function block instance expected insted of "rtcInstance" &lt;/p&gt;
&lt;p&gt;Where i'm wrong?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Get the numer of day </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2788f4ae67/?limit=25#a4f7" rel="alternate"/><published>2023-09-15T05:10:36.485000Z</published><updated>2023-09-15T05:10:36.485000Z</updated><author><name>fefefede</name><uri>https://forge.codesys.com/u/fefefede/</uri></author><id>https://forge.codesys.comc65048239d707e1b085bb4b0b205f6c8d13f17fa</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello and thank you so much for your replay. I'm a beginner and i have install the library but i cant use..how can i use a library and function on codesys?&lt;/p&gt;
&lt;p&gt;I try to insert on my POU VAR &lt;/p&gt;
&lt;p&gt;rtcInstance: SysTimeRtc.ReadTime;  // Dichiara una variabile per la funzione di lettura&lt;/p&gt;
&lt;p&gt;And then on my program&lt;/p&gt;
&lt;p&gt;// Leggi il tempo reale&lt;br/&gt;
rtcInstance();&lt;/p&gt;
&lt;p&gt;But have this error&lt;/p&gt;
&lt;p&gt;"C0035: Program name, function or function block instance expected insted of "rtcInstance" &lt;/p&gt;
&lt;p&gt;Where i'm wrong?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Get the numer of day </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2788f4ae67/?limit=25#1f5a" rel="alternate"/><published>2023-09-14T22:22:18.208000Z</published><updated>2023-09-14T22:22:18.208000Z</updated><author><name>snhatton</name><uri>https://forge.codesys.com/u/snhatton/</uri></author><id>https://forge.codesys.com78a13ae7c4d2c7daa6b9de07d13cc35c8e7bfd60</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The SysTimeRtcConvertUtcToDate function does this for you and applies the output to RTS_SYSTIMEDATE struct. This is part of the SysTimeRtc library. &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Get the numer of day </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2788f4ae67/?limit=25#a724" rel="alternate"/><published>2023-09-14T10:20:35.297000Z</published><updated>2023-09-14T10:20:35.297000Z</updated><author><name>TimvH</name><uri>https://forge.codesys.com/u/timvh/</uri></author><id>https://forge.codesys.comad161a20384f54c26e827b520a8336803ab97e0a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;For a demo application related to date/time, see:&lt;br/&gt;
&lt;a href="https://forge.codesys.com/prj/codesys-example/date-and-time/home/Home/"&gt;https://forge.codesys.com/prj/codesys-example/date-and-time/home/Home/&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Get the numer of day </title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/2788f4ae67/?limit=25#a7ae" rel="alternate"/><published>2023-09-14T05:33:56.648000Z</published><updated>2023-09-14T05:33:56.648000Z</updated><author><name>fefefede</name><uri>https://forge.codesys.com/u/fefefede/</uri></author><id>https://forge.codesys.com845c852b925ffb3712f4696691380aa36c873f24</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello i tro to create a program to turn on or off the air condition in relationship temperature and numer of day. I can't get the number of day. &lt;/p&gt;
&lt;p&gt;I try this after installing SysTime library but this not work and have this error on debug &lt;br/&gt;
------ Build started: Application: Device.Sim.Device.Application -------&lt;br/&gt;
                Typify code...&lt;br/&gt;
                Generate code...&lt;br/&gt;
&lt;span&gt;[ERROR]&lt;/span&gt;         giorno_accensione_aria: PLC_PRG &lt;a class="" href="../Line%201,%20Column%201%20(Impl)"&gt;Device: PLC Logic: Application&lt;/a&gt;: C0032:  Cannot convert type 'Unknown type: 'SysTimeCore(TRUE)'' to type 'TIME'&lt;br/&gt;
&lt;span&gt;[ERROR]&lt;/span&gt;         giorno_accensione_aria: PLC_PRG &lt;a class="" href="../Line%201,%20Column%201%20(Impl)"&gt;Device: PLC Logic: Application&lt;/a&gt;: C0035:  Program name, function or function block instance expected instead of 'SysTimeCore'&lt;br/&gt;
&lt;span&gt;[ERROR]&lt;/span&gt;         giorno_accensione_aria: PLC_PRG &lt;a class="" href="../Line%202,%20Column%201%20(Impl)"&gt;Device: PLC Logic: Application&lt;/a&gt;: C0032:  Cannot convert type 'Unknown type: 'DayOfWeek(CurrentTime)'' to type 'INT'&lt;br/&gt;
&lt;span&gt;[ERROR]&lt;/span&gt;         giorno_accensione_aria: PLC_PRG &lt;a class="" href="../Line%202,%20Column%201%20(Impl)"&gt;Device: PLC Logic: Application&lt;/a&gt;: C0035:  Program name, function or function block instance expected instead of 'DayOfWeek'&lt;br/&gt;
&lt;span&gt;[INFORMATION]&lt;/span&gt;   giorno_accensione_aria: PLC_PRG &lt;a class="" href="../Line%208%20(Decl)"&gt;Device: PLC Logic: Application&lt;/a&gt;: C0181:  Related position&lt;br/&gt;
                Build complete -- 4 errors, 0 warnings : No download possible&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;PROGRAM&lt;/span&gt; &lt;span class="nt"&gt;PLC_PRG&lt;/span&gt;
&lt;span class="nt"&gt;VAR&lt;/span&gt;
  &lt;span class="nt"&gt;Temperatura&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;UDINT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="nt"&gt;AriaCondizionata&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;BOOL&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;FALSE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="nt"&gt;CurrentDayOfWeek&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;INT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt;&lt;span class="nt"&gt;Variabile&lt;/span&gt; &lt;span class="nt"&gt;Giorno&lt;/span&gt; 
  &lt;span class="nt"&gt;CurrentTime&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;TIME&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;  
  &lt;span class="nt"&gt;GiornoDellaSettimana&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;INT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="nt"&gt;DayOfWeek&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;INT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_VAR&lt;/span&gt;

&lt;span class="nt"&gt;CurrentTime&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;SysTimeCore&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;TRUE&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;  &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Ottieni&lt;/span&gt; &lt;span class="nt"&gt;l&lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="nt"&gt;ora&lt;/span&gt; &lt;span class="nt"&gt;corrente&lt;/span&gt;
&lt;span class="nt"&gt;CurrentDayOfWeek&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;DayOfWeek&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;CurrentTime&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

&lt;span class="nt"&gt;CASE&lt;/span&gt; &lt;span class="nt"&gt;GiornoDellaSettimana&lt;/span&gt; &lt;span class="nt"&gt;OF&lt;/span&gt;
  &lt;span class="nt"&gt;1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Azioni&lt;/span&gt; &lt;span class="nt"&gt;per&lt;/span&gt; &lt;span class="nt"&gt;Lunedì&lt;/span&gt;
  &lt;span class="nt"&gt;2&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Martedì&lt;/span&gt; &lt;span class="nt"&gt;se&lt;/span&gt; &lt;span class="nt"&gt;più&lt;/span&gt; &lt;span class="nt"&gt;10&lt;/span&gt;&lt;span class="err"&gt;°&lt;/span&gt; &lt;span class="nt"&gt;accend&lt;/span&gt; &lt;span class="nt"&gt;altrimenti&lt;/span&gt; &lt;span class="nt"&gt;spegni&lt;/span&gt;
&lt;span class="nt"&gt;IF&lt;/span&gt; &lt;span class="nt"&gt;Temperatura&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="nt"&gt;10&lt;/span&gt; &lt;span class="nt"&gt;THEN&lt;/span&gt;
    &lt;span class="nt"&gt;AriaCondizionata&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;TRUE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;ELSE&lt;/span&gt;
    &lt;span class="nt"&gt;AriaCondizionata&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;FALSE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;  
&lt;span class="nt"&gt;END_IF&lt;/span&gt;
  &lt;span class="nt"&gt;3&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Mercoledì&lt;/span&gt; &lt;span class="nt"&gt;se&lt;/span&gt; &lt;span class="nt"&gt;più&lt;/span&gt; &lt;span class="nt"&gt;di&lt;/span&gt; &lt;span class="nt"&gt;50&lt;/span&gt;&lt;span class="err"&gt;°&lt;/span&gt; &lt;span class="nt"&gt;accendi&lt;/span&gt; &lt;span class="nt"&gt;altrimenti&lt;/span&gt; &lt;span class="nt"&gt;spegni&lt;/span&gt;
&lt;span class="nt"&gt;IF&lt;/span&gt; &lt;span class="nt"&gt;Temperatura&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="nt"&gt;50&lt;/span&gt; &lt;span class="nt"&gt;THEN&lt;/span&gt;
    &lt;span class="nt"&gt;AriaCondizionata&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;TRUE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;ELSE&lt;/span&gt;
    &lt;span class="nt"&gt;AriaCondizionata&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;FALSE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_IF&lt;/span&gt;
  &lt;span class="nt"&gt;4&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Giovedì&lt;/span&gt; &lt;span class="nt"&gt;se&lt;/span&gt; &lt;span class="nt"&gt;più&lt;/span&gt; &lt;span class="nt"&gt;di&lt;/span&gt; &lt;span class="nt"&gt;40&lt;/span&gt;&lt;span class="err"&gt;°&lt;/span&gt; &lt;span class="nt"&gt;accendi&lt;/span&gt; &lt;span class="nt"&gt;altrimenti&lt;/span&gt; &lt;span class="nt"&gt;spegni&lt;/span&gt;
&lt;span class="nt"&gt;IF&lt;/span&gt; &lt;span class="nt"&gt;Temperatura&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="nt"&gt;40&lt;/span&gt; &lt;span class="nt"&gt;THEN&lt;/span&gt;
    &lt;span class="nt"&gt;AriaCondizionata&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;TRUE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;ELSE&lt;/span&gt;
    &lt;span class="nt"&gt;AriaCondizionata&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;FALSE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_IF&lt;/span&gt;
  &lt;span class="nt"&gt;5&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Venerdì&lt;/span&gt; &lt;span class="nt"&gt;se&lt;/span&gt; &lt;span class="nt"&gt;più&lt;/span&gt; &lt;span class="nt"&gt;di&lt;/span&gt; &lt;span class="nt"&gt;50&lt;/span&gt;&lt;span class="err"&gt;°&lt;/span&gt; &lt;span class="nt"&gt;accendi&lt;/span&gt; &lt;span class="nt"&gt;altrimenti&lt;/span&gt; &lt;span class="nt"&gt;spegni&lt;/span&gt;
&lt;span class="nt"&gt;IF&lt;/span&gt; &lt;span class="nt"&gt;Temperatura&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="nt"&gt;50&lt;/span&gt; &lt;span class="nt"&gt;THEN&lt;/span&gt;
    &lt;span class="nt"&gt;AriaCondizionata&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;TRUE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;ELSE&lt;/span&gt;
    &lt;span class="nt"&gt;AriaCondizionata&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;FALSE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_IF&lt;/span&gt;
  &lt;span class="nt"&gt;6&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Sabato&lt;/span&gt; &lt;span class="nt"&gt;se&lt;/span&gt; &lt;span class="nt"&gt;più&lt;/span&gt; &lt;span class="nt"&gt;di&lt;/span&gt; &lt;span class="nt"&gt;25&lt;/span&gt;&lt;span class="err"&gt;°&lt;/span&gt; &lt;span class="nt"&gt;accendi&lt;/span&gt; &lt;span class="nt"&gt;altrimenti&lt;/span&gt; &lt;span class="nt"&gt;spegni&lt;/span&gt;
&lt;span class="nt"&gt;IF&lt;/span&gt; &lt;span class="nt"&gt;Temperatura&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt;&lt;span class="nt"&gt;25&lt;/span&gt; &lt;span class="nt"&gt;THEN&lt;/span&gt;
    &lt;span class="nt"&gt;AriaCondizionata&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;TRUE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;ELSE&lt;/span&gt;
    &lt;span class="nt"&gt;AriaCondizionata&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;FALSE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_IF&lt;/span&gt;
  &lt;span class="nt"&gt;7&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
    &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Domenica&lt;/span&gt; &lt;span class="nt"&gt;sempre&lt;/span&gt; &lt;span class="nt"&gt;spenta&lt;/span&gt;
    &lt;span class="nt"&gt;AriaCondizionata&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;FALSE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_CASE&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry></feed>