<?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: Comparison of 2 strings in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790320#M1069151</link>
    <description>&lt;P&gt;Hi GerdW,&lt;/P&gt;
&lt;P&gt;I tried your suggestion, with the retroactive node&amp;nbsp;(in structures menu)&amp;nbsp;with a direction change.&lt;/P&gt;
&lt;P&gt;But the boulean value is never at false, it looks like my retroactiv node don't stock the precedent value.&lt;/P&gt;
&lt;P&gt;Thanks fo your help&lt;/P&gt;</description>
    <pubDate>Tue, 08 May 2018 07:42:39 GMT</pubDate>
    <dc:creator>fxblabview</dc:creator>
    <dc:date>2018-05-08T07:42:39Z</dc:date>
    <item>
      <title>Comparaison between 2 strings</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790078#M1069051</link>
      <description>&lt;P&gt;Good afternoon,&lt;/P&gt;
&lt;P&gt;I have a question about the comparition between 2 strings.&lt;/P&gt;
&lt;P&gt;My VI write in a txt file a message to indicate the state of the test. If this state is unchange I don't want to write on this file that's why I test the message and the message write in the last line of the txt file to be sure they are not similar and write.&lt;/P&gt;
&lt;P&gt;But the comparator tools I use don't give the expected solution.&lt;/P&gt;
&lt;P&gt;Someone could explain me how compaire these 2 strings?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Comparaison de 2 chaines.PNG" style="width: 999px;"&gt;&lt;img src="https://ip1.i.lithium.com/af316993efde678353bc695a7f08e84211dd6ea4/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32323736393169333333364532453033353639464133382f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="Comparaison de 2 chaines.PNG" alt="Comparaison de 2 chaines.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 15:33:34 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790078#M1069051</guid>
      <dc:creator>fxblabview</dc:creator>
      <dc:date>2018-05-07T15:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Comparaison between 2 strings</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790079#M1069052</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/351869"&gt;@fxblabview&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the comparator tools I use don't give the expected solution.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;UL&gt;
&lt;LI&gt;Attach code instead of pictures&lt;/LI&gt;
&lt;LI&gt;Look for differences in hidden characters (e.g. CR, vs LF, vs CRLF).&lt;/LI&gt;
&lt;LI&gt;If the result is not as expected, you need to tell us what you expect!&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 07 May 2018 15:37:17 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790079#M1069052</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2018-05-07T15:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Comparaison between 2 strings</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790096#M1069060</link>
      <description>&lt;P&gt;To detect successive duplicate messages, use a feedback node and compare current and previous.&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 16:08:46 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790096#M1069060</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2018-05-07T16:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Comparaison between 2 strings</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790122#M1069072</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/351869"&gt;@fxblabview&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Good afternoon,&lt;/P&gt;
&lt;P&gt;I have a question about the comparition between 2 strings.&lt;/P&gt;
&lt;P&gt;My VI write in a txt file a message to indicate the state of the test. If this state is unchange I don't want to write on this file that's why I test the message and the message write in the last line of the txt file to be sure they are not similar and write.&lt;/P&gt;
&lt;P&gt;But the comparator tools I use don't give the expected solution.&lt;/P&gt;
&lt;P&gt;Someone could explain me how compaire these 2 strings?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Comparaison de 2 chaines.PNG" style="width: 999px;"&gt;&lt;img src="https://ip1.i.lithium.com/af316993efde678353bc695a7f08e84211dd6ea4/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32323736393169333333364532453033353639464133382f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="Comparaison de 2 chaines.PNG" alt="Comparaison de 2 chaines.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You send the strings with CR as your EOL but your read is set to convert EOL.&amp;nbsp; In Windows, EOL is CR + LF, so the changes the EOL and the strings no longer match.&amp;nbsp; It's only a guess (but a good one) since you didn't supply real code, and the probes and stuff don't show the backslash codes.&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 17:20:10 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790122#M1069072</guid>
      <dc:creator>billko</dc:creator>
      <dc:date>2018-05-07T17:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: Comparaison between 2 strings</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790242#M1069111</link>
      <description>&lt;P&gt;Since you only really care about the "readable" string content perhaps you could use the Trim Whitespace node on both before comparing them?&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 23:50:50 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790242#M1069111</guid>
      <dc:creator>tyk007</dc:creator>
      <dc:date>2018-05-07T23:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Comparaison between 2 strings</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790294#M1069136</link>
      <description>&lt;P&gt;Right the txt file replace my CR&amp;nbsp;by an&amp;nbsp;EOL. Thats why I should put&amp;nbsp;a supplementary character on the reading to have complete sentence.&lt;/P&gt;
&lt;P&gt;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2018 06:16:54 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790294#M1069136</guid>
      <dc:creator>fxblabview</dc:creator>
      <dc:date>2018-05-08T06:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Comparaison between 2 strings</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790301#M1069141</link>
      <description>&lt;P&gt;It's a good solution to not be bored by these invisible types.&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2018 06:26:50 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790301#M1069141</guid>
      <dc:creator>fxblabview</dc:creator>
      <dc:date>2018-05-08T06:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Comparison of 2 strings</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790304#M1069144</link>
      <description>&lt;P&gt;Hi fx,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;FONT color="#FF0000"&gt;It's a good solution&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The better solution would be to store the previous message in a feedback node for comparison: ne need to read the file before writing to it! (As has been suggested before!)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Simple like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="check.png" style="width: 299px;"&gt;&lt;img src="https://ip1.i.lithium.com/b1e9c78f2d5c080406feab31f767c01b33ec7ea7/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32323737313369373832363944303045324239433044462f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="check.png" alt="check.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2018 06:33:42 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790304#M1069144</guid>
      <dc:creator>GerdW</dc:creator>
      <dc:date>2018-05-08T06:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Comparaison between 2 strings</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790305#M1069145</link>
      <description>&lt;P&gt;Sorry Knight to my approximations about my first post on the forum.&lt;/P&gt;
&lt;P&gt;My expected response was that the comparator tools give a false response when the 2 sentences tested were similar... and a true when they were different.&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2018 06:33:43 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790305#M1069145</guid>
      <dc:creator>fxblabview</dc:creator>
      <dc:date>2018-05-08T06:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Comparaison between 2 strings</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790306#M1069146</link>
      <description>&lt;P&gt;Hi fx,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="padding-left: 30px;"&gt;&lt;FONT color="#FF0000"&gt;My expected response was that the comparator tools give a false response when the 2 sentences tested were similar... and a true when they were different.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The "unequal?" comparison gives TRUE when the inputs are unequal (aka "not the same").&lt;/P&gt;
&lt;P&gt;When you are talking about this "unequal?" comparison then your expectation was right. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2018 06:36:19 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790306#M1069146</guid>
      <dc:creator>GerdW</dc:creator>
      <dc:date>2018-05-08T06:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Comparaison between 2 strings</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790307#M1069147</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/351869"&gt;@fxblabview&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Right the txt file replace my CR&amp;nbsp;by an&amp;nbsp;EOL. Thats why I should put&amp;nbsp;a supplementary character on the reading to have complete sentence.&lt;/P&gt;
&lt;P&gt;Thanks for your help.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Actually, you can configure the read to NOT translate the EOL.&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2018 06:39:33 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790307#M1069147</guid>
      <dc:creator>billko</dc:creator>
      <dc:date>2018-05-08T06:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Comparison of 2 strings</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790320#M1069151</link>
      <description>&lt;P&gt;Hi GerdW,&lt;/P&gt;
&lt;P&gt;I tried your suggestion, with the retroactive node&amp;nbsp;(in structures menu)&amp;nbsp;with a direction change.&lt;/P&gt;
&lt;P&gt;But the boulean value is never at false, it looks like my retroactiv node don't stock the precedent value.&lt;/P&gt;
&lt;P&gt;Thanks fo your help&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2018 07:42:39 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790320#M1069151</guid>
      <dc:creator>fxblabview</dc:creator>
      <dc:date>2018-05-08T07:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Comparison of 2 strings</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790324#M1069154</link>
      <description>&lt;P&gt;Probe the wires and check, it definatly stores the previous value.&lt;/P&gt;
&lt;P&gt;/Y&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2018 07:50:55 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790324#M1069154</guid>
      <dc:creator>Yamaeda</dc:creator>
      <dc:date>2018-05-08T07:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: Comparison of 2 strings</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790325#M1069155</link>
      <description>&lt;P&gt;GerdW,&lt;/P&gt;
&lt;P&gt;It works!!&lt;/P&gt;
&lt;P&gt;great simplification of the code...&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2018 07:51:33 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790325#M1069155</guid>
      <dc:creator>fxblabview</dc:creator>
      <dc:date>2018-05-08T07:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Comparison of 2 strings</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790487#M1069231</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/351869"&gt;@fxblabview&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;I tried your suggestion, with the retroactive node&amp;nbsp;(in structures menu)&amp;nbsp;with a direction change.&lt;/P&gt;
&lt;P&gt;But the boulean value is never at false, it looks like my retroactiv node don't stock the precedent value.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please keep the terminology straight to avoid confusion, It's a "feedback node" and that's what I was suggesting already in &lt;A href="https://forums.ni.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790096#M1069060" target="_blank"&gt;message #3 above&lt;/A&gt;. The "direction change" has no functional meaning and just solves a cosmetic issue giving fewer backwards wires and wire bends. Both "directions" give the same result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One thing you need to be careful about when testing with a "globally initialized on first call" FN is the fact that it will not work as you might expect if the code is not in a loop and you re-rerun the VI several times. Even if you keep the value the same, each new run will compare with an empty string instead. Make sure you understand all initialization options fully.&lt;/P&gt;</description>
      <pubDate>Tue, 08 May 2018 14:51:18 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Comparaison-between-2-strings/m-p/3790487#M1069231</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2018-05-08T14:51:18Z</dc:date>
    </item>
  </channel>
</rss>

