<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Detecting com errors when using SysComRead</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/671ca0da35/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/671ca0da35/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/671ca0da35/</id><updated>2020-02-27T14:06:27.358000Z</updated><subtitle>Recent posts to Detecting com errors when using SysComRead</subtitle><entry><title>Detecting com errors when using SysComRead</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/671ca0da35/?limit=25#ef9f" rel="alternate"/><published>2020-02-27T14:06:27.358000Z</published><updated>2020-02-27T14:06:27.358000Z</updated><author><name>MortenL</name><uri>https://forge.codesys.com/u/mortenl/</uri></author><id>https://forge.codesys.comb1799c424f943dc4d4ee6345290b357bf70f3033</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;e.kislov hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Because it's not working:&lt;br/&gt;
 l &lt;a class="" href="https://forum.codesys.com/viewtopic.php?t=9293#p22836" rel="nofollow"&gt;viewtopic.php?t=9293#p22836&lt;/a&gt; l &lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I see, well there's no point in trying to get it to work then, thanks for the heads up.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Detecting com errors when using SysComRead</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/671ca0da35/?limit=25#2741" rel="alternate"/><published>2020-02-27T14:06:27.055000Z</published><updated>2020-02-27T14:06:27.055000Z</updated><author><name>e.kislov</name><uri>https://forge.codesys.com/u/e-kislov/</uri></author><id>https://forge.codesys.com4799dcb3587cd4aeefd82fff35d60c2977684689</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Zitat:&lt;/strong&gt;&lt;br/&gt;
SysComSetTimeout didn't make any difference&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Because it's not working:&lt;br/&gt;
 l &lt;a class="" href="https://forum.codesys.com/viewtopic.php?t=9293&amp;amp;p=22836&amp;amp;lan=en" rel="nofollow"&gt;viewtopic.php?t=9293#p22836&lt;/a&gt; l &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Detecting com errors when using SysComRead</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/671ca0da35/?limit=25#f0b3" rel="alternate"/><published>2020-02-27T14:06:26.750000Z</published><updated>2020-02-27T14:06:26.750000Z</updated><author><name>MortenL</name><uri>https://forge.codesys.com/u/mortenl/</uri></author><id>https://forge.codesys.com17347d802c9ec70bc1ffb6a387310fb595151d30</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;SysComSetTimeout didn't make any difference&lt;/p&gt;
&lt;p&gt;I made a quick 'n dirty test:&lt;/p&gt;
&lt;p&gt;I still get 'NO ERROR', but szSize correctly changes whether or not it is actually receiving new data, I can use this for error detection.&lt;/p&gt;
&lt;p&gt;Judging by the list of errors available:&lt;/p&gt;
&lt;p&gt;NO_ERROR&lt;br/&gt;
 0 no error &lt;/p&gt;
&lt;p&gt;FIRST_ERROR&lt;br/&gt;
 5000 first library specific error &lt;/p&gt;
&lt;p&gt;TIME_OUT&lt;br/&gt;
   5001 = timeout error &lt;/p&gt;
&lt;p&gt;ABORT&lt;br/&gt;
   5002 = abort input active &lt;/p&gt;
&lt;p&gt;HANDLE_INVALID&lt;br/&gt;
   5003 = handle invalid &lt;/p&gt;
&lt;p&gt;ERROR_UNKNOWN&lt;br/&gt;
   5004 = unknown error &lt;/p&gt;
&lt;p&gt;WRONG_PARAMETER&lt;br/&gt;
   5005 = wrong parameter &lt;/p&gt;
&lt;p&gt;WRITE_INCOMPLETE&lt;br/&gt;
   5006 = write incomplete &lt;/p&gt;
&lt;p&gt;FIRST_MF&lt;br/&gt;
 5050 first manufacture specific error &lt;/p&gt;
&lt;p&gt;LAST_ERROR&lt;br/&gt;
 5099 last library specific error &lt;/p&gt;
&lt;p&gt;It is not supposed to give me any errors in an event like that.&lt;/p&gt;
&lt;p&gt;Working with it I'm slowly beginning to understand why it does the things the way it do it.&lt;/p&gt;
&lt;p&gt;pBuffer is only updated if new data is available, I wrongfully assumed that if no data was available it would be the same as sending data with the value of 0.&lt;br/&gt;
I now realize that updating it to 0 value when no data is available would be a bit senseless and illogical.&lt;/p&gt;
&lt;p&gt;The 'NO ERROR' also makes makes sense, I would like an additional 'no data received within timeout limit' or something like that, but this will be relatively easy to do myself now that I have szSize.&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Bild" rel="nofollow" src="http://k-rad.dk/status.png"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Detecting com errors when using SysComRead</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/671ca0da35/?limit=25#5fe0" rel="alternate"/><published>2020-02-27T14:06:25.855000Z</published><updated>2020-02-27T14:06:25.855000Z</updated><author><name>dFx</name><uri>https://forge.codesys.com/u/dfx/</uri></author><id>https://forge.codesys.com64744b392037faf775deef09652217fb83a72290</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Have you tried using SysComSetTimeout function ?&lt;/p&gt;
&lt;p&gt;maybe you can succeed runing CAA_SerialCom library (which uses syscom internaly).&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Detecting com errors when using SysComRead</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/671ca0da35/?limit=25#f142" rel="alternate"/><published>2020-02-27T14:06:25.554000Z</published><updated>2020-02-27T14:06:25.554000Z</updated><author><name>MortenL</name><uri>https://forge.codesys.com/u/mortenl/</uri></author><id>https://forge.codesys.com04d5d0c75d4cd3a0191e58e2766c7c5421b5f799</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;dFx hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
What is your timeout setting ? This is more or less what you are trying to achieve. Check you pResult^ value (statusResult).&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I have tried various timeout settings (0-10-20-100) And StatusResult always stays at 0.&lt;br/&gt;
I can disconnect the device and the result will still be 0.&lt;br/&gt;
My original plan was using the result as you suggest, but the constant value of 0 threw me off, and I assumed that it wasn't possible to use it that way.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Detecting com errors when using SysComRead</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/671ca0da35/?limit=25#9b38" rel="alternate"/><published>2020-02-27T14:06:25.266000Z</published><updated>2020-02-27T14:06:25.266000Z</updated><author><name>dFx</name><uri>https://forge.codesys.com/u/dfx/</uri></author><id>https://forge.codesys.com3cf107e375c51eac1fced01eca95ce078dc108a8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;What is your timeout setting ? This is more or less what you are trying to achieve. Check you pResult^ value (statusResult).&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Detecting com errors when using SysComRead</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/671ca0da35/?limit=25#dabd" rel="alternate"/><published>2020-02-27T14:06:24.975000Z</published><updated>2020-02-27T14:06:24.975000Z</updated><author><name>MortenL</name><uri>https://forge.codesys.com/u/mortenl/</uri></author><id>https://forge.codesys.comd023fee195f4d2358c0e26a1cb06040998f486e6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;dFx hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Wire break issues aren't port related statistics ?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;If no new messages are received in a timeperiod where I was expecting messages, this would indicate that the device that was supposed to transmit it is not responding, would it not?&lt;br/&gt;
This could in turn indicate a defective device or a wire break.&lt;br/&gt;
Therefore a message received counter, or something similar, could help determine problems.&lt;br/&gt;
I use other devices that use their own communcation libraries, and often similar functionality is built-in.&lt;/p&gt;
&lt;p&gt;How would you detect a problem with the current syscom library?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Detecting com errors when using SysComRead</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/671ca0da35/?limit=25#db87" rel="alternate"/><published>2020-02-27T14:06:24.081000Z</published><updated>2020-02-27T14:06:24.081000Z</updated><author><name>dFx</name><uri>https://forge.codesys.com/u/dfx/</uri></author><id>https://forge.codesys.com5c727c51dbbb73a056d594b31f6abc0a948713a2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Wire break issues aren't port related statistics ?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Detecting com errors when using SysComRead</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/671ca0da35/?limit=25#4a62" rel="alternate"/><published>2020-02-27T14:06:23.770000Z</published><updated>2020-02-27T14:06:23.770000Z</updated><author><name>MortenL</name><uri>https://forge.codesys.com/u/mortenl/</uri></author><id>https://forge.codesys.com4bc3fa83aa6ad08aed5cd526f8f9fcaa232832f5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have sorta solved it, but there's probably a better way&lt;/p&gt;
&lt;p&gt;I tried using SysComPurge to make SysComRead return 0 to the buffer, that's obviously not how it works.&lt;br/&gt;
Now I'm using SysMemSet to 0 all values in the a_bPrinterStatus before asking SysComRead to fill it again.&lt;br/&gt;
This gets me the result I want, in case of a wirebreak or faulty printer it will not retain the last received value, but 0 all values instead.&lt;/p&gt;
&lt;p&gt;I do however feel that this is not the correct way of doing it.&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Bild" rel="nofollow" src="http://k-rad.dk/rs232.png"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Detecting com errors when using SysComRead</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/671ca0da35/?limit=25#acbc" rel="alternate"/><published>2020-02-27T14:06:23.454000Z</published><updated>2020-02-27T14:06:23.454000Z</updated><author><name>MortenL</name><uri>https://forge.codesys.com/u/mortenl/</uri></author><id>https://forge.codesys.com6e766d8fdbf483bd3ab77e6cd3d2383ed925e2b7</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;I'm using a Wago 750-8214 to communicate with a printer using RS232 and the SysCom library.&lt;br/&gt;
I request a status message from the printer to monitor paper status etc.&lt;br/&gt;
This is done using SysComRead.&lt;/p&gt;
&lt;p&gt;My question is, how do I detect if for example a wire break occurs and no new messages are received?&lt;br/&gt;
I've been looking for a message counter or something similar, but I've been unable to locate it.&lt;br/&gt;
I think it could also work if it was possible to reset the buffer that the syscomread reads from, but currently it constantly returns the last value received if the wire breaks.&lt;/p&gt;
&lt;p&gt;I've used other PLCs that used their own function block for RS232 communication and this had the error detection functionalty already built-in, so I assume it is possible, I've just been unable to locate it.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>