gdul Posted December 19, 2006 Report Share Posted December 19, 2006 I am trying to enqueue numeric data into 2D array form. The element data type and each enqueue element is a 1D array of numeric. When I read Elements in Get Queue Status, I see an array of cluster of 1D array! Is there a way to create a queue with elements organized in a 2D numeric array type Thanks Quote Link to comment
Aristos Queue Posted December 19, 2006 Report Share Posted December 19, 2006 I am trying to enqueue numeric data into 2D array form. The element data type and each enqueue element is a 1D array of numeric. When I read Elements in Get Queue Status, I see an array of cluster of 1D array! Is there a way to create a queue with elements organized in a 2D numeric array type Only by building your own when you dequeue. LV does not support a 2D array where each row is a different length. There's no guarantee that the arrays that you have enqueued are all the same length, so there's a cluster level added when you do the Status so that you can have an array of arrays instead of a 2D array. Quote Link to comment
gdul Posted December 19, 2006 Author Report Share Posted December 19, 2006 Only by building your own when you dequeue. LV does not support a 2D array where each row is a different length. There's no guarantee that the arrays that you have enqueued are all the same length, so there's a cluster level added when you do the Status so that you can have an array of arrays instead of a 2D array. Many thanks for the reply. Indeed my 1D array elements are all of the same length but I understand your point. I need to read more than one element in the queue without removing them. Is there a simple way to do it apart unqueue and queue these elements back again. Regards, Quote Link to comment
syrus Posted December 19, 2006 Report Share Posted December 19, 2006 Many thanks for the reply. Indeed my 1D array elements are all of the same length but I understand your point. I need to read more than one element in the queue without removing them. Is there a simple way to do it apart unqueue and queue these elements back again. In Jim's recent book, LabVIEW for Everyone (http://labviewforeveryone.com/), he provides an example of how to build your own queue using a functional global SubVI. This might be the best way to do what you want, but it's not necessarily simple unless you have experience with functional, i.e. LV2, globals. As I recall, the example is given in the appendix on graphical object-oriented programming (GOOP). Quote Link to comment
gdul Posted December 19, 2006 Author Report Share Posted December 19, 2006 In Jim's recent book, LabVIEW for Everyone (http://labviewforeveryone.com/), he provides an example of how to build your own queue using a functional global SubVI. This might be the best way to do what you want, but it's not necessarily simple unless you have experience with functional, i.e. LV2, globals. As I recall, the example is given in the appendix on graphical object-oriented programming (GOOP). Thanks for your suggestion. I have this book and the proposed Functionnal Queue.vi example looks as a good solution Regards, Quote Link to comment
Yassamina BERKANE Posted April 19, 2019 Report Share Posted April 19, 2019 Hello Everyone, I have the same problem, i can't get my data as 2D array even though they have the same size, Can i see you VI please. Best regards. Quote Link to comment
Aristos Queue Posted April 21, 2019 Report Share Posted April 21, 2019 @Yassamina BERKANE The answer is the same as it was in 2006: dequeue and concatenate. A ragged 2D array is not (and never will be) meaningful in LabVIEW. Because the compiler cannot guarantee that you're going to add arrays of all the same size to the queue (you might be doing that, but it cannot be proven from code because refnums can be shared all over the place), any attempt to ask for all the queue elements in one array will have them each wrapped in a cluster. If you dequeue and concatenate, you can build a 2D array yourself. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.