IOU07 Quick-Start-Guide

In this quick-start guide we will run a demo program to stimulate the IOU07’s binary I/Os.

Prerequisites

Hardware

  • A Moducop Edge Computer with a IOU07 installed
  • A development PC (Windows or Linux), connected via Network to the Moducop

  • A laboratory Power Supply capable of supplying 5V..24V/200mA.

Tools on Development PC

The examples are written in programming language Go, we download the go sources and compile them. Therefore we need some tools on your development PC:

Get Demo Software

Clone the repository containing the examples to a folder of your choise (here myworkdir)

c:
cd \myworkdir
git clone https://github.com/ci4rail/io4edge-client-go.git
cd io4edge-client-go
cd ~/myworkdir
git clone https://github.com/ci4rail/io4edge-client-go.git
cd io4edge-client-go

Determine the Service Address of your IOU07

Io4Edge Devices are usually addressed by their service address, which is a name in the network.

The IOU07’s service name depends on the ModuCop’s slot and is usually S101-IOU07-USB-EXT-<slot-number>[-<function>], i.e. if the IOU07 is in the slot next to ModuCops CPU01, we have the following service names:

Service Name Description
S101-IOU07-USB-EXT-1 Core function
S101-IOU07-USB-EXT-1-binio Binary I/O function

We need this service address in the demo programs to address the module, for example S101-IOU07-USB-EXT-1-binio.

If you are unsure, you can also browse the available devices:

ssh root@<moducop-ip>

Once logged in into the Moducop Shell:

io4edge-cli scan -f

If your IOU07 is in the slot next to the CPU, the output should be:

S101-IOU01-USB-EXT-1, 192.168.201.1, S101-IOU01, <serial-number>
+-----------------------------+-----------------------------+-------+
|        SERVICE TYPE         |            SERVICE NAME     | PORT  |
+-----------------------------+-----------------------------+-------+
| _io4edge_binaryIoTypeC._tcp | S101-IOU07-USB-EXT-1-binio  | 10000 |
+-----------------------------+-----------------------------+-------+

Binary I/O Demo

The Binary I/O demo will stimulate the binary outputs 1..4 of the IOU07 one after another. Please supply the first binary I/O group with 24V, so when the output drives a high level, the binary I/O pin has 24V, which in turn illuminates the corresponding LED.

You will see a running light on the 4 LEDs.

Connecting

Plug a mating connector to the top connector of the IOU07.

Mating connectors for IOU07:

Connect the + and - pins of the first I/O group to your laboratory power supply which is set to a voltage of 18..36V.

Connection for Binary I/O Demo

Demo Software

Compile Demo

Run this in a powershell console

cd examples\binaryIoTypeC\blinky
$Env:GOOS = "linux"
$Env:GOARCH = "arm64"
go build
cd examples/binaryIoTypeC/blinky
GOOS=linux GOARCH=arm64 go build

This produces the binary file blinky in the current folder.

Copy Demo to Moducop

Transfer the compiled binary. Replace <target-ip> with the IP address of your Moducop.

We copy the binary to the /data folder of ModuCop, as this is a writeable, whereas the rest of the filesystem is write protected.

scp blinky root@<target-ip>:/data

Running the Demo

Login into your Moducop over SSH:

ssh root@<target-ip>

Once logged in into the Moducop’s Shell, run the demo.

In case your IOU07 is not in the slot next to the CPU, use a different address, e.g. S101-IOU07-USB-EXT-2-binio

/data/blinky S101-IOU07-USB-EXT-1-binio

You should see now the first 4 LEDs of the IOU07 running.