Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
publishingEnabled: true,
requestedLifetimeCount: 1000,
requestedMaxKeepAliveCount: 100,
requestedPublishingInterval: 100,
};
const subscription = await session.createSubscription2(request);
const itemToMonitor: ReadValueIdOptions = {
attributeId: AttributeIds.EventNotifier,
nodeId: resolveNodeId("Server"), // i=2253
};
const fields = await extractConditionFields(session, "AcknowledgeableConditionType");
const eventFilter = constructEventFilter(fields, [resolveNodeId("AcknowledgeableConditionType")]);
const monitoringParameters: MonitoringParametersOptions = {
discardOldest: false,
filter: eventFilter,
queueSize: 100,
samplingInterval: 0,
};
const event_monitoringItem =
await subscription.monitor(itemToMonitor, monitoringParameters, TimestampsToReturn.Both);
const acknowledgeableConditions: EventStuff[] = [];
let refreshStartEventHasBeenReceived = false;
let RefreshEndEventHasBeenReceived = false;
publishingEnabled: true,
requestedLifetimeCount: 10000,
requestedMaxKeepAliveCount: 1000,
requestedPublishingInterval: 10,
};
const subscription = await session.createSubscription2(request);
_sessionPriv.$subscriptionforAlarmList = subscription;
const itemToMonitor: ReadValueIdOptions = {
attributeId: AttributeIds.EventNotifier,
nodeId: resolveNodeId("Server"), // i=2253
};
const fields = await extractConditionFields(session, "AlarmConditionType");
const eventFilter = constructEventFilter(fields, [resolveNodeId("AcknowledgeableConditionType")]);
const monitoringParameters: MonitoringParametersOptions = {
discardOldest: false,
filter: eventFilter,
queueSize: 10000,
samplingInterval: 0,
};
// now create a event monitored Item
const event_monitoringItem = ClientMonitoredItem.create(subscription, itemToMonitor, monitoringParameters, TimestampsToReturn.Both);
const RefreshStartEventType = resolveNodeId("RefreshStartEventType").toString();
const RefreshEndEventType = resolveNodeId("RefreshEndEventType").toString();
event_monitoringItem.on("changed", (eventFields: Variant[]) => {
const pojo = fieldsToJson(fields, eventFields) as EventStuff;