This is an old revision of the document!
Table of Contents
Getting Started with Arduino IDE
Follow these steps to upload a program to an MPINO or MPAINO product and check one digital output and input. Input 0 and output 64 in the examples are for MPAINO-8A8R(T). For another product, replace them with the addresses in its pin map.
1. Check the Product and I/O Addresses
Read the full model name, R/T output type, and power-input specification on the product label. The output type determines how you connect a load and check its operation.
- Other MPAINO and MPINO models: Open your model under MPAINO Series or MPINO Series and check the input and output addresses you will use.
2. Before Powering On
- Check the terminal names and power polarity against the product manual.
- Check COM wiring and the upload cable specified for the product. For the MPAINO-8A8R(T) in this example, connect a standard USB cable to the CPU module's download port.
- Leave output loads disconnected for the first upload and output check.
- 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.
- Download and run
ARDUINO SDK INSTALLfrom the ILOGICS Arduino SDK download page. It adds the ILOGICS board definitions to Arduino IDE. - Close Arduino IDE and start it again.
- Connect the product to the PC, then select its board and port as shown below.
Select the Board
Click the board selector at the top of Arduino IDE and choose Select other board and port…. This actual Arduino IDE screen shows MPAINO-8A8R(T) in the search results.
| Marker | What to do |
|---|---|
| 1 | Enter the product model in the BOARDS search field. |
| 2 | Select the ILOGICS board that matches the product label. For MPINO-8A4R-S and MPINO-8A4T-S, select MPINO-8A4R(T)-S. |
Select the Port
After connecting the MPAINO-8A8R(T), Windows Device Manager → Ports (COM & LPT) showed Silicon Labs CP210x USB to UART Bridge(COM1). Arduino IDE showed the same port as COM1 Serial Port (USB). Match the COM number when selecting the port.
| Marker | What to do |
|---|---|
| 1 | Under PORTS, select the COM number found in Device Manager. COM1 is the number on this PC; yours may differ. |
| 2 | Click OK to apply the board and port selection. |
Arduino IDE may show COMx Serial Port (USB) rather than the driver name. Products that use an MP download cable appear in Windows Device Manager as USB Serial Port(COMx). Distinguish that port from the CP210x port used by this MPAINO example.
If no COM port appears in Device Manager, install the driver for your connection and reconnect the cable.
- Products with built-in CP210x, including MPAINO-8A8R(T): CP210x USB driver
- Products using an MP download cable: FTDI USB driver
If the board is already selected, you can choose the same port from the menu: ① Tools → ② Port → ③ COM1.
Selecting only a board is enough to verify code, but uploading also requires a port.
4. Your First Output Program
The sketch below turns MPAINO-8A8R(T) output 64 on and off every 0.5 seconds.
| Marker | What to do |
|---|---|
| 1 | Verify (✓): Compile the code and check for errors. This does not send the program to the product. |
| 2 | Upload (→): Send the verified program to the product on the selected port. |
| 3 | Board selector: Check the selected model, or reopen board and port selection. |
| 4 | Sketch editor: Enter the code below. |
const uint8_t OUTPUT_CHANNEL = 64; // MPAINO-8A8R(T) example void setup() {} void loop() { digitalWrite(OUTPUT_CHANNEL, HIGH); delay(500); digitalWrite(OUTPUT_CHANNEL, LOW); delay(500); }
For MPAINO-8A8R(T), the ILOGICS SDK's main() configures the output pin before setup() runs. This example does not need a separate pinMode() call.
- Open File → New Sketch and enter the code. For MPINO or another MPAINO model, change
OUTPUT_CHANNELto the first output address in that model's pin map. - Save the sketch with Ctrl + S.
- Click Verify (✓). Compilation is complete when the output panel shows no errors and
Done compiling.appears. - Check the board and port, click Upload (→), and wait for the completion message.
- With the output load still disconnected, check that the indicator for that output changes state every 0.5 seconds, if fitted.
You may also hear a relay contact switch. Without an external supply and load, a transistor output cannot be measured like a voltage output. If the product has no output indicator, first check the output test method in its manual.
5. Turn an Output On with an Input
This example reads MPAINO-8A8R(T) input 0 and applies the same state to output 64. The output turns on when the input is HIGH and turns off when it is LOW.
const uint8_t INPUT_CHANNEL = 0; // MPAINO-8A8R(T) input example const uint8_t OUTPUT_CHANNEL = 64; // MPAINO-8A8R(T) output example void setup() {} void loop() { bool inputState = digitalRead(INPUT_CHANNEL); digitalWrite(OUTPUT_CHANNEL, inputState); }
Verify (✓) and Upload (→) the sketch. Connect the input signal as shown in the MPAINO-8A8R(T) manual. Change its state and check that the output state changes with it. MPAINO digital inputs have built-in pull-down resistors. For another model, use addresses from that product's pin map and check its input circuit.
6. If Something Does Not Work
| Symptom | What to check |
|---|---|
| The product is missing from board search | Check that ARDUINO SDK INSTALL ran, then restart Arduino IDE. |
| Verification reports an error | Read the error location in the output panel. Check the code for typos and confirm the selected board. |
| Upload fails | Check the board and COM port, the product's upload cable, and product power. |
| Upload completes but the output does not change | Check that OUTPUT_CHANNEL is an output address in the product pin map. Check the output type and whether an indicator is fitted. |
