<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Extracting CANbus variable mapping from Codesys 3.x project.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ee3c101285/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ee3c101285/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/ee3c101285/</id><updated>2020-02-27T14:45:38.299000Z</updated><subtitle>Recent posts to Extracting CANbus variable mapping from Codesys 3.x project.</subtitle><entry><title>Extracting CANbus variable mapping from Codesys 3.x project.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ee3c101285/?limit=25#e811" rel="alternate"/><published>2020-02-27T14:45:38.299000Z</published><updated>2020-02-27T14:45:38.299000Z</updated><author><name>jking22</name><uri>https://forge.codesys.com/u/jking22/</uri></author><id>https://forge.codesys.com93c3e05ab06f429daf24a524ba1ab79567ddd75b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks...&lt;/p&gt;
&lt;p&gt;This is very helpful, however the output contains no COB ID Information or position in message.&lt;br/&gt;
Can you suggest some way of extracting it (Some .xml relational structure or something???&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Node_Properites_COdesys.jpg" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=913"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Extracting CANbus variable mapping from Codesys 3.x project.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ee3c101285/?limit=25#682b" rel="alternate"/><published>2020-02-27T14:45:37.717000Z</published><updated>2020-02-27T14:45:37.717000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.comd98f9827c2735ef6c9a90c0fea9c37b997aae271</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; M.Schaber&lt;/p&gt;
&lt;p&gt;Hi, jking22,&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://jira.3s-software.com/browse/CDS-37756" rel="nofollow"&gt;CDS-37756&lt;/a&gt;), but it is not scheduled yet.&lt;/p&gt;
&lt;p&gt;On the other hand, CODESYS already has a feature which may be helpful for your goal: For Devices in the context menu, there are two commands (see the attached screenshot) to allow the import and export of IO Mappings in CSV format.&lt;/p&gt;
&lt;p&gt;Those commands can also be triggered by python scripts, for example:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;dev&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;projects&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;primary&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;"Device"&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;system&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;commands&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;"device"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;"exportcsv"&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="k"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;"D:\\DeviceExport.csv"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;handle&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;dev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;guid&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The parameters are filename, projecthandle, objectguid, each of them as a string. For the import, the command is &lt;span&gt;["device", "importcsv"]&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;HTH, Markus&lt;/p&gt;
&lt;p&gt;PS: The execute() function on the commands is intentionally not documented, but having a "backdoor" in cases like yours where the scripting API is missing functionality are exactly the reasons why we implemented it.&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: mapping" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=581"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Extracting CANbus variable mapping from Codesys 3.x project.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/ee3c101285/?limit=25#4ed6" rel="alternate"/><published>2020-02-27T14:45:36.212000Z</published><updated>2020-02-27T14:45:36.212000Z</updated><author><name>jking22</name><uri>https://forge.codesys.com/u/jking22/</uri></author><id>https://forge.codesys.comdc2b2a8b6d6c42176ccb671edb9738290248c665</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Is it possible to get access (Python/ Other) to CANbus Mapping information at compile time in Codesys 3.5?&lt;/p&gt;
&lt;p&gt;In our case, we would port it to a Vector(CANalyzer) .DBC file, but it could be ported to any 3rd party format, but csv, xml would also be useful.&lt;br/&gt;
There are a number of 3rd party vendors that can use such files directly.&lt;br/&gt;
The following and many others use .DBC&lt;br/&gt;
    1. SCADA- Matricon/Honeywell&lt;br/&gt;
    2. CAN Bus analyzer:  Vector CANtec, &lt;br/&gt;
    3. Telemtry: LHP Telematics&lt;br/&gt;
    4. Data Acquisition:  HBM&lt;/p&gt;
&lt;p&gt;It could also used to create customer documentation (PDF)&lt;/p&gt;
&lt;p&gt;Perhaps something similar for EtherCAT, UDP Net Var etc...&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: CAN_Mapping Table.jpg" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=580"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>