LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to populate multi-cluster arrays using matlab code?

Hi,

 

I have an array of clusters containing two 'Double' elements in each cluster. I am looking for a method to populate this array using MATLAB code. I need around 1000 clusters in the array, so populating it using the front panel is not practical. There is also some calculation involved in deciding the value in each element. If there is an example or a method to do this, please point me in the right direction.

 

Thanks

0 Kudos
Message 1 of 7
(3,136 Views)

Why does it have to be matlab code? Can you give an example of the array you want?

Message 2 of 7
(3,133 Views)

 

I need a program to read the prescribed velocity values from file (spreadsheet if posssible) and populate the array accordingly. I dont mind doing the coding in any language as long as it can accomplish the task. (I can even create a spreadsheet for the array values if there is some way to import it to labview. I am not sure if the Read From Spreadsheet File VI will work since iam using an array of clusters and not a matrix.) It would be helpful if I can do it using code (any language), so that I can incorporate a feedback loop for the velocity control.

 

Also, is there a buffer size restriction for counter output?

 

Thanks.

0 Kudos
Message 3 of 7
(3,113 Views)

@rmechoo wrote:

I am not sure if the Read From Spreadsheet File VI will work since iam using an array of clusters and not a matrix.) It would be helpful if I can do it using code (any language), so that I can incorporate a feedback loop for the velocity control.


Can you attach a typical file so we know that the structure is? It is easy to convert from any data structure to any other data structure. You could even read it as a 1D string array and parse each line into a cluster, for example. It all depends on how the fil is arranged. You could also read the file as a flat string and chop it up into the desired structure later.

0 Kudos
Message 4 of 7
(3,101 Views)

@altenbach wrote:

Can you attach a typical file so we know that the structure is? It is easy to convert from any data structure to any other data structure. You could even read it as a 1D string array and parse each line into a cluster, for example. It all depends on how the fil is arranged. You could also read the file as a flat string and chop it up into the desired structure later.


I have attached the .vi file. I need to convert the spreadsheet to an array of clusters, thats where I'm getting stuck. (The vi is an example from help libraries)

NI doubt.PNG

That is the part where I need to change so that I can use a spreadsheet.

0 Kudos
Message 5 of 7
(3,057 Views)
(Posting by phone, cannot look at the VI)
Can you also attach a typical spreadsheet file?
0 Kudos
Message 6 of 7
(3,052 Views)

@altenbach wrote:
Can you also attach a typical spreadsheet file?

Have attached the file. I'll remove the first row (headlines) before actually using it. Also, the actual file will have more rows.

0 Kudos
Message 7 of 7
(3,047 Views)