<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Read Linux USB</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/eb7274b2da/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/eb7274b2da/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/eb7274b2da/</id><updated>2023-06-13T13:41:56.051000Z</updated><subtitle>Recent posts to Read Linux USB</subtitle><entry><title>Read Linux USB</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/eb7274b2da/?limit=25#15c9/ca9a" rel="alternate"/><published>2023-06-13T13:41:56.051000Z</published><updated>2023-06-13T13:41:56.051000Z</updated><author><name>Reinier Geers</name><uri>https://forge.codesys.com/u/reinier-geers/</uri></author><id>https://forge.codesys.com7f1912e48736eaf5ef4694d5e08798b80b490f81</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Im back at seriel again.  at a timeout of 1000  i get 1024 bytes. But it starts not at the begin.  It should start with /XMX5  .  The meter is sending every second.  should i use Comsettingsex  bOutxDSRFlow ?  To get the right moment to read ?  I cant find any axample&lt;br/&gt;
ui_Timeout:         UINT:=1000;&lt;br/&gt;
arrDataRec:         ARRAY&lt;span&gt;[1.. 1024]&lt;/span&gt; OF BYTE ;&lt;/p&gt;
&lt;p&gt;SysComSetSettings(handle, ADR(Settings), ADR(SettingsEx));&lt;/p&gt;
&lt;p&gt;udiDataRead:=SysComRead(handle, ADR(arrDataRec),    1024,   ui_Timeout, ADR(ErrorResult));&lt;br/&gt;
/&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Read Linux USB</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/eb7274b2da/?limit=250#8482/b4e2/6891" rel="alternate"/><published>2022-08-03T10:45:17.635000Z</published><updated>2022-08-03T10:45:17.635000Z</updated><author><name>h-hermsen</name><uri>https://forge.codesys.com/u/hermsen/</uri></author><id>https://forge.codesys.com301bf09ef5242ac7454901e6626844987b57e7bf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;search for &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt; CODESYSControl_User.cfg&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;via google:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.google.com/search?q=CODESYSControl_User.cfg&amp;amp;source=hp&amp;amp;oq=CODESYSControl_User.cfg" rel="nofollow"&gt;https://www.google.com/search?q=CODESYSControl_User.cfg&amp;amp;source=hp&amp;amp;oq=CODESYSControl_User.cfg&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Read Linux USB</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/eb7274b2da/?limit=250#8482/b4e2/04a7" rel="alternate"/><published>2022-08-03T10:45:11.710000Z</published><updated>2022-08-03T10:45:11.710000Z</updated><author><name>h-hermsen</name><uri>https://forge.codesys.com/u/hermsen/</uri></author><id>https://forge.codesys.comc44a63f5aa40522ed7a529c07e0d68efc9dd5ddc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;search for &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt; CODESYSControl_User.cfg&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;via google:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.google.com/search?q=CODESYSControl_User.cfg&amp;amp;source=hp&amp;amp;oq=CODESYSControl_User.cfg" rel="nofollow"&gt;https://www.google.com/search?q=CODESYSControl_User.cfg&amp;amp;source=hp&amp;amp;oq=CODESYSControl_User.cfg&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Read Linux USB</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/eb7274b2da/?limit=25#8482/b4e2" rel="alternate"/><published>2022-08-02T15:27:59.093000Z</published><updated>2022-08-02T15:27:59.093000Z</updated><author><name>Reinier Geers</name><uri>https://forge.codesys.com/u/reinier-geers/</uri></author><id>https://forge.codesys.comb938c247157cb30aeda927d664e25637ed250bec</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Where can i find the user config?&lt;/p&gt;
&lt;p&gt;&lt;img src="./attachment/attachment.png" width="50%"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Read Linux USB</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/eb7274b2da/?limit=250#8482" rel="alternate"/><published>2022-07-28T07:29:43.226000Z</published><updated>2022-07-28T07:29:43.226000Z</updated><author><name>h-hermsen</name><uri>https://forge.codesys.com/u/hermsen/</uri></author><id>https://forge.codesys.com5e667c39ed39b4b9dede48e326d60495011619eb</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;You intentions are good but you are asking the wrong questions. You should ask WHY you cant edit codesyscontrol.cfg. This is because CODESYS has split the file into 2 parts, a user configurable one and the default configuration. If you wish to edit it, use the user config file. There more then enough hints about this topic on the forum.&lt;/p&gt;
&lt;p&gt;The string libraries are an evolution over time. Anything CAA related is considered deprecated but usable if it fits your needs. Somehow the CODESYS Automation Allience (CAA) is inactive for over 5 years or so. I wonder what has happened to it? &lt;/p&gt;
&lt;p&gt;The standard 255 char length is from the 8/16 bit era when cpu power and memory was more scarce, but obviously this has evolved way beyond 255chars and 8bits per char.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Read Linux USB</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/eb7274b2da/?limit=25#d488" rel="alternate"/><published>2022-07-28T05:55:22.199000Z</published><updated>2022-07-28T05:55:22.199000Z</updated><author><name>Reinier Geers</name><uri>https://forge.codesys.com/u/reinier-geers/</uri></author><id>https://forge.codesys.com6ee7d02213886616dce25ce1ab00c9d12d4a2327</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Ive got it allready in a Windows version with a real Serial port. With a home bild cable. So the string is not a problem anymore.  Now i want it in a Linux device with a Fix cable.  But Ive  read in the forum i have to change the CodesysControl.cfg to let linux know its a serielport.  But i can't copy the CodesysControl.cfg. So i tried to read with a Linux command. But Witch one ?  Every forum i googled the read command seems a problem.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Read Linux USB</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/eb7274b2da/?limit=25#4a45" rel="alternate"/><published>2022-07-28T05:28:26.607000Z</published><updated>2022-07-28T05:28:26.607000Z</updated><author><name>sgronchi</name><uri>https://forge.codesys.com/u/sgronchi/</uri></author><id>https://forge.codesys.comb140ac67367789004e1b1434ec277778ca821640</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Well, you can use the built-in stuff to read from a serial port (see my previous message) or you can continue to abuse SysProcess* functions to do the same in a more fragile and inconvenient manner via Linux commands. If your smartmeter sends bytes that have value 0, the string functions will assume that as the end of the string, whereas the serial port functions will happily continue to work correctly.&lt;/p&gt;
&lt;p&gt;It's up to you to shoot yourself in the foot like you are doing. &lt;/p&gt;
&lt;p&gt;StringUtils are for working with string of arbitrary length (even megabytes), and they work great (since they're basically the C standard library string functions...). Since there are many encodings (ways to translate a string to bytes in memory), you need different functions to work with them. There is ANSI (1 character = 1 byte), UNICODE / UCS-2 (1 character = 2 bytes), UTF8 (1 character = from 1 to 4 byte). If you call e.g. StrLenA on a UNICODE-encoded string it will give you a wrong answer. If you call StrToUpperW on an ANSI string, you'll probably fool up everything.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Read Linux USB</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/eb7274b2da/?limit=25#e6c2" rel="alternate"/><published>2022-07-27T18:08:58.809000Z</published><updated>2022-07-27T18:08:58.809000Z</updated><author><name>Reinier Geers</name><uri>https://forge.codesys.com/u/reinier-geers/</uri></author><id>https://forge.codesys.com9604fb08c6480a50011ed4f94165b8f78ea27d59</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Why are there 3 types for the same string command??&lt;br/&gt;
DSMR-P1.. You meen a Wifi adapter ?  Ive got a USB cable With a FTDI.  With a linux Command ls / dev/tty* i find the '/dev/ttyUSB0' &lt;br/&gt;
then set speed 'cu -l /dev/ttyUSB0 -s 115200 --parity=none'&lt;br/&gt;
open it for read/write 'chmod o+rw /dev/ttyUSB0' But still can find a command that reads the data.  Tried several&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Read Linux USB</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/eb7274b2da/?limit=250#15c9" rel="alternate"/><published>2022-07-24T19:17:28.105000Z</published><updated>2022-07-24T19:17:28.105000Z</updated><author><name>h-hermsen</name><uri>https://forge.codesys.com/u/hermsen/</uri></author><id>https://forge.codesys.com6b5526b7b2ec1a02d81d3d34fc386ad4b78632b3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The new StringUtils library is based on pointers so, there is no limitation of a numbers of chars.&lt;br/&gt;
&lt;a href="https://content.helpme-codesys.com/en/libs/StringUtils/Current/Public-Parts/fld-Public-Parts.html" rel="nofollow"&gt;https://content.helpme-codesys.com/en/libs/StringUtils/Current/Public-Parts/fld-Public-Parts.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So don't blame CODESYS ;-)&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Read Linux USB</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/eb7274b2da/?limit=25#84ec" rel="alternate"/><published>2022-07-24T08:23:00.925000Z</published><updated>2022-07-24T08:23:00.925000Z</updated><author><name>Reinier Geers</name><uri>https://forge.codesys.com/u/reinier-geers/</uri></author><id>https://forge.codesys.com25fc2f67c70f225d6eaebda2aa24b3a99e9130c3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I can read it in a string (1024).  But after that every string command is based of 255 so i lose data. Codesys always misses the last step.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>