Perspective Vibration / Notification

#1

Say you have a system running vision clients at the production line and operators running perspective sessions on iPhones.

Say an alarm was to become active on the production line. How would one use system.perspective.VibrateDevice to the operator of that lines device.

The manual seems to indicate that it must be invoked from the device.

Is it possible for the vision client / gateway to communicate out to the perspective session to invoke this?

0 Likes

#2

You can use system.util.sendMessage to send a message from the gateway to Perspective sessions and then use a message handler in Perspective to vibrate the device. On the other hand, you could probably do this without the message by having Perspective look at the alarm status.

0 Likes

#3

One way to do this is to add a tag Event Script.

  • Select the tag you want to vibrate a device when the Tag’s configured alarm becomes active.
  • Right-click the tag and select Edit Tag.
  • Scroll down to Tag Events and select the pencil/edit icon.
  • Select Alarm Active under Alarm Events.
  • Provide a script along the lines of:
# note: system.util.sendMessage, NOT system.perspective.sendMessage
system.util.sendMessage('<project_name', messageHandler='ALARMACTIVE', payload={'tagName': tag.name},scope='S')
  • Commit the script and save changes to the alarm.
  • In the Designer Menu, select Project.
  • Select Session Events.
  • From the Session Event types, select Message.
  • Click the “+” icon and supply ALARMACTIVE for the Message Handler name
  • Supply a script here like:
system.perspective.vibrateDevice(sessionId=session.id)

Note that this will only work if the device is using the Perspective application to launch the session; mobile devices using a generic browser do not have access to this functionality.

0 Likes