Adept Scientific - English
The world's best software and hardware for research, science and engineering.
flag arrow
clearclear

 Adept Store | register Join My Adept | Flags  
Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055  
UKdedksvnofi
Home
Products
Training
Events
 Buy Online
Downloads
Academic Discounts
Support
My Adept
International |  About Us |  Adept Scientific Blog |  Contact Us |  Press Room |  Jobs
Adept Scientific on Facebook Adept Scientific on Twitter Adept Scientific on YouBube Adept Scientific on LinkedIn
Knowledge Base  > Browse Categories  > Universal Library for LabVIEW
How to transfer data from AInScBg in continuous mode, using Universal Library for LabVIEW.

Email This Article

To email this article enter and address below and click on the "Email" Article button.



Last Modified: 3rd Jan 2013
Category: Data Acquisition Hardware and Software > Universal Library for LabVIEW
Platform: Windows
Version: All
Article Ref.: CCA6
»Return to previous search
»Print friendly version of this article.
2 out of 2 people have found this article useful.

How to transfer data from AInScBg in continuous mode, using Universal Library for LabVIEW.

The AInScBg function writes data to a circular buffer, and the attached example handles the transfer of data out of this circular buffer. The example then logs analog input scan data continuously to a Waveform chart and text file.

The GetStatus VI outputs an array which is the circular buffer into which data is written by AInScBg. It also returns the value CurIndex, which is the index into the buffer of the last completed channel scan. The algorithm used to transfer data from the circular buffer is as follows:

- When the buffer passes the half full point, the data is transferred from the first half of the buffer to an array.
- When the buffer is full and CurIndex cycles round to zero again, the data is transferred from the second half of the buffer to an array.

You can adjust the sample rate to match your application. The count per channel should be adjusted when the sample rate is adjusted. The range of the graph is proportional to the count per channel, and the refresh rate of the graph is inversely proportional to the count per channel. The count per channel must be a multiple of the packet size of the hardware, which can be found in the Universal Library online reference. For example the packet size of the PMD-1208FS\PMD-1608FS is 31 and the packet size of the PMD-1208LS\minilab 1008 is 64.

As a guide, the count per channel should be approximately equal to the sample rate.

NOTES

Run the example using the LabVIEW single run button.

Don't stop the example using the LabVIEW "Abort Execution" button! If you do, the process will not terminate properly, because StopBackground has not been activated. On the next run, you will just get an error message "Background operation already in process." If the process does not terminate properly, you will need to reboot the computer. So, use the Stop button on the Front Panel instead.

The attached example was created using LabVIEW 7.0. If you require an example that can be opened by an earlier version of LabVIEW, or require further advice or information, please contact technical support.

This example was produced by technical support and is supplied for guidance only. It shows only one way of achieving this functionality and may not be suitable for certain applications.

UPDATE

Because of the way this example is written, if you are using a faster sample rate then you must increase the "Count per Channel" accordingly to prevent buffer overruns. This example can also be used with other types of board, if the count per channel is adjusted to be an integer multiple of packet size.

 
Xaincnbg_mod_to_log.vi
 
Related Articles
adept

Top of the Page

Popular Links: ChemDraw | ChemOffice | Data Acquisition | Data Analysis | EndNote | Maple | MapleSim | Mathcad | MathType | Quality Analyst | Reference Manager | VisSim

EU ePrivacy Directive | Our Privacy and Terms and Conditions Statement
All Trademarks Recognised. Copyright © 2013, Adept Scientific plc.
Site designed and maintained by Lyndon Ash

Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055