1 / 21

‘ActiveX’ CA Server (… and Client)

‘ActiveX’ CA Server (… and Client). Oct. 2000 Kay-Uwe Kasemir, LANL. <Your Data>. Win32 Prog. IOC. IOC. ActiveX CAS. EPICS Db. EPICS Db. <Your C++>. CA Server. CA Server. CA Server. CAS & CAC. CA. CA. CA. CA. CA. CA. CA Client. Archive Engine. MEDM.

woody
Download Presentation

‘ActiveX’ CA Server (… and Client)

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. ‘ActiveX’ CA Server (… and Client) Oct. 2000 Kay-Uwe Kasemir, LANL

  2. <Your Data> Win32 Prog. IOC IOC ActiveX CAS EPICS Db EPICS Db <Your C++> CA Server CA Server CA Server CAS & CAC CA CA CA CA CA CA CA Client ArchiveEngine MEDM Epics CA Servers and Clients • CA Server:owns, creates, provides Channel • Client: can read/write Channel Access Network

  3. Purpose • Provide ChannelAccess Server (and Client) capability for Win32 Programs that’s • easier to use than raw CAC/CAS libraries • appeals to non-C/C++ programmers • Win32: MS Windows 98, NT, 2000 • Initial Motivation at LANL: • LabVIEW: • Existing, working subsystems needed remote display, archiving, ... • Suitable for not-too-big new projects,especially when drivers are included • Integrate via CA Server

  4. IDispatch IProcessVariable IDispatch IProcessVariable ActiveX, “Automation Server” • COM (Component Object Model) • Win32 Inter-Process-Communication API • Similar to Sun RPC, but for classes, not individual functions • COM ‘Classes’ expose ‘Interfaces’ (similar: Java interfaces, C++ pure virtual base classes) • OLE, ActiveX Control /Automation Server, ... • Numerous protocols, i.e. agreements to expose specific interfaces EpicsCAClient EpicsCAServer CA.DLL CAS.DLL

  5. EpicsCAServer.ProcessVariable • Properties • name: Has to be set to create the PV for ChannelAccess • units, precision, alarm_low, ...: Common EPICS properties • deadband: Only changes >= deadband will trigger monitors • enum_string(0,1,…) • Methods • SetLongValue (new_value as Long) • SetDoubleValue (newValue as Double) • SetEnumValue (new_value as Long):Check if corresponding enum_string exists • SetValue (new_value as Variant) • allowed: Scalar and Array (!) short, int, long, float, double, string • Events • Changed: Received for ChannelAccess ‘put’

  6. Visual Basic Example: • Required: • Set ‘name’ • call ‘Set*Value’ Dim PV As New EpicsCAServer.ProcessVariable PV.name = “Pi” PV.SetValue 3.14

  7. Visual Basic: Events Dim WithEvents PV As EpicsCAServer.ProcessVariable Private Sub Form_Load() Set PV = New EpicsCAServer.ProcessVariable PV.Name = "MyTestPV" PV.units = "Quirks" PV.SetDoubleValue 3.15 End Sub Private Sub PV_Changed(ByVal value_received As Variant) MsgBox ”Received " & value_received & " !" End Sub

  8. Excel Example: React to CA ‘Put’

  9. VB: Enumerated Types

  10. Time • PC clock  Time stamps for CA Server • Synchronization: “Tardis” Shareware Programhttp://www.kaska.demon.co.uk(S)NTP, time or daytime protocol • SNTP (RFC 2030): 1..50ms,timehost.lanl.gov: 10ms (30min updates) • Beware:Inter-IOC protocol doesn’t match any standard. • Assert Master Timing IOC uses same NTP server as PCs

  11. LabVIEW as a CA Server • LabVIEW 5.1 has basic ActiveX support:Open ActiveX reference, Set Parameter, Wait for Event, … • New ‘Virtual Instruments’:PV Init, Config, Set, Close,...

  12. LabVIEW: Simple Server

  13. LabVIEW: React to CA ‘put’ • CA ‘put <new value>’ ActiveX Event is sent with <new value> • The PV’s value will not change automatically!It’s up to you to • check for values • test them andeventually • reflect the changeby setting a new value!

  14. LabVIEW: Enumerated Types • EPICS: enumerated types have • an unsigned value 0, 1, 2, …. • a list of strings that describe each state • LabVIEW: • PVInitEnum.vi,create PV with a list of state strings • PVSetEnum.viset the numeric state, checking if state OK • PVSetBool.vi for boolean values(Should be generated as a two-state enum)

  15. EpicsCAClient • Similar: • EpicsCAClient.ProcessVariable, • Properties: name, is_connected, value, units, … • Event: NewValue • LabVIEW support: • PVOpen.vi, … • About to be used at LANL, but VIs might change when more experience is gathered

  16. Example: Web Pages • LabVIEW 5.1 • can be used as simple but “pretty” CA client • has HTTPD built-in • With CA Client:CA Data on the web(HTML page includes <IMG> link to LabVIEW’s HTTPD)

  17. LabVIEW Problems • ActiveX Events don’t work without patch from National Instruments’ web site • Ax Event leaves memory leak in LabVIEW 5.1. Version 6.0 is supposed to solve this. • LabVIEW sometimescrashes during setup ofActiveX connection(runs fine once this succeeds) • Deadband check,already handledin EpicsCAServer,doubled in LabVIEWfor better performance:

  18. Performance • Set new (double) value to be served: ~0.3ms (450Mhz Pentium II)

  19. Performance... (10 PVs @ 10, 100, 500 Hz on 450Mhz Pentium II)

  20. ‘EPICS’ data Conclusion Win32-Program with data worth serving, e.g. LabVIEW + ActiveX CA Server

More Related