LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

数组的叠加问题,求助!!!!

我用生产者与消费者结构(事件),按一下start按钮生产者结构开始产生数字(可以用随机数代替),然后在消费者结构把这些随机数取出来,在数组中显示(可以用10*10的数组),同时也在强度图中显示。

 

以上是我目前做的,但是需要改一下增加一个功能,就是数组的数字可以叠加。按一下start按钮生成并显示在10*10的数组中,再按一下再生成并显示在同一个数组里,但是要和之前的数组的同一位置的数叠加,再按一次start就是第3轮。

 

比如第一次按start按钮时在第一排第5个位置的数是5,第2次的时候生成的是3,那么数组里应该显示5+3=8,而不是3。第3次再按start,同一个位置的生成数是1,那么就显示8+1=9。

 

请问该怎么改,附件里的interface是主程序,有很多其他的功能,可以忽略,主要是消费者结构里的数组叠加

0 Kudos
Message 1 of 3
(4,383 Views)

translated from Chinese via google:

 

Superposition of the array problem, help! ! ! !

 

How does the change in the interface is the main attachment, there are many other features, can be ignored, the main structure in the array is the superposition of the consumerI used the structure of producers and consumers (events), click the start button to start generating digital producer structure (which can be replaced with a random number), then the structure of the consumer to take out these random numbers in the array display (can be 10 * 10 array), but also in intensity graph.

 

These are my currently do, but need to change it to add a feature that is an array offigures can be superimposed. Click the start button to generate and display in 10 * 10 array, and then click again to generate and display the same array, but prior tothe array and the number of stacking the same location, is again to start the third round.

 

For example, when the first press the start button in the first row of the first fivepositions of the number is 5, when the 2nd generation is 3, then the array should be displayed 5 +3 = 8, not 3. 3rd press start, with a number of positions generatedis 1, then display 8 +1 = 9. 

0 Kudos
Message 2 of 3
(4,373 Views)

你好:

 

你可以在消费者循环中加入移位寄存器。我编了一个小型范例给你,是一维的,在生产者循环里生成随机数,在消费者循环里将它们求和,并显示。

 

 

0 Kudos
Message 3 of 3
(4,355 Views)