<?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: loop counter variable in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4252880#M1237602</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/702200"&gt;@newmemeber123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;i want to get a rid of subvis&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There is a lot of duplicated code. You should see if you can make a subvi that you can re-use multiple times.&lt;/P&gt;
&lt;P&gt;What is the difference between the sub-vis and what stays the same?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can use something like this and you dont need the channel index at all:&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="LLindenbauer_0-1662025048941.png" style="width: 400px;"&gt;&lt;img src="https://ip1.i.lithium.com/f28f22abb54cd96fcb10a443e5fcc6c6cd79e40e/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f33303735323369464638463541393533454332433431352f696d6167652d73697a652f6d656469756d3f763d76322670783d343030" role="button" title="LLindenbauer_0-1662025048941.png" alt="LLindenbauer_0-1662025048941.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is a bit confusing what you are trying to do.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Sep 2022 09:42:33 GMT</pubDate>
    <dc:creator>LLindenbauer</dc:creator>
    <dc:date>2022-09-01T09:42:33Z</dc:date>
    <item>
      <title>loop counter variable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4252865#M1237594</link>
      <description>&lt;P&gt;it is possible to change the input using&amp;nbsp;&lt;SPAN&gt;loop counter variable of loop ??&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 08:43:03 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4252865#M1237594</guid>
      <dc:creator>newmemeber123</dc:creator>
      <dc:date>2022-09-01T08:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: loop counter variable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4252866#M1237595</link>
      <description>&lt;P&gt;Hi 123,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/702200"&gt;@newmemeber123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;it is possible to change the input using&amp;nbsp;&lt;SPAN&gt;loop counter variable of loop ??&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;Maybe you should provide more/detailed information on what you actually want to achieve. An example VI might help too…&lt;/LI-SPOILER&gt;</description>
      <pubDate>Thu, 01 Sep 2022 08:49:59 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4252866#M1237595</guid>
      <dc:creator>GerdW</dc:creator>
      <dc:date>2022-09-01T08:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: loop counter variable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4252872#M1237598</link>
      <description>&lt;P&gt;im attaching it and the&amp;nbsp; subvis contains same visa read and write operation which is in the for loop same as channel 0 for 1 and 2 as shown in the measurement. i want to get a rid of subvis and i want to use loop counter variable to select the channel one after another. dont want to use other two read and write operation. is its possible ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 09:21:05 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4252872#M1237598</guid>
      <dc:creator>newmemeber123</dc:creator>
      <dc:date>2022-09-01T09:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: loop counter variable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4252880#M1237602</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/702200"&gt;@newmemeber123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;i want to get a rid of subvis&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There is a lot of duplicated code. You should see if you can make a subvi that you can re-use multiple times.&lt;/P&gt;
&lt;P&gt;What is the difference between the sub-vis and what stays the same?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can use something like this and you dont need the channel index at all:&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="LLindenbauer_0-1662025048941.png" style="width: 400px;"&gt;&lt;img src="https://ip1.i.lithium.com/f28f22abb54cd96fcb10a443e5fcc6c6cd79e40e/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f33303735323369464638463541393533454332433431352f696d6167652d73697a652f6d656469756d3f763d76322670783d343030" role="button" title="LLindenbauer_0-1662025048941.png" alt="LLindenbauer_0-1662025048941.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is a bit confusing what you are trying to do.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 09:42:33 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4252880#M1237602</guid>
      <dc:creator>LLindenbauer</dc:creator>
      <dc:date>2022-09-01T09:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: loop counter variable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4252895#M1237607</link>
      <description>&lt;P&gt;im attaching the vi in here.. the structure before&amp;nbsp; case i cant change it because its channel selection command&amp;nbsp; cases. there are three inputs for every channel which comes out of case so any how i want to get rid of last two read and write FOR loops and for that i want to use loop counter variable as a channel selector input one after another.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;waiting for ideas and suggestions thank you..&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Sep 2022 11:09:22 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4252895#M1237607</guid>
      <dc:creator>newmemeber123</dc:creator>
      <dc:date>2022-09-01T11:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: loop counter variable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4253900#M1237959</link>
      <description>&lt;P&gt;Yes i tried to use only one sub VI the problem is if i use visa read and write 3 times for three channels the im not having the same speed as im hoping because three visa read and write operation&amp;nbsp; so i want to use only one visa read and write for all three channels so i can get better speed. so im thinking to use loop counter as channel selector or to give input one after another but im not getting how. I will explain the situation again.. i have channel selectors commands as you can see case number 7 or in every case. so now im using three for loops and three visa read and write for every channel.. is it possible to replace three for loops with one and have same operation so i can get better speed.. if you have any questions i will explain you..&lt;/P&gt;
&lt;P&gt;thanks in advance&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 09:50:13 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4253900#M1237959</guid>
      <dc:creator>newmemeber123</dc:creator>
      <dc:date>2022-09-07T09:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: loop counter variable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4253934#M1237964</link>
      <description>&lt;P&gt;Sorry, I cannot open LV2021 VIs. From the screenshot, there are subVIs involved in this. You will probably have to send them, too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your speed issues probably come from sending a lot of empty strings and waiting for the communication timeout. The solution would be to not send empty strings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code looks like you first enter the loop and then try to figure your way out by trying every exit. I think it is possible to know the route beforehand, like this:&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="LLindenbauer_3-1662552858641.png" style="width: 400px;"&gt;&lt;img src="https://ip1.i.lithium.com/09edf339c0ea0e05ee10896a73f7f35cc4f00187/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f33303737363869433130463738303730324430373842312f696d6167652d73697a652f6d656469756d3f763d76322670783d343030" role="button" title="LLindenbauer_3-1662552858641.png" alt="LLindenbauer_3-1662552858641.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This way, If a channel is not used, you are not writing to the line and waiting for a reply (that will not come).&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 12:21:37 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4253934#M1237964</guid>
      <dc:creator>LLindenbauer</dc:creator>
      <dc:date>2022-09-07T12:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: loop counter variable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4253952#M1237972</link>
      <description>&lt;P&gt;Thanks for suggestions and reply.. Now i converted it to previous version. you can check the vi now. removed subvis and made it more readable. as you can see the in the vi im using 3 for loops and 3 read and write operations for three channels. if im running only one with with same string commands then the speed is fine with single read and write if i run channel one and two then it will become slow then if i run channel 1,2 and three it become more slow. can you tell me solution for this? can i use single visa read and write operation for&amp;nbsp; all three channels using loop counter so channels can be select one after another? i think im&amp;nbsp; i will use only one visa read write for all three channels then speed will be improved because if i run it for one channel it is working so fast. check the case structure as well where im selecting the channel.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 13:05:47 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4253952#M1237972</guid>
      <dc:creator>newmemeber123</dc:creator>
      <dc:date>2022-09-07T13:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: loop counter variable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4254011#M1238000</link>
      <description>&lt;P&gt;Hi new,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/702200"&gt;@newmemeber123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;made it more readable.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, you still forgot to use AutoCleanup (ctrl-U)…&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/702200"&gt;@newmemeber123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;as you can see the in the vi im using 3 for loops and 3 read and write operations for three channels. if im running only one with with same string commands then the speed is fine with single read and write if i run channel one and two then it will become slow then if i run channel 1,2 and three it become more slow. can you tell me solution for this?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;When you send more commands to your device then it has to handle more work and so I expect it to iterate slower…&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why do you need 3 FOR loops to handle 3 arrays of strings? Why not build just one array of strings and use only one FOR loop?&lt;/P&gt;
&lt;P&gt;Do you really need only the result of the last command for each FOR loop?&lt;/P&gt;
&lt;P&gt;Why do you even call those FOR loops with arrays of 3 empty strings? Does your device expect empty command messages???&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/702200"&gt;@newmemeber123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;can i use single visa read and write operation for&amp;nbsp; all three channels using loop counter so channels can be select one after another? i think im&amp;nbsp; i will use only one visa read write for all three channels then speed will be improved because if i run it for one channel it is working so fast. check the case structure as well where im selecting the channel.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes, you can.&lt;/P&gt;
&lt;P&gt;You just need to iumplement the communication protocol of your device correctly - as has been told to you several times before!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Btw. 128kbaud is a rather uncommon transmission speed for serial communication…&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 15:07:46 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4254011#M1238000</guid>
      <dc:creator>GerdW</dc:creator>
      <dc:date>2022-09-07T15:07:46Z</dc:date>
    </item>
    <item>
      <title>Re: loop counter variable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4254168#M1238052</link>
      <description>&lt;P&gt;1, i have added the two cleaned up vi.&lt;/P&gt;
&lt;P&gt;2, yes thats the reason its slow.. so i looking can i select the channel one after another&lt;/P&gt;
&lt;P&gt;3, i did now understand how i can do one for loop and one&amp;nbsp; array of string.. can you show me example so i can understand it in better way.&lt;/P&gt;
&lt;P&gt;4, yes, i need the result of last command for every for loop.&lt;/P&gt;
&lt;P&gt;5, no my device dose not need any empty string.. how can i improve it i mean case structure and how can i remove empty strings?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 08:34:03 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4254168#M1238052</guid>
      <dc:creator>newmemeber123</dc:creator>
      <dc:date>2022-09-08T08:34:03Z</dc:date>
    </item>
    <item>
      <title>Re: loop counter variable</title>
      <link>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4254650#M1238262</link>
      <description>&lt;P&gt;No, your code is not good!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You cannot have an interactive while loop inside an event structure that locks the panel until the event completes. You can use the single outer loop for all "looping".&lt;/P&gt;
&lt;P&gt;Changing S0..S1 while the inner loop is running has of course no effect because these controls are only read right after program start an after an event has completed.&lt;/P&gt;
&lt;P&gt;Your outer wait has absolutely no purpose because the outer loop iteration is entirely determined by the event structure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You really need to rearchitect everything for proper dataflow. Explain exactly how you want to do things using the UI, (e.g. how do you&amp;nbsp; plan to "select channels one after another"? Which controls are these? What should happen?)&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2022 16:48:11 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/loop-counter-variable/m-p/4254650#M1238262</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2022-09-11T16:48:11Z</dc:date>
    </item>
  </channel>
</rss>

