Infinite Generating Using User Buffer


Appearance

 

Overview

In user 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

AoGeneratingInfiniteUser

Conversion data transfer mode

1 (User buffer mode)

Memory type

1 (Repeat output)

Event

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

Event that the specified number of data are transferred

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.

 

  ・When selecting the command [6 : User Buffer Settings], you can specify the generating times.
    When specifying the generating times to be stored in the user buffer, the data for generating is generated and notified to the device driver.

    When the generating data has been generated, 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 transferred Set

  ・When selecting the command [7 : AioSetAoEventTransferTimes], you can specify the data transfer times.
    When specifying the data transfer times, AioSetAoEventTransferTimes 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 data transfer times specified in [7 : AioSetAoEventTransferTimes] is output from the device.
    Each time an event occurs, the displayed values for [Transfer Position] and [Repeat Count] are updated.

  ・When selecting the command [9 : AioGetAoTransferCount], the transfer position will be displayed.
    When the transfer position is displayed, the CUI menu will be displayed again.
    

  ・When selecting the command [10 : AioGetAoTransferLap], the repeat count will be displayed.
    When the repeat 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, 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.