06-03-2015 02:02 PM
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
06-03-2015 02:05 PM
Why does it have to be matlab code? Can you give an example of the array you want?
06-03-2015 03:10 PM - edited 06-03-2015 03:13 PM
The array is to create ttl pulses to control a stepper motor. So the two elements in every cluster in the array are the signal high and low times. I need to distribute the pulses according to the velocity required, so there wont be any high time in some of the clusters.
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.
06-03-2015 03:52 PM
@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.
06-05-2015 11:06 AM - edited 06-05-2015 11:07 AM
@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)
That is the part where I need to change so that I can use a spreadsheet.
06-05-2015 11:18 AM
06-05-2015 11:25 AM
@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.