<?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>Model-Based Design Toolbox (MBDT)のトピックHow to configure S32K14x to receive variable data size with UART in MBDT</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-configure-S32K14x-to-receive-variable-data-size-with-UART/m-p/1520288#M7681</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to implement MODBUS protocol in S32K14s using MBDT. Since the MODBUS server response packet varies in size depending on the client request, how can I configure the LPUART_Receive and&amp;nbsp;LPUART_RxTx_ISR blocks to be able to receive these variable size packets?&lt;/P&gt;&lt;P&gt;If I configured the LPUART_Receive block to receive the fix size packet, for example, 8 byte, I could receive the 8 byte response packet without any issue. But, if i configured the size to be variable, I could not receive the correct data and sometime there is data at all.&lt;/P&gt;&lt;P&gt;I have attached the model in this thread.&lt;/P&gt;&lt;P&gt;Please kindly advice.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Sep 2022 03:07:38 GMT</pubDate>
    <dc:creator>aungkm</dc:creator>
    <dc:date>2022-09-12T03:07:38Z</dc:date>
    <item>
      <title>How to configure S32K14x to receive variable data size with UART in MBDT</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-configure-S32K14x-to-receive-variable-data-size-with-UART/m-p/1520288#M7681</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to implement MODBUS protocol in S32K14s using MBDT. Since the MODBUS server response packet varies in size depending on the client request, how can I configure the LPUART_Receive and&amp;nbsp;LPUART_RxTx_ISR blocks to be able to receive these variable size packets?&lt;/P&gt;&lt;P&gt;If I configured the LPUART_Receive block to receive the fix size packet, for example, 8 byte, I could receive the 8 byte response packet without any issue. But, if i configured the size to be variable, I could not receive the correct data and sometime there is data at all.&lt;/P&gt;&lt;P&gt;I have attached the model in this thread.&lt;/P&gt;&lt;P&gt;Please kindly advice.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 03:07:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-configure-S32K14x-to-receive-variable-data-size-with-UART/m-p/1520288#M7681</guid>
      <dc:creator>aungkm</dc:creator>
      <dc:date>2022-09-12T03:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure S32K14x to receive variable data size with UART in MBDT</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-configure-S32K14x-to-receive-variable-data-size-with-UART/m-p/1542130#M7757</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I think you can use a software approach to this problem. You can use delimiters in the message you send over uart and to read characters into a string one by one.&lt;/P&gt;&lt;P&gt;For example, if you want to send voltage, current and fault status over uart, you can format the message like this "voltage:10&lt;STRONG&gt;;&lt;/STRONG&gt;current:1;fault:0" (using the&amp;nbsp;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;as a delimiter). Then you can break the message like this:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Voltage:10&lt;/LI&gt;&lt;LI&gt;Current:1&lt;/LI&gt;&lt;LI&gt;Fault:0&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Let me know if this approach helps you.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 19:32:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/How-to-configure-S32K14x-to-receive-variable-data-size-with-UART/m-p/1542130#M7757</guid>
      <dc:creator>cristiand</dc:creator>
      <dc:date>2022-10-21T19:32:12Z</dc:date>
    </item>
  </channel>
</rss>

