An IO module is an interface module used to connect computer systems or control systems with external devices. Digital IO modules are used to process binary signal input and output, enabling the reception and transmission of digital signals. They are typically employed for controlling logic switches, triggers, and other digital devices. Analog IO modules are used to process continuous signal input and output, enabling the reception and transmission of analog signals. They are typically employed for measuring and controlling continuous parameters such as temperature, pressure, and voltage. This article mainly introduces TOSUN devices with IO and the IO function operation process in TSMaster software.
Keywords:IO module, digital input/output, analog input/output, DIDO, AIAO
1. TOSUN DIO Supported Hardware
The TOSUN TC series, such as TC1014Pro, TC1018Pro, TC1034Pro+, TC1038 Pro, and TC1055 Pro, have IO functions. In addition, the Tlog series, such as Tlog1002, Tlog1004, and Tlog1038, also have IO functions. The specific number of IO channels is as follows:
Equipment model | Number of DIDO channels | Number of AIAO channels |
TC1014 Pro | 4 | 3 |
TC1018 Pro | 4 | 3 |
TC1034 Pro+ | 4 | 3 |
TC1038 Pro | 4 | 3 |
TC1055 Pro | 4 | 3 |
Tlog1038 | 4 | 3 |
Tlog1004 | 2:DI,2:DO | 1 |
Tlog1002 | 3:DI,2:DO | 0 |
1.1 Technical parameters of TOSUN IO devices
- The input voltage range of the DI is 0-40V, the reference voltage Vref is 0-3.3V, the upper limit of the threshold range VAH=(330+499*Vref)/1098, and the lower limit of the threshold range VAL=0.455*Vref.
- DO output voltage: low level 0V, high level 5V/12V (does not support use with load), output mode is open drain, push-pull; with overvoltage protection, maximum output frequency 200kHz.
- The AI input voltage range is 0-39V, the input impedance is 3.4MΩ, and the resolution is 12 bits.
- The AO output voltage range is 0-30V, with overvoltage protection and 12-bit resolution.
Note: Some model specifications may vary. Please refer to the latest product manual for the corresponding device.
1.2 DO output mode of IO interface
The DO output mode of TOSUN IO products can be set to different modes, supporting Push-Pull output mode and Open-Drain output mode. At the same time, the open drain output is subdivided into Open-Drain-Pull and Open-Drain-Push modes.
The characteristics of push-pull output include strong drive capability, no static power consumption, and high-speed switching, making it suitable for PWM and clock signal output.
For the Open-Drain output mode, the output terminal is in an open-circuit state, and an external pull-up resistor is required when the output is high. It has specific level compatibility and can be connected to different voltage outputs via an external pull-up resistor. It also supports multi-device line and function capabilities. Specific characteristics are as follows:
Features | Push-Pull | Open-Drain | Open-Drain-Pull | Open-Drain-Push |
High-level drive source | Internal PMOS | External pull-up | External pull-up | Internal PMOS |
Low-level drive | Internal NMOS | External pull-down | Internal NMOS | External pull-down |
Bus line and support | Clogged | None | Be | None |
Level conversion capability | None | None | Yes | None |
Typical drive current | <50mA | None | <50mA | <50mA |
Speed | Fast (ns level) | Fast (ns level) | Fast (ns level) | Fast (ns level) |
2. TSMaster IO usage process
TOSUN hardware with IO channels can use TSMaster software for channel selection and IO configuration. The following is the configuration operation process on TSMaster.
▲ Step 1: After connecting the device with IO to the computer, select the number of DO/DI or AI/AO channels required in [Hardware] - [Channel Selection], as shown in Figure 1.

▲ Step 2: Then, in [Hardware] - [Bus Hardware], you can select the corresponding IO type to configure input and output. For different IO types, you can set the sampling rate for digital or module inputs, the mode, voltage, and type of digital outputs, etc., as shown in Figure 2.

▲ Step 3: After configuration is complete, you can view the IO system variables generated by the system for observation and control in [Simulation] - [System Variables] - [Internal Variables]. At the same time, TSMaster provides a mini-program control function for DO output, which is used for program control of DO, as shown in Figure 3.

3. TSMaster IO parameter settings
3.1 Digital input parameters
Sampling rate (Hz): Selectable from 0.001, 0.01, 0.1, 1, 10, 25, 100, as shown in Figure 4.

When there is no voltage input to the DI pin, the value of the DI system variable is 0; when the voltage input to the DI pin exceeds the threshold, the value of the DI system variable changes to 1, as shown in Figure 5.

3.2 Digital Output Parameters
The parameter settings for digital output are related to the device type and are divided into two types: the TC series and the Tlog recorder. The TC series digital output can be set to normal level output and PWM wave output. The Tlog recorder digital output supports normal level output settings.
3.2.1 TC Series Digital Output Parameters
The digital output of the TC series, taking the TC1055Pro as an example, supports setting the output voltage level, output mode, and output type, as shown in Figure 6.
Voltage Level: Optional 5V/12V
Output Mode:
Push-Pull: Can actively output high and low levels, suitable for high-speed and high-current drive.
Open-Drain: Can only output low levels; high levels require external pull-up resistors. Suitable for sharing signal lines among multiple devices.
Open-Drain-Pull: Similar to Open-Drain, this emphasizes the use of external pull-up resistors.
Open-Drain-Push: Output drive capability can be enhanced through external circuits as needed.
Output Type:
General Output: Normal Level Output
PWM Output: Output PWM wave

3.2.2 Tlog series digital output parameters
The Tlog series has digital outputs that support periodic reporting settings for status readback monitoring. Take the Tlog1004 as an example, as shown in Figure 7.
Periodic reporting (Hz): 0.001, 0.01, 0.1, 1, 10, 25, 100.

3.3 Analog Input Parameters
The parameters of the analog input can be set to the sampling rate. Take the TC1014 Pro as an example, as shown in Figure 8.
Sampling rate (Hz): 0.001, 0.01, 0.1, 1, 10, 25, 100.

3.4 Analog Output Parameters
The feature is currently undergoing an upgrade and update. Please stay tuned!
4. TSMaster's IO Mini Program Function
The TSMaster mini program provides two functions to control DO output: a normal level output function and a PWM output function.
Among them, the normal level output function is as follows:
Project | Descriptive |
Function name | tsdio_set_vlevel_output_async |
Parameters | Two: ➤ AChn, for IO channel index ➤ AIOStatus is the voltage output status, with 1 representing a high level and 0 representing a low level. |
Typical example | com.tsdio_set_vlevel_output_async(CH1, 1); // Set channel 1 to high level output |
The PWM output function is as follows:
Project | Descriptive |
Function name | tsdio_set_pwm_output_async |
Parameters | Three: ➤ AChn, for IO channel index ➤ ADuty is the duty cycle value. For example, setting it to 20 means that the duty cycle is set to 20%. ➤ AFrequency, frequency value, for example, set to 100, represents a frequency of 100Hz. |
Typical example | com.tsdio_set_pwm_output_async(CH1, 20, 1000); //Channel 1, set duty cycle to 20, frequency is 1000Hz. |
5. Application example: PWM output wake-up ECU
Many ECUs in automobiles use PWM signals for wake-up, such as the following wake-up scenarios:
- Body controller wake-up: The light sensor detects sudden changes in light and then outputs a 1 kHz PWM wave with a 70% duty cycle to wake up the BCM controller and turn on the headlights.
- Battery Management System Alarm: When the module detects that the battery voltage exceeds the threshold, it sends a fixed pulse width PWM signal to wake up the main BMS ECU for protection processing.
The following describes how to use the IO module of TC1055Pro and TSMaster to output PWM waves to wake up the main ECU.
▲ Step 1: Refer to the ECU wake-up instructions to determine the timing and IO signal type for waking up the ECU. After the ECU is powered on, it will wake up when it receives a PWM wave with a duty cycle of 20% and a frequency of 1 Hz.
▲ Step 2: Connect the TC1055Pro to the PC using the DO channel and ECU wake-up signal connection terminals.
▲ Step 3: In the TSMaster channel selection menu, set the DO application channel and hardware channel, as shown in Figure 9.

▲ Step 4: In the hardware configuration, set the DO output voltage to 5V, the output mode to Push-Pull, and the output type to PWM. See Figure 10.

▲ Step 5: Create a C code editor and create two key events in the key event, corresponding to start PWM output and stop PWM output, respectively.
Button event A corresponds to the start of PWM output, as shown in Figure 11:

Button event B corresponds to stopping PWM output, as shown in Figure 12:

▲ Step 6: Compile the C program, start the TSMaster project, press the A key on the keyboard to start outputting PWM to the ECU, and use an oscilloscope to observe the output PWM waveform, as shown in Figure 13.

Press the B key to stop PWM output, and use an oscilloscope to observe the PWM waveform output, as shown in Figure 14.

Which feature of TSMaster are you most interested in? Or what problems have you encountered in practical applications?
Welcome to share your experience or questions in the comment section, any ideas or suggestions can also be comment section message interaction, will have the opportunity to win the TOSUN mystery gift bag Oh ~!
Tip:
1. Software download:
Click on the software download link below to download and install directly, beta version is recommended:
2. Software upgrades:
You can check for upgrades to the latest version within the software, provided that your computer has an Internet connection.
Note: TOSUN Technical Support Email:support@tosunai.cnWe welcome inquiries! (Company and contact information must be indicated)