Sampling Synchronization Between 2 Devices Using Synchronization Bus


Appearance

Overview

This is a sample that uses a synchronous bus in device buffer mode and performs sampling for the specified number of channels/sampling times.

This sample program uses a synchronous bus, so it is necessary to select a device that has a synchronous connector.

Also, connect the sync connector on the master device and the sync connector on the slave device with a dedicated sync cable in advance.

Please refer to Example 2 for Using Event Controller for synchronous operation.

 

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

EcuSyncSampling

Conversion data transfer mode

0 (Device buffer mode)

Start condition

Master: 0 (Software), Slave: 10 (Event controller output)

Clock type

Master: 0 (Internal clock), Slave: 10 (Event controller output)

Stop condition

Master: 0 (Stop conversion by the specified times), Slave: 10 (Event controller output)

Memory type

0 (FIFO)

Event

Event that device operation end, Event that overflow, Event that sampling clock period error, Event that AD conversion error

 

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

 ・For Device Name, specify the device name set in Device Manager.

  The master side and slave side also need to specify the device name.

 ・When the [AioInit] button is pressed, the device driver is notified that the specified device will be used.

 

3. Analog Input Set

 ・Specify Analog Input Set [Range:] in the master and in the slave, and also specify [Input Method:].

 ・When you press the [Analog Input Set] button, the above specified contents are notified to the device driver.

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

 

4. Sampling Set

 ・Specify the desired number of channels in the [Number of Channels:] setting in the master and in the slave.

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

 ・Specify the desired internal clock value in [μsec] in the [Internal Clock Value:] setting in Master.

  The minimum internal clock value that can be specified depends on the device used.

  You should also consider the number of channels value you specified.

  For details, please refer to the item of [Glossary] Sampling clock period error.

 ・Specify the desired number of acquired data in the "Stop Times:" setting in Master.

 ・When you press the [Sampling Set] button, the above specified contents are notified to the device driver.

 

5. Synchronous Operation Setting

 ・When you press the [Sync Operation Set] button, the start condition, clock condition, and stop condition are notified to the device driver.

 

6. Sampling Operation

 ・When you press the [Sampling Start] button, data sampling is also performed.

  Data sampling of the slave side device is also performed at the same timing as the master side device.

 ・When you press the [Get Status] button, the displayed value of [Sampling Count:] are updated.

 ・Data sampling stops when the [Sampling Stop] button is pressed.

 ・When data input is completed up to the specified Stop Times or when sampling stops, an Event that device operation end occurs.

  When the event occurs, the sampled data value are displayed in the [Sampling Data:] text box.

 

7. Saving sampling data

 ・By pressing the [Master Device Output Acquired Data to File...] button, you can save the sampling data displayed in the master side text box to a text file.

 ・By pressing the [Slave Device Output Acquired Data to File...] button, you can save the sampling data displayed in the slave side text box to a text file.

  Sample file example:

  

 

8. 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.

 

9. Processing to terminate the program

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