Re: Array of float32!
Hi! > And yet another approach; > > Look athe the queue functions. > > Just push all of your data in as it arrives. > > Somewhere else in the code check the queue size and read the entire > queue if the size is what you want. Thanks. I need to pass an array of predetermined size and type to the CIN sink. I was trying to figure out different approaches, but the CIN holds a filtering code which reduces the sampling frequency and whatever I do, I have to have a buffer somewhere waiting until its full. (The output of the filter cant be one 1/7 of a sample for example). The idea of buffers seems to be difficult to implement since the entire Labview is per sample oriented. Atmapuri.
Array of float32!
Hi! Is it possilbe to use arrays of float32 type in LabView or are all arrays automatically float64? I would like to create a buffer working like this: - grow array until some size and do not allow further processing until array is full - when the array is full, allow the processing to proceede and then reset the array size Looks complicated to me... Thanks! Atmapuri.
Re: Array of float32!
> The idea of buffers seems to be difficult to implement since the entire > Labview is per sample oriented. > Ah. This is making more sense now. In that case, I'd recommend wrapping the CIN into a subVI. You pass in the point and the while loop I desribed earlier is inside the subVI. From the user of the subVI, it looks normal, like it handles one point at a time. From the CIN point of view, it only gets full buffers. The only complication added here is that you may need something to initialize and flush the subVI buffer. This is pretty similar to what happens in the point by point analysis functions added in LV6. Greg McKaskle
Re: Array of float32!
And yet another approach; Look athe the queue functions. Just push all of your data in as it arrives. Somewhere else in the code check the queue size and read the entire queue if the size is what you want. Ben http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=261&HRedirected=True&HUserId=101_3529&RFORMNUMBER=6";>Ben Rayner http://volt.ni.com/niwc/common.jsp?page=products_certification_cld&node=10638";> Certified LabVIEW Developer www.DSAutomation.com
Re: Array of float32!
> Is it possilbe to use arrays of float32 type in LabView or are all > arrays automatically float64? > Right click on the array, or on the numeric within the array and under the representation menu are the numeric choices, about ten of them including float32. > I would like to create a buffer working like this: > > - grow array until some size and do not allow further processing until array > is full > - when the array is full, allow the processing to proceede and then reset > the array > size > It sounds like you can do this either with one loop or two. You have one piece of code adding to the array, and another that optionally processes and empties. If using one loop, the code would consist of the while loop with a shift register to hold and recirculate the array. The left side of the while loop would get the new data and add it to the array. The middle of the loop would test the array size and wire the results to a case statement. One frame of the case would simply pass the array through and the other would process it and reset it. The right side of the case would pass out the array and into the right shift register. This solution is what I'd use as long as processing the data is pretty quick and won't interrupt the next read too much. The two loop solution has the creation of a queue outside the loops and wire the refnum into both of them. One loop, the produces looks almost like the one in the previous paragraph except in the case where you have enough data, it would put then array into the queue element and enque it. The other loop would wait for an element to be ready to dequeue and then process it. This solution may be useful when the processing of the data takes a highly variable amount of time or would otherwise conflict with the acquisition of the data. Using the queues will add some overhead however, especially if the arrays are very large. Greg McKaskle
Re: Array of float32!
The default is double (float64) But you can create an array, then right click on the array icon Representation ---> select Single (float32)