Presentation is loading. Please wait.

Presentation is loading. Please wait.

‘ActiveX’ CA Server (… and Client) Oct. 2000 Kay-Uwe Kasemir, LANL.

Similar presentations


Presentation on theme: "‘ActiveX’ CA Server (… and Client) Oct. 2000 Kay-Uwe Kasemir, LANL."— Presentation transcript:

1 ‘ActiveX’ CA Server (… and Client) Oct. 2000 Kay-Uwe Kasemir, LANL

2

3 Epics CA Servers and Clients Channel Access Network Archive Engine CA IOC EPICS Db CA CA Server MEDM CA CA Client IOC EPICS Db CA CAS & CAC CA Server: owns, creates, provides Channel Client: can read/write CA CA Server CA CA Server Win32 Prog. ActiveX CAS

4 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 4Integrate via CA Server

5 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 CA.DLL EpicsCAServer CAS.DLL IDispatchIProcessVariableIDispatchIProcessVariable

6 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’

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

8 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

9 Excel Example: React to CA ‘Put’

10 VB: Enumerated Types

11 Time PC clock  Time stamps for CA Server Synchronization: “Tardis” Shareware Program http://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

12 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,...

13 LabVIEW: Simple Server

14 LabVIEW: React to CA ‘put’ CA ‘put ’  ActiveX Event is sent with The PV’s value will not change automatically! It’s up to you to –check for values –test them and eventually –reflect the change by setting a new value!

15 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.vi set the numeric state, checking if state OK –PVSetBool.vi for boolean values (Should be generated as a two-state enum)

16 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

17 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 link to LabVIEW’s HTTPD)

18 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 sometimes crashes during setup of ActiveX connection (runs fine once this succeeds) Deadband check, already handled in EpicsCAServer, doubled in LabVIEW for better performance:

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

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

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


Download ppt "‘ActiveX’ CA Server (… and Client) Oct. 2000 Kay-Uwe Kasemir, LANL."

Similar presentations


Ads by Google