Infinite Generating Using Device Buffer


Appearance

 

Overview

In device buffer mode, this is a sample that generates with a stop condition other than Stop conversion by the specified times.

This sample program requires selection of a device with an analog output function.

Sample specification

※This is the initial value of the sample program.
Please note that it is different from the initial value of the driver.

Program name

AoGeneratingInfiniteDev

Conversion data transfer mode

0 (Device buffer mode)

Memory type

0 (FIFO)

Event

Event that device operation end, Event that the specified number of data are output, Event that generating clock period error, Event that DA conversion error

Event that the specified number of data are output

500

 

Step to Use

1. Specify the desired program name, run the program, and a CUI(Character User Interface) menu that looks like the one above will appear.
    Appearance may vary depending on software version.

 

2. Initialize

  ・When selecting the command [1: AioInit], you can specify the device name.
    Notifies the device driver to start using the specified device.
    When specifying the device name, AioInit will be executed and the CUI menu will be displayed again.
    

 

3. Analog Output Set

  ・When selecting the command [3 : AioSetAoRangeAll], you can specify the range.
    When specifying the range, AioSetAoRangeAll will be executed and the CUI menu will be displayed again.

    Depending on the device used, the setting may not be effective unless the output range is changed with the jumper pin on the device.
    

 

4. Generating Set

  ・When selecting the command [4 : AioSetAoChannels], you can specify the number of channels.
    When specifying the number of channels, AioSetAoChannels will be executed and the CUI menu will be displayed again.

    The starting channel number is fixed at 0ch. For example, if 3 channels are specified, data will be output from 0ch to 2ch.
    

 

5. Generating condition setting

  ・When selecting the command [5 : Condition Set], the Condition Set menu will be displayed.
    

  ・When selecting [1: Start Condition] from the Condition Set menu, the Start Condition menu will be displayed.
    Select the desired start condition from the Start Condition menu.
    When the desired start condition is specified, the Condition Set menu will be displayed again.
    

  ・When selecting [2 : Generating Clock Condition] from the Condition Set menu, the Generating Clock Type menu will be displayed.
    Select the desired clock type from the Generating Clock Type menu.
    

    If the Internal clock is selected, enter the generating clock period in units of [usec]. The minimum generating clock period that can be specified depends on the device used.
    If the External clock is selected, data will be output at the cycle of the external clock connected to the device. The external clock input timing can also be selected from rising or falling.

    In addition, it is necessary to decide the clock period by considering the value of the specified number of channels. For details, please refer to the item of [Glossary] Sampling clock error.

    When the desired generating clock is specified, the Condition Set menu will be displayed again.

  ・When selecting [3: Stop Condition] from the Condition Set menu, you can specify the desired stop condition.
    You can select from External trigger rise edge and External trigger fall edge.
    When the desired stop condition is selected, the Condition Set menu will be displayed again.
    

  ・When selecting [b: Back] from the Condition Set menu, you will return to the Top menu.

 

6. Output Data Set

  ・When selecting the command [6 : Generate Output Data], you can specify the generating times.
    When specifying the generating times, the data for generating will be generated and the CUI menu will be displayed again.

    

    Generated data:   A sine wave is generated according to the specified range. One cycle is the specified Generating Times.
                              For multiple channels, a sine wave with a phase delay of 1/4 period (90 degrees) is generated for each channel.

    Generated data example:
      

 

7. Event that the specified number of data are output set

  ・When selecting the command [7 : AioSetAoEventSamplingTimes], you can specify the generating times.
    When specifying the desired generating times, AioSetAoEventSamplingTimes will be executed and the CUI menu will be displayed again.
    

 

8. Generating Operation

  ・When selecting the command [8 : Generating Start], data output from the device will start.
    When the device starts outputting data, the CUI menu will be displayed again.
    

    An event will occur when the data for the generating times specified in [7 : AioSetAoEventSamplingTimes] is output from the device.
    Each time an event occurs, the displayed values for [Total Generating Count] and [Setting Generating Count] are updated.

  ・When selecting the command [9 : AioGetAoSamplingCount], the total generating count will be displayed.
    When the total generating count is displayed, the CUI menu will be displayed again.
    

  ・When selecting the command [10 : AioGetAoSamplingTimes], the setting generating count will be displayed.
    When the setting generating count is displayed, the CUI menu will be displayed again.
    

  ・When selecting the command [11 : AioGetAoStatus], the status will be displayed.
    When the status is displayed, the CUI menu will be displayed again.
    

  ・When selecting the command [12 : Generating Stop], data output from the device will stop.
    When the data output from the device is stopped and the status is displayed, the CUI menu will be displayed again.
    

9. Exit

  ・When selecting the command [13 : AioExit], it will notify the device driver that the use of the current device is complete.
    Data can be output from different devices (e.g. AIO001, etc.) without terminating the program.
    When AioExit is executed, the CUI menu will be displayed again.
    

  ・To output data again, select the command [1 : AioInit] and specify a new device name to perform device initialization processing.

 

10. Processing to terminate the program

  ・When selecting the command [q : Quit], the program will terminate.