<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Is there a way to convert decimal data coming from a Siemens PLC to ASCII in Kepware/Thingworx in Kepware</title>
    <link>https://community.ptc.com/t5/Kepware/Is-there-a-way-to-convert-decimal-data-coming-from-a-Siemens-PLC/m-p/924074#M1672</link>
    <description>&lt;P&gt;Within the Kepware project, you can use an Advanced Tag &amp;gt; Derived Tag with an output data type as a STRING, and then in the expression reference the numerical source tag.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This MIGHT work for what you need, however it is not a direct byte for byte conversion to ASCII.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aservetas_0-1705432673009.png" style="width: 400px;"&gt;&lt;img src="https://community.ptc.com/t5/image/serverpage/image-id/96403i035F82C8DAD73749/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aservetas_0-1705432673009.png" alt="aservetas_0-1705432673009.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andy Servetas&lt;BR /&gt;Principal Technical Support Engineer | Kepware Technologies&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jan 2024 19:18:27 GMT</pubDate>
    <dc:creator>aservetas</dc:creator>
    <dc:date>2024-01-16T19:18:27Z</dc:date>
    <item>
      <title>Is there a way to convert decimal data coming from a Siemens PLC to ASCII in Kepware/Thingworx</title>
      <link>https://community.ptc.com/t5/Kepware/Is-there-a-way-to-convert-decimal-data-coming-from-a-Siemens-PLC/m-p/922210#M1656</link>
      <description>&lt;P&gt;Hello, I am pretty new to Kepware and was hoping for some guidance.&amp;nbsp; Using advanced tags or Thingworx, is there a way to convert decimal data coming from a Siemens PLC to ASCII and feed it into Thingworx?&amp;nbsp; The result I need to get should read like +99.9&lt;/P&gt;&lt;P&gt;I was able to find a chart that shows decimal to ASCII, but I am not sure how I can make that conversion using Kepware/Thingworx.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Using the chart I have, I can see that a byte sending a 43 from the PLC should be a '+' and a 26 should be a '.'&amp;nbsp; I am just not sure how to get those numbers to translate to those characters for the Thing I have created in Composer.&amp;nbsp; Nothing obvious is jumping out to me using advanced tags.&amp;nbsp; But I am very new to this software, so maybe the solution is very obvious?&amp;nbsp; Maybe I would have to create something in Thingworx using coding?&amp;nbsp; I'm not sure if it's possible or what approach to use.&amp;nbsp; Thank you for your patience with me!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2024 13:39:07 GMT</pubDate>
      <guid>https://community.ptc.com/t5/Kepware/Is-there-a-way-to-convert-decimal-data-coming-from-a-Siemens-PLC/m-p/922210#M1656</guid>
      <dc:creator>S_Noe</dc:creator>
      <dc:date>2024-01-08T13:39:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to convert decimal data coming from a Siemens PLC to ASCII in Kepware/Thingworx</title>
      <link>https://community.ptc.com/t5/Kepware/Is-there-a-way-to-convert-decimal-data-coming-from-a-Siemens-PLC/m-p/924074#M1672</link>
      <description>&lt;P&gt;Within the Kepware project, you can use an Advanced Tag &amp;gt; Derived Tag with an output data type as a STRING, and then in the expression reference the numerical source tag.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This MIGHT work for what you need, however it is not a direct byte for byte conversion to ASCII.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aservetas_0-1705432673009.png" style="width: 400px;"&gt;&lt;img src="https://community.ptc.com/t5/image/serverpage/image-id/96403i035F82C8DAD73749/image-size/medium?v=v2&amp;amp;px=400" role="button" title="aservetas_0-1705432673009.png" alt="aservetas_0-1705432673009.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andy Servetas&lt;BR /&gt;Principal Technical Support Engineer | Kepware Technologies&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 19:18:27 GMT</pubDate>
      <guid>https://community.ptc.com/t5/Kepware/Is-there-a-way-to-convert-decimal-data-coming-from-a-Siemens-PLC/m-p/924074#M1672</guid>
      <dc:creator>aservetas</dc:creator>
      <dc:date>2024-01-16T19:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to convert decimal data coming from a Siemens PLC to ASCII in Kepware/Thingworx</title>
      <link>https://community.ptc.com/t5/Kepware/Is-there-a-way-to-convert-decimal-data-coming-from-a-Siemens-PLC/m-p/935685#M1790</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to get this to work by creating a service on a Thing in Thingworx and then putting the following code.&amp;nbsp; I have changed some of my tags and inputs slightly to make them more generic, but I hope it will still translate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var params = {&lt;BR /&gt;infoTableName: "asciiResults" /* STRING */&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;// result: INFOTABLE&lt;BR /&gt;var result = Resources["InfoTableFunctions"].CreateInfoTable(params);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;//Add a new field to the InfoTable:&lt;/P&gt;&lt;P&gt;result.AddField({name: "ADDYOUROWN", baseType: "STRING"});&lt;BR /&gt;result.AddField({name: "ASCIICharacterTgmFromPLC_0000", baseType: "STRING"});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Input decimal value from PLC&lt;/P&gt;&lt;P&gt;var TgmFromPLC_0000FromPLC = me.TgmFromPLC_0000;&amp;nbsp; // Replace this with your actual decimal value&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;// Convert decimal to ASCII character&lt;BR /&gt;var TgmFromPLC_0000asciiCharacter = String.fromCharCode(TgmFromPLC_0000FromPLC);&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;// Print or use the ASCII character as needed&lt;BR /&gt;logger.info("ASCIICharacterTgmFromPLC_0000: " + TgmFromPLC_0000asciiCharacter);&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;// Now 'asciiCharacter' contains the ASCII character corresponding to the decimal value from the PLC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// add data row&lt;BR /&gt;result.AddRow({ADDYOUROWN : me.ADDYOUROWN,&lt;BR /&gt;ASCIICharacterTgmFromPLC_0000 : TgmFromPLC_0000asciiCharacter,&lt;BR /&gt;});&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 19:08:14 GMT</pubDate>
      <guid>https://community.ptc.com/t5/Kepware/Is-there-a-way-to-convert-decimal-data-coming-from-a-Siemens-PLC/m-p/935685#M1790</guid>
      <dc:creator>S_Noe</dc:creator>
      <dc:date>2024-03-08T19:08:14Z</dc:date>
    </item>
  </channel>
</rss>

