キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

array to global array






i have a set of array, global..
i am currently adding to the array.
first, i add all the serial number into the array..
then i want to add the off, gain, reading, etc..

for instant..i am testing serial # 1.
i get the data and everything..
now i am testing serial # 2.

serial # 2 data is now in my element 0...

how do i do it so that my serial # 1, 2 , 3 , 4 , 5, 6, 7 is always in that order rather than in 7, 6, 5, 4, 3, 2, 1



Message Edited by krispiekream on 03-26-2008 07:32 PM

Message Edited by krispiekream on 03-26-2008 07:37 PM
Best regards,
Krispiekream
すべてをダウンロード
0 件の賞賛
メッセージ1/19
4,033件の閲覧回数
Best regards,
Krispiekream
0 件の賞賛
メッセージ2/19
4,028件の閲覧回数
To answer your question you would need to write a VI to rip through the serial number data and put them in the order you want.
 
From the looks of the images you posted you are using a lot of global and local variables.
Remember that every time you read and write to a local or global it will make a copy of this data in memory.
You can structure your code with action engines and state machines to avoide the use of globals and locals.
This will reduce the amount of time and memory your application will take.
0 件の賞賛
メッセージ3/19
4,021件の閲覧回数
It's hard to tell what's going on exactly since you have shown a portion of code, and it seems to be using and abusing local variables.
 
I would guess it is that you are using the insert into array function.  Perhaps you should be using Build Array.  I find that in most instances, build array is the better choice over insert into array.  You might be constantly inserting your new data into the top of the array which is what would cause the array to appear in reverse order form what  you want.
メッセージ4/19
4,001件の閲覧回数
Build array appends to the end of the array.
Like Raven said, you are using inserting which results in reverse order
Van L
NI Applications Engineer
0 件の賞賛
メッセージ5/19
3,971件の閲覧回数

Seeing the construct of "Read from Global mod and write to Global" hits me like "finger-nails on the chalkboard". It is prone to race conditions as I discussed near the end of this Nugget on Action Engines.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 件の賞賛
メッセージ6/19
3,967件の閲覧回数
i tried using build array but that didnt work..
here is my vi, can someone help me take a look at it...thanks



Message Edited by krispiekream on 03-27-2008 04:08 PM
Best regards,
Krispiekream
0 件の賞賛
メッセージ7/19
3,936件の閲覧回数


krispiekream wrote:
i tried using build array but that didnt work..
here is my vi, can someone help me take a look at it...thanks



Message Edited by krispiekream on 03-27-2008 04:08 PM

What do you mean it did not work?  What was it doing or not doing that was different from what you wanted?
 
I would say that in 99% of the use cases, build array is the more appropriate choice over insert into array.  Build array takes and array (even an empty array) and adds to the end of it.  Insert into array takes an array (even an empty array, but that usually isn't the case) and inserts data into the beginning, middle, or end depending on where you want it and what values you wire up to the indices.  Usually only useful if you are trying to use some sort of "database" type of array where you want to sort your values in some particular order.  If you just want to add data to the end, insert into array can do that, but it is far easier and less prone to error to use the build array function.
0 件の賞賛
メッセージ8/19
3,928件の閲覧回数

@Ben wrote:

Seeing the construct of "Read from Global mod and write to Global" hits me like "finger-nails on the chalkboard". It is prone to race conditions as I discussed near the end of this Nugget on Action Engines.


Then I would suggest that you don't open the VI the user posted. You might just pass out. スマイリー とてもハッピー
0 件の賞賛
メッセージ9/19
3,923件の閲覧回数
hahaha, why is that?
too many local variables?
oh yeah..can someone show me how i can do the same work without using the local variables?
thanks

Best regards,
Krispiekream
0 件の賞賛
メッセージ10/19
3,920件の閲覧回数