1. epics ioc on compactrio epics collaboration meeting fall 2011

28
1

Upload: beverley-flowers

Post on 17-Jan-2016

230 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

1

Page 2: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

EPICS IOC on CompactRIO

EPICS Collaboration MeetingFall 2011

Page 3: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

Agenda• EPICS Overview• CompactRIO Overview• EPICS IOC on CompactRIO• Questions and Answers

Page 4: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

4

EPICS Overview

Page 5: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

EPICS Overview

• Experimental Physics and Industrial Control System (EPICS)• Used to develop and implement distributed control systems to

operate large experiments• SCADA architecture that uses client/server and publish/subscribe• Input/Output Controller (IOC) collect experiment and control data• Operator Interface (OPI) display data and control experiments• Channel Access (CA) is a Ethernet protocol used to distribute the

data• Process Variables (PVs) are unique data items on CA protocol

Page 6: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

EPICS Software Architecture• Distributed Clients (OPI – Operator Interface) and Servers

(IOC – I/O Controllers)• Network protocol: Channel Access (CA) with Process

Variables (PVs)

CA (Channel Access)

Analog I/O, Digital I/O, Motion Control, Image Acquisition, etc.

IOC (I/O Controller)

I/O HW

IOC (I/O Controller)

I/O HW

IOC (I/O Controller)

I/O HW

IOC (I/O Controller)

I/O HW

OPI (OperatorInterface)

OPI (OperatorInterface)

Page 7: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

EPICS Database

Hardware

Sequencer(Finite State Machine)

DatabaseEngine

Channel AccessProtocol Server

Network Traffic (Channel Access protocol)

IOC Software Architecture

• Channel Access Protocol ServerPublishes values from the database onto the network using Channel Access protocol

• SequencerControls timing for when to update values

• EPICS DatabaseContains the record definition and values

• Database EngineWrites I/O values to the database

Page 8: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

8

CompactRIO Overview

Page 9: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

CompactRIO Features at a glance• PowerPC CPU 400 – 800MHz• VxWorks• 256 – 512MB RAM• 2 – 4GB flash storage• Ethernet (1 or 2 ports), Serial port, USB port• I/O chassis (4 or 8 slots)• FPGA (Virtex-5 LX 30 – LX 110)• LabVIEW Real-Time

Page 10: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

10

What is LabVIEW?• Graphical system design environment• Application Areas:

Acquiring data and processing signals Automating test and validation systems Instrument control Embedded monitoring and control systems Academic teaching

Page 11: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

CompactRIO Architecture

• Flexibility and determinism of RT programming• Speed and reliability of FPGA programming

LabVIEW FPGA

I/O Card

I/O Card

I/O Card

LabVIEW Real-Time

PCI

VxWorks Xilinx FPGA

CompactRIO Architecture

I/O Slots

LAN

Page 12: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

cRIO-9014cRIO-9103

Temperature chamber

(fan and light bulb)

NI 9211Acquires temperature

from chamber

NI 9474Sends digital signals to toggle the fan and the light in the chamber

Sound and vibration simulator(not used)

Page 13: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

Hands-On

• Exercise 1: Verifiying and configuring setup• Exercise 2: Setup a simple temperature control VI

Page 14: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

14

LabVIEW FPGA

• Allows domain experts to use FPGA technology• Requires no HDL skills

Page 15: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

15

C-Series I/O Modules• 100s of modules of many different types: ai, ao, dio,

motion, relay, CAN, RS232, profibus, temperature• Plug and Play functionality over Scan Engine with many

of them

Page 16: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

16

What can I do with an FPGA?• Loop speeds of 40MHz or more• Custom triggering• Custom acquisition/generation• Offload CPU intensive tasks• True parallelism• Integrate HDL IP• Encryption

Page 17: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

17

LabVIEW FPGA Applications

Page 18: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

19

EPICS IOC on CompactRIO

Page 19: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

CompactRIO Architecture

• Flexibility and determinism of RT programming• Speed and reliability of FPGA programming

LabVIEW FPGA

I/O Card

I/O Card

I/O Card

LabVIEW Real-Time

PCI

VxWorks Xilinx FPGA

CompactRIO Architecture

I/O Slots

LAN

Page 20: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

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 21: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

EPICS Database

Hardware

Sequencer(Finite State Machine)

Reads values from the database to drive state

changes in the IOC control application.

Channel AccessProtocol Server

Publishes values from the database onto the network

using Channel Access protocol.

Network Traffic(Channel Access Protocol)

Shared Memory

LabVIEWApplication

IOC Server on CompactRIO

DatabaseEngine

Page 22: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

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 Engine• Requires a custom VxWorks kernel (LV

2010 SP1 and earlier)• Requires special .out files (LV 2011)• Limited EPICS Device Support

# Read a double from shared memoryrecord(ai,"$(NAME):AI0") {# field("Read a double from SM") field(DTYP,"SM Device") field(INP,"@0") field(SCAN,".1 second")}

Page 23: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

Shared Memory Benchmarks – LV 8.5 – 9014

• Arrays – Maximum transfer of 1 to 5 MB/s• Integers – Maximum transfer of about 10 to 12 kB/s

Page 24: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

Example – Los Alamos LANSCE

• Migration to a cRIO with embedded EPICS 12 binary outputs 36 binary inputs 12 analog inputs 5 stepper motor channels

• Full IOC functionality allows access to all record fields and EPICS utilities

• Maximum flexibility for partitioning the problem LabVIEW for beam diagnostic EPICS for industrial control

Page 25: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

Options for EPICS and NI Hardware• 1

• 2a

• 2b

• 3

LabVIEW I/O Server EPICS CA Client or Server

LabVIEW RTon cRIO Shared Memory EPICS IOC

on VxWorks

LabVIEW RTon PXI

HypervisorShared Memory

EPICS IOCon Linux

PXI (No LabVIEW)

Linux DriverDevice Support

EPICS IOCon Linux

Page 26: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

Hands-On

• Exercise 3: EPICS IOC on cRIO

Page 27: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

Demo

Page 28: 1. EPICS IOC on CompactRIO EPICS Collaboration Meeting Fall 2011

38

Questions