LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create array with for loop

Hello.

 

Stupid question, but i can't do it myself.

 

I receive scalar byte data from com port in main while loop and want to make 1D array with adjustable size for further filtering and so on. Simple "for loop" with indexed output makes me array with all the same elements.

 

Can anyone tells me how can i make this?

 

Thank you.

0 Kudos
Message 1 of 34
(3,537 Views)

Build array with a shift register. This would be in your main acquisition loop. It does sound like you could make use of the pt-by-pt functions, though.

0 Kudos
Message 2 of 34
(3,525 Views)

Can i tell more about you solution? Shift registers in main loop or in for loop? Or can you show me example, please

0 Kudos
Message 3 of 34
(3,519 Views)

In the main loop where you are doing the scalar acquisition. You need to post your VI if you need help.

 

0 Kudos
Message 4 of 34
(3,517 Views)

Ok, thank you very much. I'll try this and post if there will be questions. Thank you.

0 Kudos
Message 5 of 34
(3,496 Views)

Why can't you use string to byte array function.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 6 of 34
(3,472 Views)

First, sorry for my english.

 

I receive bytes every 10ms and want to use filters and other processing. So, thats why i want to create 1D array with adjustable size. In other words, "stacking" 8 (or 4 or 100) bytes to 1D array. I know, that this is simple, but have a "wall" in my head )

0 Kudos
Message 7 of 34
(3,453 Views)

Try this & let me know.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 8 of 34
(3,446 Views)

Ok, i was try your example. I'm replace random generatro with input from visa and see that all elements of array are identical...

Here is my VI. First part of it is simply for formatt input from COM port - take two bytes from array and make word.

0 Kudos
Message 9 of 34
(3,442 Views)

2011 compatible VI please

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 10 of 34
(3,438 Views)