1 / 13

Making LabVIEW look like an IOC

Making LabVIEW look like an IOC. Kay-Uwe Kasemir, LANL May 2002. National Instruments’ LabVIEW. Integrated Graphical Programming Language and Operator Interface Instructions and “Virtual Instruments” (Vis): Add, Wait, Loop, Open device, Read value, … Many GUI elements: Knobs, Graphs, …

Download Presentation

Making LabVIEW look like an IOC

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Making LabVIEW look like an IOC Kay-Uwe Kasemir, LANL May 2002

  2. National Instruments’ LabVIEW • Integrated Graphical Programming Language and Operator Interface • Instructions and “Virtual Instruments” (Vis):Add, Wait, Loop, Open device, Read value, … • Many GUI elements: Knobs, Graphs, … • Supports huge number of GPIB, VXI, Serial as well as NI specific (PXI, FieldPoint) instruments • Library for Signal Analysis, … • Widespread use for Test & Measurement

  3. LabVIEW LabVIEW User program Create PVs,Interact with Instruments,Update PVs and GUI,Check for User Input User program Create PVs,Interact with Instruments,Update PVs and GUI,Check for User Input CAServer VIs CAServer VIs LabVIEW ActiveX VIs LabVIEW ActiveX VIs Integration via ChannelAccess, based on ActiveX CA Clients:OPI, Archiver, Alarm Handler, LabVIEW, Matlab, … Internet: CA based on UDP & TCP EpicsCAServer(ActiveX Automation Server for Win32) Updates IProcessVariableString name,Double deadband,SetValue(Variant v), … (similar: Visual Basic, Matlab, …) AX Event List of PVs“XYSetpoint”,“XYReadback”,“XYStatus”,“XYOn_Off”, … Updates CAS.DLL (server lib.) User Input

  4. Example LabVIEW Code • 101: Publish PV and updates • 102: Deadband, Config. Info, Reaction to remote input

  5. Data Served LabVIEW Visual Basic Double 0.14 ms 0.08 ms Double[100] 0.20 ms 0.16 ms Double[500] 0.45 ms 0.40 ms Double[1000] 0.75 ms 0.77 ms Performance • COM call to update value of a PV (LabVIEW 7.I, 900MHz PC) • Reaction to user input (Check AX Event, post new value) • 2 COM transactions, ~0.28ms • LabVIEW Implementations: 10 PVs, handle user input • Loop: 7ms • Parallel: 0.5ms

  6. LANL Experience • Terrific for small systems • Signal generator, GPIB, new PC: handled in one afternoon • No need for vxWorks, IOC, boot host, display computer • Compare: 3 days for EPICS IOC, GPIB Lan Box, EDM.(Not considered: Advantages of EPICS driver & DB and Lan box) • Faster initial development cycle • No recompile & reboot (until turned into distributed system) • Handled up to ~500 PVs on one PC

  7. LabVIEW: Limits of Visual Coding • Diagram gets too big, “wires” tangled • Hardware engineers switched to e.g. VHDL for this reason • No ASCII import/export • no real CVS support, no comparable NI tool • no script-generated code from signal list, RDB, Capfast, ... • What you see is all you get • IOC’s scanning mechanisms and reaction to remote input have to be re-implemented with fundamental instructions(loops, delays, …)

  8. LabVIEW Oddities we ran into • Movie-Style “Sequence” is a cute but only shows one frame at a time • Array handling: • Array constants easyto accidentally extend • Auto-indexing misleadingfor different sized input arrays

  9. LabVIEW: Polling • Remote input via ChannelAccess • ActiveX Event is sent with <new value>, • LabVIEW has to catch event, check the value and - if accepted - update PV to that new value • While e.g. VisualBasic can handle events async.,LabVIEW can only “WaitForEvent” • Response delayeduntil LabVIEW’smain loop comes aroundto service the PV changes • In principle, LabVIEW offersthreads & semaphores, butis that still “easy”?Not debuggable, evensome Nat.Inst. VIsare incompatible. Most code in here! Main Loop Check PVs for remote input Interact with HW, perform control Update PVs to reflect current status

  10. ‘EPICS’ data Conclusion (still) Win32-Program (with not too much) data worth serving, e.g. LabVIEW + ActiveX CA Server

  11. ActiveX Automation Server • COM (Component Object Model) allows programs to share objects • COM Classes identified via CLSID • Win32 handles creation and messaging • All objects implement the IUnknown Interface:AddRef, Release, QueryInterface • Programs agree on custom interfacesso that they can use each other’s objects. • ActiveX Automation: • Additional well-known interfaces,allowing IDEs and interpretedlanguages to • “browse” properties, methodsand events • “late” as well as “early” binding • LabVIEW: required IProvideClassInfoin addition to standard skeleton createdby MS Visual C++ ATL wizard

  12. EpicsCAServer.IProcessVariable • String name • Double deadband • String enum_string(Long index) • String units, Long precision,Double low_warning, high_warning, ... • SetValue(Variant new_value),SetEnumValue(Long new_value),SetValueAndTime(Variant new_value, …) • Event Changed(Variant value_received)

  13. EpicsCAClient.IProcessVariable • String name • Long is_connected • Variant Value • String units, ... • Event NewValue(Long is_connected, Variant value)

More Related