|
Prev: Re : Re: No Data Change event generated for a XControl in aType Def.
Next: Have problems in using Labview program contains "niScopeMulti Fetch" unit to sample data from PCI 5922
From: krispiekream on 6 May 2008 16:40 i have this simply code, i am trying to select only the odd elements.i been stuck on this simple code for a while now. can someone give me a pointer on where i can fix this?i want 1,3,5,7,9 select only odd.vi: http://forums.ni.com/attachments/ni/170/321539/1/select only odd.vi
From: krispiekream on 6 May 2008 17:10 i created this. but i think there is easy, better ways. select only odd.vi: http://forums.ni.com/attachments/ni/170/321542/1/select only odd.vi
From: smercurio_fc on 6 May 2008 17:10 You really need to learn to program without using local variables and without sequence frames. Your code can be written completely without either one:<img src="http://forums.ni.com/attachments/ni/170/321546/1/Example_VI_BD4.png"> As for selecting the odd elements you need to use the other output of the Decimate 1D Array function. Or, are you trying to do this inside the loop, as in replacing the odd elements with TRUE? In that case, use the Quotient & Remainder function. Message Edited by smercurio_fc on 05-06-2008 03:49 PM Example_VI_BD4.png: http://forums.ni.com/attachments/ni/170/321546/1/Example_VI_BD4.png
From: jmcbee on 6 May 2008 17:10 Try using the code below. You should try to avoid using so many local variables as they slow the code down dramatically.Cheers!<img src="http://forums.ni.com/attachments/ni/170/321545/1/Select%20Only%20Odd.PNG"> Message Edited by jmcbee on 05-06-2008 02:47 PM Select Only Odd.PNG: http://forums.ni.com/attachments/ni/170/321545/1/Select Only Odd.PNG
From: krispiekream on 6 May 2008 17:10
both methods is better than mine..yeah..i have alot to learn. i want to setup somethingMessage Edited by krispiekream on 05-06-2008 04:09 PM |