Created on 2008-07-11 12:52:00
We often get requests for information on how to export test results directly from AP software into a third party database. This can be done relatively easily through an AP Basic macro run inside AP2700 software. All that’s required is Windows XP and an MS Access data file ready to receive the data export from the AP software.
Follow the below instructions to set up your AP2700 to a database
1. Set up the measurement you wish to take.
- Start up AP2700 on your computer.
- Connect the device under test.
- Set up the measurement parameters inside the AP2700 software.
2. Create an MS Access data file on your computer.
- Create names for each field by mapping the columns from the AP2700 data editor to the columns in the database table.
- Refer to your database’s help file for instructions on how to do this.
3. Create and save the Macro using the template below.
- Go back to AP2700.
- Open the Macro menu and chose “Open Panel”.
- Copy the below script into the Panel.
- Edit the line “”C:Your_FolderYour_dbase.mdb”” so it maps to the location of your data file.
- Make sure the macro’s column parameters units (e.g.: Hz and %) match the settings in the AP2700 software.
- Save the macro in a folder of your choice (defaults to AP2700 folder).
4. Run the macro from inside AP2700.
- Go to File / Open / Macro and browse to the macro you saved.
- Open the macro and run it.
- You will be prompted to name the measurement or instrument you’re testing. This name will be added to the data file so you can identify this acquisition later.
The Macro will take the measurement you set up in Step (1c) and then automatically export the acquired data into the data file you specified in Step (3d).
You can now repeat the process to add more measurements to the data file or use the Microsoft ODBC protocol to allow your preferred database manager to analyze the results as needed, for example plotting standard deviation to indicate production run quality.
— These commands load the activex DAO object ——
Set DBEngine = CreateObject(“DAO.DBEngine.35”)
‘Make MS Access Connection
‘— Input your test conditions (product, serial no. etc.)
Product = InputBox(“Enter Product”)
Length = AP.Data.ColSize(0,0) ‘<— returns the number of rows in the sweep
FreqArray = AP.Data.XferToArray(0, 0, “Hz”) ‘<— Your column parameters
For i = 0 To length -1 ‘�- iterate rows mapping sweep data columns to fields
As always, AP Tech Support is available five days a week to help with any instrument questions you have. Just email us if you need help customizing this script for your particular needs.