<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to calling a function block from ST</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/343de8ed14/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/343de8ed14/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/343de8ed14/</id><updated>2020-02-27T21:22:48.886000Z</updated><subtitle>Recent posts to calling a function block from ST</subtitle><entry><title>calling a function block from ST</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/343de8ed14/?limit=25#09fe" rel="alternate"/><published>2020-02-27T21:22:48.886000Z</published><updated>2020-02-27T21:22:48.886000Z</updated><author><name>carcrosser</name><uri>https://forge.codesys.com/u/carcrosser/</uri></author><id>https://forge.codesys.com56a018553333507208bf1ce444a48c7f506965d4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;turns out to be a problem with this specific SD card.&lt;/p&gt;
&lt;p&gt;written the config once, but after deletion of this config, unable to acces the SD card from the PLC&lt;/p&gt;
&lt;p&gt;rather weird, but worked out with another SD card (borrowed from WAGO; nice guys there!)&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>calling a function block from ST</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/343de8ed14/?limit=25#f526" rel="alternate"/><published>2020-02-27T21:22:44.746000Z</published><updated>2020-02-27T21:22:44.746000Z</updated><author><name>carcrosser</name><uri>https://forge.codesys.com/u/carcrosser/</uri></author><id>https://forge.codesys.com0c55bbce209ca53a7f6ebaad38b8eb1bb8dd8551</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;this worked it tried...&lt;/p&gt;
&lt;p&gt;no errors and it executes..&lt;/p&gt;
&lt;p&gt;however I have some specific difficulties with the file open function.&lt;br/&gt;
i tried Kurt Braun's example &lt;br/&gt;
&lt;a class="" href="http://www.youtube.com/watch?v=ovTJ5AZY22g" rel="nofollow"&gt;http://www.youtube.com/watch?v=ovTJ5AZY22g&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;it fails to open the file on my SD card...&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>calling a function block from ST</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/343de8ed14/?limit=25#3438" rel="alternate"/><published>2020-02-27T21:22:43.187000Z</published><updated>2020-02-27T21:22:43.187000Z</updated><author><name>carcrosser</name><uri>https://forge.codesys.com/u/carcrosser/</uri></author><id>https://forge.codesys.coma3e00287b5c7d6214e9078935a1462b9b040eb64</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;AHA now i notice the error I'm making.&lt;/p&gt;
&lt;p&gt;however by looking on the library codesys displays this as a function block.... My mistake.&lt;/p&gt;
&lt;p&gt;but still guessing how calling this function is neede I guess something like&lt;/p&gt;
&lt;p&gt;sysfileopen(input1, input2).&lt;/p&gt;
&lt;p&gt;but if i want to use multiple files, how to do so and how to get the output?&lt;br/&gt;
 somthing like&lt;/p&gt;
&lt;p&gt;OUTPUT := sysfileopen(input1, input2)&lt;/p&gt;
&lt;p&gt;so it's like C?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>calling a function block from ST</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/343de8ed14/?limit=25#15ab" rel="alternate"/><published>2020-02-27T21:22:39.132000Z</published><updated>2020-02-27T21:22:39.132000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.comfddb1652a4175443fc98bb4cfbfdf6372870b36f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;ralph can you please give hin an example?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>calling a function block from ST</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/343de8ed14/?limit=25#d654" rel="alternate"/><published>2020-02-27T21:22:37.667000Z</published><updated>2020-02-27T21:22:37.667000Z</updated><author><name>Ralph Holz</name><uri>https://forge.codesys.com/u/ralph-holz/</uri></author><id>https://forge.codesys.com3328cf442a014aa97f0786e5131021df19239828</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi carcrosser,&lt;/p&gt;
&lt;p&gt;SysFileOpen is a function not a funtion block. Means no instance-declaration is needed.&lt;/p&gt;
&lt;p&gt;Be carefull most of the system-functions are blocking!&lt;/p&gt;
&lt;p&gt;BR&lt;br/&gt;
Ralph&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>calling a function block from ST</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/343de8ed14/?limit=25#fc0b" rel="alternate"/><published>2020-02-27T21:22:36.162000Z</published><updated>2020-02-27T21:22:36.162000Z</updated><author><name>carcrosser</name><uri>https://forge.codesys.com/u/carcrosser/</uri></author><id>https://forge.codesys.comcbac82553c0b14bde90bd0786e338b81b6760875</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I don't see the point in this as input 1 is already a string and the other one is even a static string in the code.&lt;/p&gt;
&lt;p&gt;here's the full variable declaration&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;VAR&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;syslog&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt;  &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;SysFileOpen&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;ssyslogfile&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt;  &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;STRING&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;sysevent&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt;  &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;SysFileOpen&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;ssyseventfile&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;STRING&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;END_VAR&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;and the full code&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;ssyslogffile&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;CONCAT&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'S:\',statfilename);&lt;/span&gt;
&lt;span class="s1"&gt;syslog(ssyslogfileile, '&lt;/span&gt;&lt;span class="nt"&gt;RW&lt;/span&gt;&lt;span class="err"&gt;'&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;statfilename is declared globally&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;statfilename&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;STRING&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'eatSTAT.csv'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;however still suffering same error&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>calling a function block from ST</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/343de8ed14/?limit=25#0128" rel="alternate"/><published>2020-02-27T21:22:32.114000Z</published><updated>2020-02-27T21:22:32.114000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.comf7f6a26a6b67ba15a2001aba360e1d65a999418d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;there are two problems:&lt;br/&gt;
watch how all inputs are declared, in the docs it says string (how long)&lt;br/&gt;
same for output&lt;br/&gt;
please do not use capital but small letters.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>calling a function block from ST</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/343de8ed14/?limit=25#1cbc" rel="alternate"/><published>2020-02-27T21:22:30.635000Z</published><updated>2020-02-27T21:22:30.635000Z</updated><author><name>carcrosser</name><uri>https://forge.codesys.com/u/carcrosser/</uri></author><id>https://forge.codesys.comfff18fe30834b692f1e8e9338a052d18ecef9ab0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I tried first with a more easy example: the file open function&lt;/p&gt;
&lt;p&gt;i tried this one: &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;SYSLOG&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt;  &lt;/span&gt; &lt;span class="err"&gt;  &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;&lt;span class="n"&gt;SysFileOpen&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;SysFileOpen is a function block from the &lt;a class="" href="http://www.google.nl/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=4&amp;amp;ved=0CEgQFjAD&amp;amp;url=http%3A%2F%2Fforum.codesys.com%2Fdownload%2Ffile.php%3Fid%3D164&amp;amp;ei=5MgIUqOAHfLM0AXfp4CgDg&amp;amp;usg=AFQjCNHKjcXkHY4smd4tkMywMbyYlGLa6w&amp;amp;bvm=bv.50500085,d.d2k" rel="nofollow"&gt;Syslibfile&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;however during building I get this error: "Error 3740: INIT (5): unknown type 'SysFileOpen'&lt;/p&gt;
&lt;p&gt;in the code I call for the FB like this:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;SYSLOG&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sSYSLOGFile&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'RW'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;This call to function blocks is really freaking me out, feeling so dumb....&lt;/p&gt;
&lt;p&gt;PS Paul: ik Took a look at your example, but that's your custom built function block. Mine comes straight out of a library&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>calling a function block from ST</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/343de8ed14/?limit=25#3263" rel="alternate"/><published>2020-02-27T21:22:26.565000Z</published><updated>2020-02-27T21:22:26.565000Z</updated><author><name>shooter</name><uri>https://forge.codesys.com/u/shooter/</uri></author><id>https://forge.codesys.com498e02d1f802024d3801792646bb261d6fd8bab6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;in the varlist:&lt;br/&gt;
function_block:mysql_login;&lt;/p&gt;
&lt;p&gt;in the program just press F2&lt;br/&gt;
change the blockname from mysql_login to function_block&lt;br/&gt;
now all the ins and outs will be in in the program indeed with := and the outputs as =&amp;gt;&lt;br/&gt;
you can also use function_block.name. this can also be done with F2 just look in the table under user defined function blocks.&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://forum.codesys.com//download/file.php?id=475" rel="nofollow"&gt;trendmaker.zip &lt;span&gt;&lt;span&gt;[10.55 KiB]&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>calling a function block from ST</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/343de8ed14/?limit=25#10e8" rel="alternate"/><published>2020-02-27T21:22:24.952000Z</published><updated>2020-02-27T21:22:24.952000Z</updated><author><name>carcrosser</name><uri>https://forge.codesys.com/u/carcrosser/</uri></author><id>https://forge.codesys.com496373c92f8a21ee35c17b746e1ce4ab6ab6653a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thknk you for your reply, &lt;/p&gt;
&lt;p&gt;however I'm failing to get the declaration in the variable area right. the function block in the library I require is mysql_login&lt;br/&gt;
i think for this instance i need to declare something as this function block &lt;/p&gt;
&lt;p&gt;so i have to link these 3 options together&lt;br/&gt;
MySql_login ("the model" of the function block)&lt;br/&gt;
Function_block (the declaration of a function block)&lt;br/&gt;
MadeUpName (the variable i'm calling in the POU)&lt;/p&gt;
&lt;p&gt;then in the POU i'm able to call MadeUpName("input1", input2, input3 etc)&lt;/p&gt;
&lt;p&gt;However I don't even see how i can access the output of this function block. As an ST program is being executed from the top I expect the function block to be executed and straight after the call of this function I can check for success or failure.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>