This is an old revision of the document!
Table of Contents
Getting Started with Arduino IDE
This guide explains how to check one digital input and one output after connecting the product for the first time.
1. Identify the Product
Check the following on the product label.
- MPINO or MPAINO product family
- Full model name and R/T output type
- Number of I/O points
- Power input specifications
2. Before Powering On
- Check terminal names against the product manual.
- Check power polarity and COM wiring.
- Disconnect output loads before the first program upload.
- Set analog-module DIP switches with the power off.
- Provide emergency-stop and overcurrent-protection circuits independently of the program.
3. Install Arduino IDE and the ILOGICS boards
- Download and install the Windows Arduino IDE installer from the official Arduino download page. Use the installer rather than the ZIP archive.
- Download and run
ARDUINO SDK INSTALLfrom the ILOGICS Arduino SDK download page. It adds the MPINO and MPAINO board definitions to Arduino IDE. - Start Arduino IDE. If it is already open, close and reopen it.
- Under Tools → Board → ILOGICS (in Sketchbook), select the entry for the product label. For MPINO-8A4R-S and MPINO-8A4T-S, select
MPINO-8A4R(T)-S. - Connect the product to the PC and select its COM port under Tools → Port.
Some models can also use the Arduino Mega/Mega 2560 board definition. Check the Arduino SDK download page for model-specific installation requirements. The MPAINO logical-channel examples in this guide use an ILOGICS board definition. If you select Arduino Mega/Mega 2560, change the code to the Arduino pin numbers in the product manual. Select an ILOGICS board definition to use ILOGICS built-in commands.
4. First Output Program
Replace OUTPUT_CHANNEL in the example below with the first output number for your product.
- MPINO: the first relay or transistor output in the product pin map
- MPAINO: the first output is
64
const uint8_t OUTPUT_CHANNEL = 64; // MPAINO example void setup() { pinMode(OUTPUT_CHANNEL, OUTPUT); } void loop() { digitalWrite(OUTPUT_CHANNEL, HIGH); delay(500); digitalWrite(OUTPUT_CHANNEL, LOW); delay(500); }
Check output indicators and terminal states before connecting loads. Relay contacts may produce an audible click, but transistor outputs cannot be measured like voltage outputs without an external supply and load wiring.
5. Link an Input to an Output
const uint8_t INPUT_CHANNEL = 0; const uint8_t OUTPUT_CHANNEL = 64; // MPAINO example void setup() { pinMode(INPUT_CHANNEL, INPUT); pinMode(OUTPUT_CHANNEL, OUTPUT); } void loop() { bool inputState = digitalRead(INPUT_CHANNEL); digitalWrite(OUTPUT_CHANNEL, inputState); }
MPAINO digital inputs include pull-down resistors, so use INPUT. For MPINO, configure inputs according to the circuit and manual for the specific product.
6. Extend Your Program with Built-in Functions
Use Ibounce() or IdigitalRead() for noisy inputs, Iton() for delays, and Iscale() for range conversion.
const uint8_t INPUT_CHANNEL = 0; const uint8_t OUTPUT_CHANNEL = 64; void setup() { pinMode(INPUT_CHANNEL, INPUT); pinMode(OUTPUT_CHANNEL, OUTPUT); } void loop() { bool stableInput = Ibounce(INPUT_CHANNEL, 30); bool delayedOutput = Iton(0, stableInput, 1000); digitalWrite(OUTPUT_CHANNEL, delayedOutput); }
