<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to How to get license status from inside structured language</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/955904fd80/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/955904fd80/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/955904fd80/</id><updated>2023-06-15T09:18:00.080000Z</updated><subtitle>Recent posts to How to get license status from inside structured language</subtitle><entry><title>How to get license status from inside structured language</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/955904fd80/?limit=50#00e1" rel="alternate"/><published>2023-06-15T09:18:00.080000Z</published><updated>2023-06-15T09:18:00.080000Z</updated><author><name>rossanoparis</name><uri>https://forge.codesys.com/u/rossanoparis/</uri></author><id>https://forge.codesys.comd4733cf9b6909d0ed375e0e423be7f87bfc1c153</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you @TimvH, it was very kind of you&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to get license status from inside structured language</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/955904fd80/?limit=25#5dfd" rel="alternate"/><published>2023-06-14T13:50:11.448000Z</published><updated>2023-06-14T13:50:11.448000Z</updated><author><name>TimvH</name><uri>https://forge.codesys.com/u/timvh/</uri></author><id>https://forge.codesys.com91b4d583d6e9f3a0d64f5d335f6bc302d31234fb</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;You can read the status of the license from your application through the CmpCodeMeter library.&lt;/p&gt;
&lt;p&gt;See &lt;a href="https://forge.codesys.com/forge/talk/Runtime/thread/1c1b00cfc7/"&gt;https://forge.codesys.com/forge/talk/Runtime/thread/1c1b00cfc7/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So the code could be something like (change the numbers according to the licenses you are searching for):&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;VAR&lt;/span&gt;
    &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;add&lt;/span&gt; &lt;span class="nt"&gt;CmpCodeMeter&lt;/span&gt; &lt;span class="nt"&gt;library&lt;/span&gt;
    &lt;span class="nt"&gt;xCheckLicense&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;xFound&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;Handle&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;CmpCodeMeter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RTS_IEC_HANDLE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="nt"&gt;Result&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;CmpCodeMeter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RTS_IEC_RESULT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_VAR&lt;/span&gt;

&lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;check&lt;/span&gt; &lt;span class="nt"&gt;for&lt;/span&gt; &lt;span class="nt"&gt;valid&lt;/span&gt; &lt;span class="nt"&gt;Raspberry&lt;/span&gt; &lt;span class="nt"&gt;Pi&lt;/span&gt; &lt;span class="nt"&gt;license&lt;/span&gt;
&lt;span class="nt"&gt;IF&lt;/span&gt; &lt;span class="nt"&gt;xCheckLicense&lt;/span&gt; &lt;span class="nt"&gt;THEN&lt;/span&gt;
    &lt;span class="nt"&gt;xCheckLicense&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;xFound&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;Handle&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;CmpCodeMeter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CodeMOpen&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;udiFirmCode&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;5000304&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;udiProductCode&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;603001&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;udiFeatureCode&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;16&lt;/span&gt;&lt;span class="p"&gt;#&lt;/span&gt;&lt;span class="nn"&gt;1&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;Result&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;Result&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
    &lt;span class="nt"&gt;IF&lt;/span&gt; &lt;span class="nt"&gt;Handle&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;CmpCodeMeter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SysTypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RTS_INVALID_HANDLE&lt;/span&gt; &lt;span class="nt"&gt;AND&lt;/span&gt; &lt;span class="nt"&gt;Result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nt"&gt;CmpCodeMeter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Errors&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ERR_OK&lt;/span&gt; &lt;span class="nt"&gt;THEN&lt;/span&gt;
        &lt;span class="nt"&gt;xFound&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;CmpCodeMeter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;CodeMClose&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;hCodeMeter&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;Handle&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;END_IF&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Maybe also interesting:&lt;br/&gt;
&lt;a href="https://faq.codesys.com/display/CDSFAQ/Licensing%3A+Querying+the+Container+Information" rel="nofollow"&gt;https://faq.codesys.com/display/CDSFAQ/Licensing%3A+Querying+the+Container+Information&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>How to get license status from inside structured language</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/955904fd80/?limit=50#0762" rel="alternate"/><published>2023-06-14T11:35:38.128000Z</published><updated>2023-06-14T11:35:38.128000Z</updated><author><name>rossanoparis</name><uri>https://forge.codesys.com/u/rossanoparis/</uri></author><id>https://forge.codesys.com7b3b9b84a603a64521a05cc6fc869a96590b25d1</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I'd like to monitor CODESYS licences used in my automation solution, in particular the runtime licence and the soft motion licence.&lt;br/&gt;
My need is to rise two alarms on the HMI system in case such licences are missing.&lt;br/&gt;
Is that possible ? Could someone suggest a way in order to get that working?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br/&gt;
Rossano&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>