Access Control Overview
Step by step guide for plug-in development
Design topics before you start coding
Here is a list of topics that we suggest you consider before getting too much into the implementation phase:
- How should the access control system configuration be exposed to MIP AC?
- What parameters are needed when the plug-in establishes a connection to the access control system?
- What states should each unit expose?
- What icons to use, either built-in, own, or a mix for each state?
- What events to expose to ACM? Usually all states are exposed, and categories are made to make configuration easier.
- Are there any new event categories to be defined?
- How to get and populate cardholder information?
- What commands should be exposed to ACM?
- Can one plug-in cover what is needed, or are multiple plug-ins needed? This can be a requirement if multiple generations of an access control system need to be supported and the protocols to these are incompatible. (Multiple plug-ins can be in one dll or in separate dll’s)
- Event Server executes in 64-bit mode: Any use of C++ library dll needs to be compiled for 64-bit.
A couple of hints:
- The access control system may fire events from a controller, a door or a specific sub device on the door. As a door could have 2 access points – consider which source makes the most sense in ACM. You can install (copy) and check out one of the samples that comes with MIPSDK to review usage of events within Smart Client and Management Client.
- The ACM comes with a set of built-in icons. Consider to use these when possible.
- If the access control system has a larger set of doors, a 1-to-1 mapping makes sense, but if each door is its own controller – then it may make sense to combine a set of these into a ‘system’ (if they e.g. know their neighbors). Be aware that cardholder information and pictures are not shared across ACServers.
Start coding
Start by creating a new project based on the AccessControl template. This template will create the 10 key classes you need to work with, including generating specific guids and class names.
Select the “Visual C#” template node on the left and the “MIPAccessControl” on the right.
Please consider your “Name” careful, as it gets inserted many places in class names and the code (do not use . or any special characters).

When the following functionality shown above has been created, you get this project:

The project must reference the VideoOS.Platform.AccessControl.dll, but should not need to reference anything else from the MIPSDK.
We have added an ISystem.cs class to the template that is not really part of the AC-classes per se, but is convenient to have for referencing classes across your project.
MIP-AC Flow and calling sequences
Below, a drawing showing how events are flowing from the access control system on the left hand side and handled by MIP-AC towards the right hand side.

A simple access controller with one door and 2 access points could be represented within MIP-AC with the following classes:

Deployment
You must install, or copy, the compiled DLL(s) together with your acplugin.def file on the machine running the XProtect Event Server.
The acplugin.def file is similar to the plugin.def used by the general MIP Environment.
Sample:
<plugin>
<file name="DemoAccessControlPlugin.dll"/>
<load env="Service"/>
</plugin>
Install the files at:
C:\Program Files\Milestone\MIPPlugins\”your-plug-in-name”
Or, to support future OEM versions of the XProtect software, at:
C:\Program Files\VideoOS\MIPPlugins\”your-plug-in-name”
Debugging
Enable Development panel in the Management Client.

When the above tick mark has been checked. A set of extra tabs become available with detailed information on the configuration the AC-plugin has returned, and real time display of events and states.
You can use this option at customer site, if issues should arise that needs deep understanding.

The extra tabs all start with “DEV:” to identify that they are for development purpose and that the UI are for developers and not for administrators.
Logs
To log entries in the text log file, please use the built-in ACUtil.Log( ... ) method.
The result is located in the following folder:
C:\ProgramData\Milestone\XProtect Event Server\logs
Sample log entries:
2013-09-06 14:54:03 UTC+02:00 Error AccessControlSystem The state from 'Door Reception' contains the unknown state type id 'Unknown'. The state type will be ignored.
2013-09-06 14:54:13 UTC+02:00 Error AccessControlSystem Unable to handle EventOccurred event from access control system plugin. Event source not licensed. Id: 13507552-d8e1-22d4-cf49-2b8db34bbb87