Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

HOW TO MAKE SMART BUFFER ACCEPT AN ARRY

Solved!
Go to solution

Hi;

I am trying to make the smart buffer example given in (http://zone.ni.com/devzone/cda/epd/p/id/2499)  accept an array. I am wondering if there is anyone out there who knows how to do that. I would really appreciate any answer.

Thank you very much.

 

0 Kudos
Message 1 of 7
(4,859 Views)

Howdy,

 

I am a little confused by your request...can you explain the the application you are intending to use this smart buffer? Also, were you able to open the Smart Buffer example from online? If so, what version of LabVIEW are you using? 

For others: The current version of the Smart Buffer example can be found in the following directory: <labview directory>/examples/general/globals.llb/Smart Buffer Example.vi and it appears to already use an array...

Joshua B.
National Instruments
0 Kudos
Message 2 of 7
(4,838 Views)

Hi Joshua;

Thank you so much for taking time to answer my question. In terms of my question, currently I am using LabVIEW 8.6.1 and am able to run the smart buffer example. In that example, the smart buffer takes scalars as its input and  with the read-all option on,  all the scalars kept in the buffer can be read all at once.

 

This given smart buffer example accepts only scalars and outputs the collection of these scalar values, which is a 1-D array. In my problem, however, I need to make the smart buffer accepts 1-D arrays  and outputs a 2-D array, instead.

 

As for my application, I am reading serial data with VISA that comes in to my PXI machine randomly  (I don't exactly when the new data is sent to the PXI unit.)  I would like to keep this serial data (which is a 1-D array) in the smart buffer and send the overall content of the buffer to my KALMAN code, which accepts only the collection of 1-D arrays, or 2-D array.  I am wondering what changes I have to make to the smart buffer so that I can make it accept 1-D arrays and spit out a 2-D array.

Best Regards

Serdar 

 

 

0 Kudos
Message 3 of 7
(4,831 Views)
Hi soylu,

You are essentially working with a functional global variable. In order to modify the VI you will need to do the work of creating the 1D array input, deciding how you want the different states of read newest, empty, etc should work with the 2D array. This involves add/changing the rotation logic or all the states which is a fairly significant changes...

Perhaps the VI I have attached below can get you up and started in creating your own type of buffer?

 
Joshua B.
National Instruments
0 Kudos
Message 4 of 7
(4,812 Views)
Solution
Accepted by topic author SERDARSOYLU
Thank you so much for the vi. I think I 'll take your advice and use a similar buffer similar to the one you sent.
0 Kudos
Message 5 of 7
(4,800 Views)

Hi Joshua

 

Indeed modifyintowards a 2D buffering scheme would not be easy, but putting a 1D array in a  cluster (bundle) and then using it as an element again, is perfect for this problem.

greetings from the Netherlands
Message 6 of 7
(4,784 Views)
Can you create a buffer.vi version for Labview 7.1?
0 Kudos
Message 7 of 7
(4,323 Views)