44
Embedded Device Communication Prepared for: Christoph Wimmer Thierry Debelle Kalin Taskov

Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

Embedded Device Communication Prepared for:

Christoph Wimmer

Thierry Debelle

Kalin Taskov

Page 2: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

2

Agenda Overview CompactRIO/CompactFieldpoint

Ethernet:

• TCP/IP, UDP

• Simple protocols

• Shared variables

• Web Services

OPC

• OPC-UA

EPICS

Communication buses

• Serial

• CAN

• Industrial buses

• CANopen

• Ethernet/IP

• Profibus/ProfiNet

Page 3: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

3

NI CompactRIO Embedded System Architecture

Real-Time Processor Reconfigurable FPGA

Industrial I/O

Modules

I/O I/O

I/O

I/O

I/OI/O

I/O

I/O

Rea

l-T

ime

Co

ntr

olle

r

Connectivity ADC Signal

Conditioning

•Reconfigurable FPGA for high-speed and custom I/O timing, triggering, processing, control

•Real-Time Processor for deterministic, stand-alone operation and advanced analysis

•Industrial I/O Modules with built-in signal conditioning for direct connection to

industrial sensors/actuators

Page 4: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

4

FPGA Processor I/O Modules

Standard Embedded RIO Architecture

Page 5: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

5

Compact FieldPoint

1. Analog and Digital I/O

2. Industrial Specs: -40 to 70 °C, 50g

shock, 5g vibration

3. Easy to Use

4. Complex Control Applications

5. Embedded Data Logging

6. Built-in Web Server

7. Custom Algorithms and Advanced Math

8. Control of External Devices via Serial or

Ethernet

9. Integration with Enterprise Systems

Page 6: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

6

Software Development

Development

Deployment

LabVIEW Realtime

LabVIEW FPGA

LabWindows/CVI Realtime

Page 7: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

7

Communication

Ethernet

CAN Profibus

Serial

CANopen

WSN

Module Development Kit

Page 8: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

8

Agenda Overview CompactRIO/CompactFieldpoint

Ethernet:

• TCP/IP, UDP

• Simple protocols

• Shared variables

• Web Services

OPC

• OPC-UA

EPICS

Communication buses

• Serial

• CAN

• Industrial buses

• CANopen

• Ethernet/IP

• Profibus/ProfiNet

Page 9: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

9

Ethernet

• 1000+m

• 10/100/1000 Mb/s

• Real-time implementation available (Ethercat,

ProfiNet, Ethernet/IP, TTP…)

• Widely adopted

Page 10: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

10

TCP/IP UDP

• RT support

• Examples

Page 11: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

11

Simple TCP/IP Messaging Protocol (STM)

• NI developed

• Pre-negotiated message definitions (size, data type,

ID) -metadata

• Hides the transport layer (TCP/IP, UDP, etc)

implementation details

• Minimizes network traffic

• Message data is sent as a string or byte stream

• Supports many data types

• C++ client available

Page 12: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

12

STM Server

Client

Page 13: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

13

Modbus

• Master/Slave architecture

• Supports: Serial, Ethernet

• LabVIEW library (RT, Windows, Linux)

Client Server

Initiate request

Perform Action

Initiate response

Receive response

Function code | Data Request

Function code | Data Request

Page 14: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

14

National Instruments Confidential

Shared Variable Engine

Shared Variable Engine

Application Software

Hardware I/O Scan

LabVIEW CVI MStudio OPC Client

cRIO CVS PXI cFP

Page 15: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

15

National Instruments Confidential

Shared Variable Types

• Single-Process

Use instead of Global Variable

• Network-Published

Available to any node

Windows & Realtime

Page 16: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

16

Web Server

Web Services in LabVIEW

Any Client Thin Client

Windows and Real-Time

Custom web clients

No runtime engine needed

Standard http protocol

Firewall friendly

Page 17: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

17

Agenda Overview CompactRIO/CompactFieldpoint

Ethernet:

• TCP/IP, UDP

• Simple protocols

• Shared variables

• Web Services

OPC

• OPC-UA

EPICS

Communication buses

• Serial

• CAN

• Industrial buses

• CANopen

• Ethernet/IP

• Profibus/ProfiNet

Page 18: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

OPC

Page 19: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

19

Analysis

Visualization

Data-logging

Typical Distributed System Layout

Connectivity

“Open” Protocols

Modbus

Serial

OPC Classic

OPC UA

Proprietary Protocols

PROFIBUS

EtherNET IP

DeviceNet

RSLinx

Deployment Targets

Page 20: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

20

NI OPC

Servers

What does an OPC Classic system look like?

OPC

3rd Party TCP

Page 21: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

21

OPC Unified Architecture (OPC UA)

• Operating system independent

Removed Microsoft dependence

No more DCOM settings

• Improved security

Use standard X.509 certificates

Encryption

Page 22: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

22

NI OPC

Servers

What does an OPC UA system look like?

OPC

3rd Party TCP

Page 23: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

23

Agenda Overview CompactRIO/CompactFieldpoint

Ethernet:

• TCP/IP, UDP

• Simple protocols

• Shared variables

• Web Services

OPC

• OPC-UA

EPICS

Communication buses

• Serial

• CAN

• Industrial buses

• CANopen

• Ethernet/IP

• Profibus/ProfiNet

Page 24: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

24

EPICS

• The EPICS CA Server and EPICS CA Client are

implemented as plug-ins to the I/O Server

• In both cases the interface in LabVIEW is

implemented via the Shared Variable

Process Variables (PVs) I/O Server Shared Variables

Page 25: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

25

EPICS Database

Hardware

Sequencer (Finite State Machine)

Database

Engine

Channel Access

Protocol Server

Network Traffic (Channel Access protocol)

Architecture

LabVIEW Shared Variable Engine

Hardware

LabVIEW Application

LV EPICS Server

I/O Server

Page 26: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

26

LabVIEW EPICS CA Server/Client

• Runs on LabVIEW for Windows and

LabVIEW Real-Time

• Implemented as an I/O Server

• Interfaced via Shared Variable

• Provides Channel Access functionality only

• Programmatic access

Page 27: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

27

Supported Data Types

Shared Variable Data Type PV Type Data Type Description PV Category

Single DBF_FLOAT Single-precision floating-point number

Numeric

Double DBF_DOUBLE Double-precision floating-point number

Int8 DBF_CHAR 8-bit integer

UInt8 DBF_UCHAR Unsigned 8-bit integer

Int16 DBF_SHORT 16-bit integer

UInt16 DBF_USHORT Unsigned 16-bit integer

Int32 DBF_LONG 32-bit integer

UInt32 DBF_ULONG Unsigned 32-bit integer

Boolean DBF_ENUM True or False logical value Logical

String DBF_String A sequence of characters representing readable text String

Array of Single DBF_FLOAT Array of single-precision floating-point numbers

Array

Array of Double DBF_DOUBLE Array of double-precision floating-point numbers

Array of Boolean DBF_ENUM Array of True or False logical values

Array of Int8 DBF_CHAR Array of 8-bit integers

Array of UInt8 DBF_UCHAR Array of unsigned 8-bit integers

Array of Int16 DBF_SHORT Array of 16-bit integers

Array of UInt16 DBF_USHORT Array of unsigned 16-bit integers

Array of Int32 DBF_LONG Array of 32-bit integers

Array of UInt32 DBF_ULONG Array of unsigned 32-bit integers

Page 28: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

28

Available Fields

• EPICS CA Server

On RT targets, the EPICS CA Server only allows you to

set the VAL field

On Windows, when using alarming with LabVIEW DSC,

the corresponding fields (HIHI, HHSV, SEVR, etc.) are

supported

• EPICS CA Client

Any field can be accessed, but a Shared Variable will

have to be created per field

Page 29: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

29

Deployment

• To a Real-Time target (PXI, cRIO, sbRIO)

Requires that the EPICS CA Server support is included

• To a Windows target

Requires the LabVIEW DSC run-time engine, or

Requires a full copy of LabVIEW DSC

Page 30: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

30

EPICS Database

Hardware

Sequencer (Finite State Machine)

Database

Engine

Write I/O values to

database. Default update

rate is 10 Hz.

Reads values from the

database to drive state

changes in the IOC

control application.

Channel Access

Protocol Server Publishes values from the

database onto the network

using Channel Access

protocol.

Network Traffic (Channel Access Protocol)

Shared Memory

LabVIEW

Application

IOC Server on CompactRIO

Page 31: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

31

Embedding EPICS IOC on CompactRIO

• EPICS IOC and LabVIEW Real-Time running

simultaneously

• Take advantage of FPGA platform with CompactRIO

LabVIEW

FPGA

I/O Card

I/O Card

I/O Card

EPICS IOC

LabVIEW

Real-Time

PCI

VxWorks Xilinx FPGA

CA

CompactRIO Architecture

I/O Slots

Page 32: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

32

IOC Server on CompactRIO

• CompactRIO controller runs

VxWorks

• Implemented via shared memory

• Interface to hardware via

LabVIEW RT and FPGA

• Can be used with Scan Mode

# Read a double from shared memory

record(ai,"$(NAME):AI0") {

# field("Read a double from SM")

field(DTYP,"SM Device")

field(INP,"@0")

field(SCAN,".1 second")

}

Page 33: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

33

Possible Implementation

• Create PVs programmatically and use an ini file to

modify the names of the PVs

• Each unique system can use the same application

where the only difference is a text file

Page 34: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

34

Summary

cRIO

IOC + C API IOC + RT (sm) CAS

CAC

EPICS Developer LabVIEW Developer

Page 35: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

35

Agenda Overview CompactRIO/CompactFieldpoint

Ethernet:

• TCP/IP, UDP

• Simple protocols

• Shared variables

• Web Services

OPC

• OPC-UA

EPICS

Communication buses

• Serial

• CAN

• Industrial buses

• CANopen

• Ethernet/IP

• Profibus/ProfiNet

Page 36: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

36

Serial

• cRIO: built in RS-232

• RS-232 4 RS232 (TIA/EIA-232) serial ports for CompactRIO

Baud rates from 14 b/s to 921.6 kb/s

Data bits: 5, 6, 7, 8; Stop bits: 1, 1.5, 2; Flow control: XON/OFF, RTS/CTS, None

Individual 64 B UART FIFO buffers per port

• RS-485/422 4 RS485/RS422 (TIA/EIA-485/422) ports for CompactRIO

Baud rates from 14 baud to 3.684 Mbaud; -40 to 70 °C operating range

Data bits: 5, 6, 7, 8; Stop bits: 1, 1.5, 2; Flow control: XON/OFF, RTS/CTS, None

Individual 64 B UART FIFO buffers per port

Transceiver modes: 4-wire, 2-wire DTR controlled, 2-wire DTR controlled with echo, 2-wire auto

Page 37: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

37

CAN

• Robust

• 2 leads

• Cost effective

• 1Mb/s (<40m)

• Message prioritization

• Alive signal by transmitting messages

every 100…1000m

• Failure of one node doesn’t affect other

nodes

ECU 1 ECU 3

ECU 2 ECU 4

Page 38: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

38

CANopen

• Based on CAN

• CANopen device

communication interface and protocol

software

object dictionary

process interface and application program

Communication

Interface

Object

Dictionary

Application

Process

Server SDOs

Client SDOs

Tx PDOs

Rx PDOs

NMT, SYNC,

EMCY, Time

stamp

CA

N b

us

Logical

addressing

Scheme for

Accessing of

communication

and device

parameters,

data and

functions

Device

functions

I/O signals

Process

Page 39: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

39

Ethernet/IP • Rockwell

• EtherNet/IP Class 1 adapter support

• Interact with objects in the Common Industrial Protocol (CIP) object module on an EtherNet/IP

device

EtherNet/IP

Page 40: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

40

Profibus/ProfiNet

• Siemens

• PROFIBUS DP (Decentralized Periphery)

communication between the Controller level of a process automation system (PLC) and the

decentralized periphery in the field.

• PROFIBUS PA (Process Automation)

Developed for the process industry

Communication and power supply to Transmitter and Positioners via one 2-wire cable

• Supported services: DPV0 Master Class 1/2, DPV0 Slave

• PROFIBUS DP RS485 baud rates from 9600 bits/s to 12Mb/s

• ProfiNet module in development

Page 41: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

41

Host Computer

(TCP/IP) CompactRIO

Ethercat: Deterministic Distributed Systems

NI PXI

Industrial embedded

Controller

Page 42: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

42

Comparison

Communication OS

TCP/IP, UDP Win, Linux, MacOS, RT, others

STM Win, Linux, MacOS, RT, others

Modbus Win, Linux, MacOS, RT, others

Shared Variables Win, RT

Web Services Server: Win, RT Client: Win, Linux, MacOS, RT, others

OPC Win

OPC-UA Win, Linux, RT, others

EPICS IOC/CA Linux, Win, RT

CAN HW

Ethernet/IP Win, Linux, RT

Profibus HW

Page 43: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

43

Selection criterias

• Other systems to integrate

• Performance

• Distance

• Real-time capability: control

• Special: Safety, environment,…

Page 44: Embedded Device Communication - Fermilab · Compact FieldPoint 1. Analog and Digital I/O 2. Industrial Specs: -40 to 70 °C, 50g shock, 5g vibration 3. Easy to Use 4. Complex Control

44

Questions?