TwinCAT ADS bridge

ADS to BUS/RT bridge, required for TwinCAT ADS controller instances.

Setup

Use the template EVA_DIR/share/svc-tpl/svc-tpl-bridge-ads.yml:

# TwinCAT ADS bridge service
command: svc/eva-bridge-ads
bus:
  path: var/bus.ipc
config:
  host: 192.168.1.100
  port: 48898
  #ping_ams_netid: 192.168.1.100.1.1
  #ping_ams_port: 200
  #set if the local address can not be detected automatically (e.g. tunnels
  # are used)
  #local_ams_netid: 192.168.1.2.1.1
  #local_ams_port: 58913
user: nobody
workers: 2

Create the service using eva-shell:

eva svc create eva.bridge.ads1 /opt/eva4/share/svc-tpl/svc-tpl-bridge-ads.yml

or using the bus CLI client:

cd /opt/eva4
cat DEPLOY.yml | ./bin/yml2mp | \
    ./sbin/bus ./var/bus.ipc rpc call eva.core svc.deploy -

(see eva.core::svc.deploy for more info)

EAPI methods

See EAPI commons for the common information about the bus, types, errors and RPC calls.

ping

Description

Ping ADS device

Parameters

required

Returns

nothing

Parameters

Name

Type

Description

Required

net_id

String/[u8; 6]

Device AMS Net ID

yes

port

u16

Device AMS Port

yes

read

Description

Call ADS read request

Parameters

required

Returns

Vec<u8>

Parameters

Name

Type

Description

Required

net_id

String/[u8; 6]

Device AMS Net ID

yes

port

u16

Device AMS Port

yes

index_group

u32

Index group

yes

index_offset

u32

Index offset

yes

size

u32

Expected result size

yes

su_read

Description

Call ADS SUMUP read request

Parameters

required

Returns

SumUp result as Vec<Res> with fields c (code), d (bytes)

Parameters

Name

Type

Description

Required

net_id

String/[u8; 6]

Device AMS Net ID

yes

port

u16

Device AMS Port

yes

requests

Vec<ReadRequest>

Struct fields: index_group, index_offset, size

yes

su_write

Description

Call ADS SUMUP write request

Parameters

required

Returns

SumUp result as Vec<Res> with fields c (code)

Parameters

Name

Type

Description

Required

net_id

String/[u8; 6]

Device AMS Net ID

yes

port

u16

Device AMS Port

yes

requests

Vec<WriteRequest>

Struct fields: index_group, index_offset, data

yes

su_write_read

Description

Call ADS SUMUP write-read request

Parameters

required

Returns

SumUp result as Vec<Res> with fields c (code), d (bytes)

Parameters

Name

Type

Description

Required

net_id

String/[u8; 6]

Device AMS Net ID

yes

port

u16

Device AMS Port

yes

requests

Vec<WriteReadRequest>

Struct fields: index_group, index_offset, data, size

yes

write

Description

Call ADS write request

Parameters

required

Returns

nothing

Parameters

Name

Type

Description

Required

net_id

String/[u8; 6]

Device AMS Net ID

yes

port

u16

Device AMS Port

yes

index_group

u32

Index group

yes

index_offset

u32

Index offset

yes

data

bytes

Write payload

yes

write_read

Description

Call ADS write-read request

Parameters

required

Returns

Vec<u8>

Parameters

Name

Type

Description

Required

net_id

String/[u8; 6]

Device AMS Net ID

yes

port

u16

Device AMS Port

yes

index_group

u32

Index group

yes

index_offset

u32

Index offset

yes

data

bytes

Write payload

yes

size

u32

Expected result size

yes