LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create array with for loop

Suppose each time from the serial port 25 byte you read then use one string to byte array & thats it.

 

It has to work.

--------------------------------------------------------------------------------------------------------
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 11 of 34
(1,155 Views)

Sorry, take it

0 Kudos
Message 12 of 34
(1,154 Views)

>>Suppose each time from the serial port 25 byte you read then use one string to byte array & thats it.

 

No, there are many other information in com port input. I'm take two bytes from port, make word and only after this i can work with it

0 Kudos
Message 13 of 34
(1,153 Views)

Then whats a problem, Read required byte using array subset as you already doing. What more you are looking for ?

--------------------------------------------------------------------------------------------------------
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 14 of 34
(1,145 Views)

Can you give me example, please? 

0 Kudos
Message 15 of 34
(1,141 Views)

Tell me first ?

If the serial data is 25 bytes what operation you want to perform on that, I will post the example but first let me know the requirement ?

--------------------------------------------------------------------------------------------------------
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 16 of 34
(1,137 Views)

Ok. 

I have info from gyros and accelerometers position sended in blocks by UART. 1st byte - LSB axis X, 2nd byte - MSB axis X, 3rd byte - LSB axis Y and so on.

 

All of this data will be processed in many different ways. 

 

In my question i only want to now, how can i make array from periodic scalar data. All of the examples use random numbers generator INSIDE for loop, but i can't. My data comes from outside. When i connect it directly to "for loop" my array fills with same elements. For example, i have "254" on input of the for loop, and take 1D array with size of forloop count and all elements are "254". That is my problem )

 

Thank you

0 Kudos
Message 17 of 34
(1,131 Views)

How are you reading data i.e. in each serial read how many bytes you are receving. If you are reading multiple times then you need to read inside for loop only ? Which data you want to make array

 

Let me know this.

--------------------------------------------------------------------------------------------------------
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 18 of 34
(1,127 Views)

See my last post in which i attached VI. Instead of random number you can use your serial read VISA 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 19 of 34
(1,125 Views)

Now, with only one gyro, in each while loop i'm receive 6 bytes. 2 bytes  - X, 2 bytes - Y, 2 bytes - Z.

 

I want to work with only one axis - X. I do not want to use PtbyPt filters, so i must have 1d array of U16 for filtering. Because this is experimental project, i want to manually adjust array size. Only thing that i need is make 1D array from scalar data.

0 Kudos
Message 20 of 34
(1,121 Views)