6.2 Components of a Vending Machine
6.2.1 Machine engine
The machine engine is the device able to create or deliver or collect a given product. It interacts with the UI, the payment service, and the audit collect. It interacts with the customer by physically providing the product to the customer. It provides information to monitor the Vending Machine. A Vending Machine according to this specification needs to support at least one machine engine, but may have several machine engines as components. A machine engine cannot be assigned to more than one Vending Machine, i.e., it can only be used by one payment service.
The machine engine provides its interface by implementing an instance of the MachineEngineType (shown in Figure 10, defined in 7.1). The machine engine does not require OPC UA Client functionality to access other components of the Vending Machine.

The MachineEngineType provides the identification of the machine engine in the Identification Object, defined in OPC 10000-100. The configuration of the machine engine is provided by the Configuration Object of BaseConfigurationType defined in 7.3. The configuration may be writable via the OPC UA interface to change the configuration of the machine engine. The machine engine provides the configuration for the UI in the Capabilities Object of MachineEngineCapabilitiesType defined in 7.5. The configuration is accessed by the UI and parts may be writable to change the configuration of the UI. The Delivery Object of MachineEngineDeliveryType defined in 7.6 provides functionality to request a delivery (by the payment service) as well as expose the status of the delivery (displayed by the UI). The Status Object of MachineEngineStatusType defined in 7.7 provides the overall status of the machine engine, to be displayed in the UI and consumed by the payment service. The optional Components Object of BaseComponentsType defined in 7.4 can provide information about subcomponents of the machine engine. The machine engine generates Events of VendingBaseAuditEventType to provide audit data.
6.2.2 Payment service
The payment service is responsible to approve product delivery, for example by receiving coins or charging a credit card or any other needed condition for the delivery of a product, like age. It is also responsible of all money movements between the different payment devices, like using cash to revalue a card system, handling change or overpay. It interacts with the UI, the machine engine, the audit collect and the price service. It may interact with the customer, for example by physically collecting coins or bills or scanning a credit card. It provides information to monitor the Vending Machine. A Vending Machine according to this specification supports exactly one payment service.
The payment service provides its interface by implementing an instance of the PaymentServiceType (shown in Figure 11, defined in 7.8). The payment service requires OPC UA Client functionality to access the machine engine(s) and the primary price service of the Vending Machine.

The PaymentServiceType provides the identification of the payment service in the Identification Object, defined in OPC 10000-100. The configuration of the payment service is provided by the Configuration Object of BaseConfigurationType defined in 7.3. The configuration may be writable via the OPC UA interface to change the configuration of the payment service. The Delivery Object of PaymentServiceDeliveryType defined in 7.9 provides functionality to request a delivery (by the UI) as well as expose the status of the payment of the delivery (displayed by the UI). The PriceInformation Object of PriceInformationType defined in 7.11 provides price information for deliverables of products of machine engines manged by the payment service. The PaymentModes Object of PaymentModesType defined in 7.13 provides information about the different payment systems supported by the payment service and their status, having on Object of PaymentModeType defined in 7.14 per payment system. The Status Object provides the overall status of the payment service defined in 7.22. The optional Components Object of BaseComponentsType defined in 7.4 can provide information about subcomponents of the payment service. The payment service generates Events of VendingAuditEventType to provide audit data.
The payment service receives price information from the primary price service of the Vending Machine using the PriceInformation Object of the price service. It is up to the implementation of the payment service whether the requests of the UI about price information is always forwarded to the price service, or cached in the payment service.
The payment service will need to interface to any other device which can affect the delivery, and these devices are payment devices. Payment service will provide the UI with enough information from the payment devices to define the payment, but the detailed implementation of the process is internal to payment service. It is also possible (and for sure will happen in the transition phase before OPC UA compliant payment devices will be available, the payment service will handle internally legacy coin, bills, cashless devices using proprietary protocols. When this happens, payment service has to act relative to audit collect to provide, in a way which is in line with this specification, all the required information.
But, with OPC UA compliant payment devices, the payment service is responsible only for the delivery approval but not for the effective handling of other payment device related data, like audit and configuration. There is a specific configuration Property (IsEmulated) used to expose if the payment service is internally handling the payment device, or if an OPC UA enabled payment device is available, enabling direct access to payment device configuration and audit events.
The IsEmulated Property enable easy switch for the need, today, to handle MDB (and other legacy protocols) before fully switch to OPC UA compliant devices.
The payment service may supervise the audit collect for operation and reject new requests when the audit collect is not operating correctly using the IsCollectingAudit Variable of the AuditCollectType.
6.2.3 Standalone Payment Devices
As stated in 6.2.2, a payment device may be managed in a proprietary manner by the payment service. A standalone payment device is a payment device, that has a standardized OPC UA Server. It is responsible to receive money, either via a physical asset (coin, bill, or token), as a payment cash device, or cashless as a payment cashless device. It provides the information about the received money and mechanisms to payout money. It interacts with the payment service and the audit collect. A Vending Machine according to this specification may have zero to many standalone payment devices.
As there are different types of payment devices, the type hierarchy is shown in Figure 12.
The standalone payment device provides its interface by implementing an instance of a subtype of the StandalonePaymentDeviceType (shown in Figure 12, defined in 7.17), which is an abstract subtype of the PaymentDeviceType used in the payment service. The standalone payment device does not require OPC UA Client functionality.

The PaymentDeviceType provides the identification of the payment device in the Identification Object, defined in OPC 10000-100. The configuration of the standalone payment device is provided by the Configuration Object of BaseConfigurationType defined in 7.3. The optional Components Object of BaseComponentsType defined in 7.4 can provide information about subcomponents of the standalone payment device. The payment device generates Events of VendingAuditEventType to provide audit data.
The abstract PaymentCashDeviceType defined in 7.18 defines common functionality for cash-based payment devices like the supported assets and the capability to payout cash. The concrete PaymentCoinDeviceType defined 7.19 represents standalone payment devices handing coins and / or token, with no additional functionality. The concrete PaymentBillDeviceType defined in 7.20 represents standalone payment devices handling bills and / or token, and provides additional functionality like cancelling the payout. The concrete PaymentCashlessDeviceType defined in 7.21 represents standalone payment devices handling cashless money, and provide the corresponding functionality.
6.2.4 UI
The UI (user interface) is the interface between the customer and the system. The UI is only related to the final customer interaction. Technical user interfaces for configuration or maintenance of the machine are not part of this component and not addressed by this specification. A Vending Machine according to this specification needs to have at least one UI, but may have several UIs.

The UI provides its interface by implementing an instance of the UIType (shown in Figure 13, defined in 7.23). The UI requires OPC UA Client functionality to access the payment service and the machine engine(s) of the Vending Machine. The optional Components Object of BaseComponentsType defined in 7.4 can provide information about subcomponents of the UI. The UI generates Events of VendingBaseAuditEventType to provide audit data.
The UI receives the configuration of the Vending Machine by accessing the Machine Engine capabilities specific to a machine engine from the machine engine(s) of the Vending Machine by accessing the Capabilities Object of MachineEngineCapabilitiesType defined in 7.5. This includes the available selections and possible Options per selection. The availability of the selections is provided by the Status Object of MachineEngineStatusType defined in 7.7. The Delivery Object of MachineEngineDeliveryType defined in 7.6 expose the status of a delivery.
The UI receives price information for the selections as well as payment options provided by the payment service of the Vending Machine by accessing the PriceInformation Object of PriceInformationType defined in 7.11. A deliver request is triggered on the Delivery Object of PaymentServiceDeliveryType defined in 7.9.
6.2.5 Price service
The price service calculates the price of a selection of products and considers all discounts. Discounts may be gained on various vendor-specific options, like time of the day, expiry date of the product, availability of product, customer and discount programs, etc. A Vending Machine according to this specification needs to have access to exactly one price service. This price service may internally use other price services (see Annex B).
The price service provides its interface by implementing an instance of the PriceServiceType (shown in Figure 14, defined in 7.24). The price service does not require OPC UA Client functionality to access other components of the Vending Machine.

The PriceServiceType provides the identification of the payment service in the Identification Object, defined in OPC 10000-100. The configuration of the payment service is provided by the Configuration Object of BaseConfigurationType defined in 7.3. The configuration may be writable via the OPC UA interface to change the configuration of the payment service. The PriceInformation Object of PriceInformationType defined in 7.11 provides price information for deliverables of products potentially provided by various Vending Machines. The optional Components Object of BaseComponentsType defined in 7.4 can provide information about subcomponents of the payment service.
6.2.6 Audit collect
The audit collect collects audit data from all components providing audit Events and makes them available for external access. A Vending Machine according to this specification supports exactly one audit collect, and in addition optionally one tax audit (see 6.2.7).

The audit collect provides its interface by implementing an instance of the AuditCollectType (shown in Figure 15, defined in 7.25). The optional Components Object of BaseComponentsType defined in 7.4 can provide information about subcomponents of the audit collect. The audit collect requires OPC UA Client functionality to access audit information of the payment service, the standalone payment devices, the UI(s) and the machine engine(s) of the Vending Machine.
6.2.7 Tax audit
A special case of the audit collect is the TAX audit, which is selecting all tax relevant information of the audit information. This component is implemented according to the tax regulations of the area the Vending Machine is operating, and receives and processes all tax relevant information.
It provides and uses the same interfaces as the audit collect (see 6.2.6), but filters the audit Events to those relevant for the tax regulations. Depending on the tax regulations, different audit Events may be relevant.
In the following sections, the tax audit is included when an audit collect component is referenced.