取消
显示结果 
搜索替代 
您的意思是: 

rotate array

已解决!
转到解答

@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.冷淡表情 

0 项奖励
11 条消息(共 15 条)
760 次查看

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.



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
12 条消息(共 15 条)
757 次查看

Yeah whatever he said...

 

极度高兴的表情

0 项奖励
13 条消息(共 15 条)
754 次查看

 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 项奖励
14 条消息(共 15 条)
743 次查看

Hopefully you will not use those many for loops finally. 高兴表情

0 项奖励
15 条消息(共 15 条)
733 次查看