Digital General Purpose Input and Output


Appearance

 

Overview

This is a sample for digital input/output of AIO devices.

This sample program requires selection of a device with digital input/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

DigitalIO

I/O direction

0 (Port0: DI, Port1: DI)

Port No.

0

Bit No.

0

Input data

0

Output Data

0

 

Step to Use

1. Specify the desired program name, run the program, and a window that looks like the one above will appear.

  Appearance may vary depending on software version.

 

2. Initialize

 ・Specify the device name set in the device manager as the device name, and click the [AioInit] button.

  Notifies the device driver to start using the specified device.

 ・If you are using a device that allows you to set the input/output direction of general-purpose digital functions, you can switch the input/output direction by specifying the [I/O Direction:] parameter and pressing the [AioSetDioDirection] button.

  Please see AioSetDioDirection function for details.

 

3. Processing of general-purpose digital input

 ・For 1 port (8 bits) input,

  Specify the desired port No. in [PortNo:] in decimal (Dec) and press the [AioInputDiByte] button to update the displayed value of [Input Data:] in hexadecimal (Hex).

 ・For 1 bit input,

  Specify the desired bit No. in [BitNo:] in decimal and press the [AioInputDiBit] button to update the display value of [Input Data:].

 

4. Processing of general-purpose digital output

 ・For 1 port (8 bits) output,

  Specify the desired port No. in [PortNo:] in decimal (Dec), and specify the desired output data in [Output Data:] in hexadecimal (Hex).

  Press the [AioOutputDoByte] button to output digital signals from the device.

 ・For 1 bit output,

  Specify the desired bit No. in [BitNo:] in decimal number, and specify the desired output data in [Output Data:].

  Press the [AioOutputDoBit] button to output a digital signal from the device.

 

5. Exit

 ・Press the [AioExit] button to 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.

  To output data again, specify a new device name and press the [AioInit] button to initialize the device.

 

6. Processing to terminate the program

 ・Press the [Close] button in the window to terminate the program.