Getting Started Wtih MCC Hardware and DASYLab10

Embed Size (px)

Citation preview

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    1/19

    Getting Started with DASYLab and MCC DAQ Hardware

    This application note describes how to install and use DASYLab Version 10 with MCC data acquisition

    hardware. There are various exercises which detail the development environment.

    Exercise A: Basic Analog Input with Display

    Exercise B: Analog Input with Scaling and Data Saving

    Exercise C: Displaying LayoutsExercise D: Reading Data from File and Outputting to Analog Outputs

    Exercise E: Creating and using an Interpolation Table for Scaling

    PrerequisitesMCCs InstaCal driver and utility software and DASYLab purchased version or evaluation license can

    be downloaded from this location:http://www.mccdaq.com/software.aspx

    Windows 2000/XP/Vista

    IBM-PC and compatible with an Intel Pentium (III, IV), Athlon, AMD K6 or AMD K7 processorMinimum of 512 MB memory, recommended: 1 GB

    Hard disk memory: at least 100 MB free memory space

    Graphics board: Color depth 24 or 32 bit (true color) and a screen resolution of 1024x768 or moreA mouse because you can operate certain DASYLab functions only with the mouse.

    Install InstaCal and DASYLab (Version 10)1)

    Ensure that you have administrative rights with your user account that you are logged in as on

    the PC

    2) Disable any anti-virus software during installation

    3) Install InstaCal from link above before installing DASYLab and restart computer

    4)

    Run StartCD.exe file to install DASYLab from CD, or the downloaded DASYLab_10_0_1e.exefrom the above link to start installation.

    5) If downloaded:a.

    choose Run at the Internet Explorer prompt

    b.

    At the WinZip self extractor prompt, choose Setup

    6) Follow the Next prompts to continue through the installation7a) When asked to enter the serial number, do so if you have purchased a license.

    7b) If you are running the evaluation:

    a. Choose the evaluation button at the bottom left of the window

    b. Check the Install Evaluation License checkbox on the next screen8)

    Continue through the prompts using the Next button

    9)

    Leave the Typical package selected when prompted10) To ensure the Measurement Computing drivers are installed, make sure that below is checked

    under Data Acquisition:

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    2/19

    11)Continue through the installation using the Next buttons to install DASYLab. It will install into

    the c:\Program Files\DASYLab 10.0 directory.

    The evaluation version installs all the features available in DASYLab Pro.

    Prior to using DASYLab with MCC hardware, plug in the hardware and run InstaCal from Start >>

    Programs >> Measurement Computing >> InstaCal. This will register your data acquisition productwith DASYLab.

    How to Contact MCC for questions and support:

    508-946-5100, ext. 2 for post-sales support; ext. 3 for pre-sales support;[email protected]

    www.mccdaq.com

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    3/19

    Exercise A - Basic Analog Input with Display

    1) Step one is simply to open up Dasylab; expand the Module list tree to view the MCC DataAcquisition controls. These are located as shown below in the Modules/MCC-DAQ directory.

    Note that the other controls under the Input/Output folder are not applicable to MCC data

    acquisition products.

    To perform a simple analog input, use the Analog Input module. Click on it to select it and drag it

    onto the worksheet. If there is more than one MCC daq product connected, Dasylab will ask you to

    select what data acquisition product this module is to be assigned to:

    2) Step two will detail how to assign channels for the analog input, as well as to specify sample rateand other options.

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    4/19

    The analog input module will now be on the worksheet. Double click on it to obtain the following

    properties page:

    You can add channels by double clicking on the channel numbers, as well as select the analog input

    range using the drop down list box. The input range must be supported by the data acquisition

    hardware. To determine what input ranges your hardware supports, you can refer to product specificinformation located in our Universal Library Users Guide:\

    http://www.measurementcomputing.com/PDFmanuals/sm-ul-user-guide.pdf

    Click OK to exit the Analog Input modules property page.

    Then, go to the Experiment menu item, select Experiment Setup..MCC-DAQ..Experiment Setup

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    5/19

    The following property page can then be used to select the sample rate as well as block size. The

    data is returned from the Analog Input module in blocks each block contains the number ofsamples identified here. Note that the selected block size may need readjustment for the following

    products:

    USB-1208LS, block size must be an integer value of 64;

    USB-1208FS/1408FS/1608FSmust be integer values of 31 (for example, 310, or 62, or 310, etc.)

    You will need to deselect the AutoSelect check box and enter an appropriate value.

    The sample rate per channel can also be adjusted here as well. Click OK after making changes.

    The application can now be run. We should however add a display.

    Display modules are in the Display folder. Choose the Y/t chart, and drag in into the worksheet tothe right of the analog input module. Then, simply connect the analog input modules output to the

    input of the Y/t chart.

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    6/19

    Once this is connected, you can run the application. There are three methods to starting the

    application:1)

    Hit the inverted green triangle;

    2) Press F5

    3) Go to Experiment..Start menu

    In order to view the Y/t chart, you will need to select it in the bottom left corner and simply expand it

    into view.

    The Y/t chart will then be displayed as below:

    The data in Exercise A is being taken at a 1kHz rate, in block size of 31. Therefore, 31mS of data is

    being displayed.

    If you are using a 16-bit A/D product, then you will need to change the DasyLab hardware setup settings

    to reflect this, as they default to 12-bit. To do this, follow the below steps.

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    7/19

    Go to Experiment menu..Hardware Setup..MCC-DAQ..Hardware Setup:

    Then, select the Functions tab:

    If you are using a 16-bit A/D product, then select 16 Bit instead of 12 Bit:

    How to Save worksheetsWorksheets are saved as .DSB format. File..Save.. will allow you to save the above worksheet in

    Dasylab format for future use.

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    8/19

    Exercise B - Analog Input with Scaling and Data Saving

    Exercise B will build on what was performed in Exercise A using the AnalogInput and Y/t modules.

    1)

    Lets readjust the block size so that we can see approximately one seconds worth of data. To do

    this, go to go to the Experiment menu item, select Experiment Setup..MCC-DAQ..Experiment

    Setup. Then, adjust the block size to be 930 (in this case, using the USB-1208FS, it must be a

    block size of 31). So, the Analog Input module will output a block of data every 930 data points.Sampling at 1000 Hz, this relates to output/updates every 930mS.

    2)

    Step 2 will apply scaling to the analog input signal. First, double RIGHT-mouse click on the

    connection between the two modules to delete it:

    Move the two modules farther apart to allow for the insertion of an additional module. Then, go to the

    Mathematics folder, and select the Scaling icon drag it onto the worksheet. When it is placed on the

    worksheet, you will be prompted for scaling type to be applied. Simply select Linear Scaling/Unit

    conversion.

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    9/19

    Now, put the Scaling module between the previously drawn modules, and connect outputs to inputs (asshown below). Then, double click on the Scaling icon, and change the scale factor to a=0.5 (this will

    decrease the actual signal by a factor of 0.5).

    Choose OK, then run the experiment. Below shows what a 20Hz sine wave, 2.5V peak to peak/5V

    amplitude, looks like with a 0.5 scaling factor applied:

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    10/19

    3) In order to save the data, we will need to add a WriteData module. Go to the modules browser

    and expand Files. Select and drag a WriteData module onto the worksheet. Then, connect to theexisting wire from the Scaling to Y/t chart.

    Double click on the WriteData module to open its property page. There are a variety of file formats tosave the data into. For a common file type, choose the file format via the drop down list box as ASCII

    (step 1 in the picture below). Once this is selected, then click on the Options box (step 2). In the

    options page, choose tab as the separator, and decimal format as dot (step 3). Choose OK. Now, we canchange the filename. Click on the FileName button on the WriteData property page (step 4), and select

    an appropriate file.

    Run the application. After data collection is completed, simply open up Excel, choose to open anexisting file, and locate the appropriate file (note that the file is saved in .asc format. You will have to

    import the data into Excel using its Text Import Wizard. Note that you will need to change the Files of

    Type to All Files

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    11/19

    Exercise C Displaying Layouts

    The Layout window can be used for displaying data in a graphical form on its own screen.

    Start off by creating a simple worksheet to capture one analog input and one digital input from your daq

    device once per second - use both the AnalogInput and DigitalInput modules in the MCC-DAQ folder.

    Choose the Chart Recorder module (in the Display folder) for display purposes.

    Go to the property page of the Chart Recorder module by double clicking on it. Add a channel to it by

    clicking on the + button to the right on the channel list.

    Now, connect the outputs to inputs.

    Note that we cannot use the A/D clock because of the relatively slow sample rate, which is not

    supported by the A/D product.

    Now, to set up the sample rate; go to the Experiment menu and select Experiment Setup..MCC-

    DAQ..Experiment Setup. Click on PC clock, select 1Hz, and change the Block size to 1.

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    12/19

    Now go to Experiment..Hardware Setup..MCC-DAQ..Hardware Setup.

    Under the Analog Input tab, select Mode as Software Clocked:

    Now, you can run the project to view the chart recorder on the worksheet. However, lets create a layout

    for viewing the data.

    To create a Layout to display the information, choose the Window menu, and New Layout.

    The layout window will now appear. In the toolbar, select the Graph item, and draw it onto the layout.

    Right mouse click on the graph item, and select properties.

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    13/19

    Now, select the Recorder00 under the module name to link this display with the chart recorder.

    You can then select View..Full Screen from the menu, and press F5 to start.

    To exit this full screen view, simply press the Esc key.

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    14/19

    Exercise D - Reading Data from File and Outputting to Analog Outputs

    This example will demonstrate how to simply create a text-based file with voltage data; read the file

    once per second; and output to a D/A. The output voltage range is 0 to 4 volts.

    Start off by creating a simple text-based file using Notepad and inputting a number of data points

    representing voltage values. Save the file appropriately named, with a .asc extension (volts.asc, for

    example). Close it.

    Open Dasylab, open the Files module folder in the module list, and place a ReadData module on

    worksheet. Double-click it to enter its property page.

    Under the Synchronization list, choose DasyLab. Then, click on the FileName button, and locate the filecreated above (Volts.asc) you will need to change Files of Type to ASCI format - .asc

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    15/19

    After setting the properties of the ReadData module, click OK. Then, select an AnalogOutput module

    from the Input/Output MCC folder, and place it on the worksheet. Double click on it to open itsproperty page.

    Chose an appropriate output range (+/-10V, 0-10V in the USB-1208FS case, 0-4V)

    Click OK, then wire the output of the ReadData module to the input of the AnalogOutput module.

    To set the rate to which read a data point and send it to an analog output, choose Experiment, Timebase

    Setup, All Settings

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    16/19

    Again, the ReadData Synchronization was setup earlier to DasyLab. Therefore, on the Dasylab tab,

    choose the desired update rate in our example, simply change from the default 10Hz to 1Hz

    Choose OK, and simply run the program. Once per second, a data point will be read from the file,

    incrementing the line number every second. The read data will be output on the daq products D/A thiscan be viewed with an oscope for confirmation.

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    17/19

    Exercise E - Creating and using an Interpolation Table for Scaling

    This example will demonstrate how to create a table of data points for interpolation scaling.

    This example is useful for demonstrating how to scale a sensor whose output is not linear.

    Say, for example, the output of the sensor follows:

    0 volts = 0 psi1 volts = 5 psi

    2 volts = 20 psi3 volts = 50 psi

    4 volts = 75 psi and

    5 volts = 150 psi

    This is clearly not linear (ie = y = mx + b)

    0

    20

    40

    60

    80

    100

    120

    140

    160

    0 1 2 3 4 5

    Volts

    psi

    To interpolate using the above data, open a new worksheet in DASYLab

    Put a Slider from the Control Group onto the worksheet (we will use this as the signal source it could

    be from an Analog Input module if appropriate). Then, put a Scaling module from the Mathematicsgroup onto the worksheet. When prompted for Scaling Function Type, select Interpolation using Table

    of Ref. Points.

    Then, put a Y/T chart from the Display group to show the scaled data, and wire all three modules as

    shown above.

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    18/19

    Open up the Scaling module property page by double clicking on it. Then, click on the New button.

    The New Interpolation Table dialogue box will com up. For this example, we will enter the voltage-psi

    values above for a single channel. In the Number of Rows box, enter a value of 6. Click on OK.

    The Interpolation workpad will then come up. Simply enter the voltage value and the correspondingsensor value separated by a space on each line as shown below. At the end of the data input, enter the

    letters EOF (which stands for End Of File). Then, save the file for future reference (it will be named

    with a .DPF extension).

    Then, exit the file after it is saved. This will bring you back to the Scaling modules property page.Choose Piecewise Linear instead of Off as in below.

  • 7/27/2019 Getting Started Wtih MCC Hardware and DASYLab10

    19/19

    Now, run the project. Values from the slider will be scaled and appropriately shown on the Y/T chart.

    Note that you will need to change the Y scale on the Y/T chart to show scaled values >5. You can makethe uppermost scale at 200, for example. To do this, simply double click on the Y axis of the Y/t chart

    and enter Display To value of 200.