LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

rotate array

Solved!
Go to solution

@MAGI2 wrote:

Yes the loops are not necessary, we are just playing with the Vi.

We put the Visa inside the loop cause if we put it outside it will read only once and this is the final array and not the stages in between.Or maybe not?

In our case we have an array with 24positions and we have the initial array which is [ 255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] and we want to shift the array 7times with step 3 so next array that we want to send is [0,0,0,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] and so on.

 

 



I meant what crossrulz mentioned  you initialize and close it out of the loop not for every iteration. you just nned to put your write or read inside the loop.Smiley Indifferent 

0 Kudos
Message 11 of 15
(431 Views)

To better state what Muks is trying to say here:

 

It is bad to be constantly opening and closing resources, whether it is a file, a serial port, printer port, USB device, etc.  It uses extra memory and wastes processing time.  So you should open your resource once at the beginning of your program and then close it once at the end.  This opening and closing should be outside of your main loop.  You can then read and write as much as you want inside of the loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 12 of 15
(428 Views)

Yeah whatever he said...

 

Smiley Very Happy

0 Kudos
Message 13 of 15
(425 Views)

 Thank you very for the reply.It worked and it was very close to what we were thinking but with some changes 😄

Yes we will use open and close Visa once and then use wiring.

Thank you guys for the feedback.It is a whole project in which we are working and we just wanted to focus on this small problem on the Vi that we had thats why we didnt post the whole VI.

🙂

Greetings from Sweden.

 

 

0 Kudos
Message 14 of 15
(414 Views)

Hopefully you will not use those many for loops finally. Smiley Happy

0 Kudos
Message 15 of 15
(404 Views)