24V Binary Outputs
In this quick-start guide we will run a demo program to stimulate the SQ1-TRACK's 24 V binary outputs. Note that the firmware calls these outputs "Audio Relay", as they have been used initially to control power amplifiers in audio applications.
Prerequisites
Hardware
- A CompactPCI Serial System with a SQ1-TRACK installed
- A development PC (Windows or Linux), connected via Network to the CPCI Serial System
-
Networking for Ethernet-over-USB has been setup, so that the host can reach the SQ1-TRACK. See CPCI-S.0 Linux Networking
-
A laboratory power supply to provide a voltage to feed the binary Outputs
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 SQ1-TRACK
Io4Edge Devices are usually addressed by their service address, which is a name in the network.
The SQ1-TRACK's service name depends on the geographical slot address and is usually
SQ1-geo_addr-<geo-address>[-<function>], i.e. if the SQ1-TRACK is in the slot with geographical address 04, we have the following service names:
| Service Name | Description |
|---|---|
| SQ1-geo_addr04 | Core function |
| SQ1-geo_addr04-binio | Binary I/O function |
| SQ1-geo_addr04-audiorelay | 24V Binary Output function |
We need this service address in the demo programs to address the module, for example SQ1-geo_addr04-audiorelay.
If you are unsure, you can also browse the available devices:
io4edge-cli scan -f
If your SQ1-TRACK is in the slot with geographical address 04, the output should be:
DEVICE ID SERVICE TYPE SERVICE NAME IP:PORT
SQ1-geo_addr04 _io4edge-core._tcp SQ1-geo_addr04 192.168.205.1:9999
_io4edge_binaryIoTypeD._tcp SQ1-geo_addr04-binio 192.168.205.1:10000
_io4edge_binaryIoTypeB._tcp SQ1-geo_addr04-audiorelay 192.168.205.1:10001
24V Binary Output Demo
For the binary output demo we stimulate it via software and observe the front panel LEDs. Optionally, you can connect a multimeter or oscilloscope to one of the outputs to measure the voltage.
Connecting
Only required if you want to measure the output voltage with a multimeter or oscilloscope: Connect the GND and 24V pins of the D-Sub connector to your power supply and measure A and B outputs with your measurement device.
Demo Software
Compile Demo
Run this in a powershell console
cd examples\binaryIoTypeB\set_outputs
$Env:GOOS = "linux"
$Env:GOARCH = "amd64"
go build
cd examples/binaryIoTypeB/set_outputs
GOOS=linux GOARCH=amd64 go build
This produces the binary file set_outputs in the current folder.
Copy Demo to CompactPCI Serial CPU
Transfer the compiled binary. Replace <target-ip> with the IP address of your CompactPCI Serial CPU.
scp set_outputs <target-ip>:~/.
Running the Demo
Login into your CompactPCI Serial CPU over SSH:
ssh <target-ip>
Once logged in into the CompactPCI Serial CPU's Shell, run the demo.
./set_outputs SQ1-geo_addr04-audiorelay
On your measurement device you should see a voltage of 24 V when the output is activated.
INFO[0000] Set outputs to 0 # (both off)
INFO[0001] Set outputs to 1 # (output 1 on)
INFO[0003] Set outputs to 2 # (output 2 on)
INFO[0004] Set outputs to 3 # (both on)