How to create a device alias?

Hi,
I would like to create an alias to access a device through a tool which does not accept dot character.

I red https://tango-controls.readthedocs.io/en/latest/development/general-guidelines/naming.html#device-and-attribute-name-alias and Feature request: Edit alias [1d] · Issue #104 · scientific-software-hub/waltz · GitHub. I understand well this last ticket is not jive doc but waltz doc (formerly webapp). However, it is the only way I found to add an alias so I hoped it should give it a try with jive.

Just in case, here is the steps I followed :

  • open sys/database/2 device
  • open command “DbPutDeviceAlias”
  • enter in line 0: “er/ca/rac05-elr.01-rdp1” (name of the device copy-paste from jive to avoid error)
  • enter in line 1 “redpitaya” (desired alias)
  • click on “execute” button
  • then I got the following error:
sys/database/2/DbPutDeviceAlias :
insufficient alias info fo device

Error:
---
Stack
+ DB_IncorrectArguments
  + Severity - ERROR
  + Origin - Database::db_put_device_alias()
  + Description - insufficient alias info for device
  + Reason - DB_incorrectArguments
+ TangoApi_CANNOT_EXECUTE_COMMAND
  + Severity - PANIC
  + Origin - Connection.command_inout()
  + Description - CAnnot execute command DbPutDeviceAlias on sys/database/2
  + Reason - TangoApu_CANNOT_EXECUTE_COMMAND
---

Trace:
---
fr.esrf.TangoApi.ConnectionFailed
 at
fr.esrf.TangoDs.Except.throw_connection_failed(Except.java:616)
fr.esrf.TangoDs.Except.throw_connection_failed(Except.java:569)
fr.esrf.TangoApi.ConnectionDAODefaultImpl.command_inout(ConnectionDAODefaultImpl.java:923)
fr.esrf.TangoApi.Connection.command_inout(Connection.java:375)
fr.esrf.tangoatk.core.Device.executeCommand(Device.java:747)
fr.esrf.tangoatk.core.command.ACommand.execute(ACommand.java:546)
fr.esrf.tangoatk.widget.command.AnyCommandViewer.commandInputPropertyChange(AnyCommandViewer.java:334)
fr.esrf.tangoatk.widget.command.AnyCommandViewer.access$300(AnyCommandViewer.java:46)
fr.esrf.tangoatk.widget.command.AnyCommandViewer$_cls1.propertyChange(AnyCommandViewer.java:522)
java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327)
java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
java.awt.Component.firePropertyChange(Component.java:8428)
fr.esrf.tangoatk.widget.command.ArrayCommandInput.executeButtonActionPerformed(ArrayCommandInput.java:98)
fr.esrf.tangoatk.widget.command.ArrayCommandInput.access$000(ArrayCommandInput.java:37)
fr.esrf.tangoatk.widget.command.ArrayCommandInput$1.actionPerformed(ArrayCommandInput.java:83)
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
java.awt.Component.processMouseEvent(Component.java:6533)
javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
java.awt.Component.processEvent(Component.java:6298)
java.awt.Container.processEvent(Container.java:2238)
java.awt.Component.dispatchEventImpl(Component.java:4889)
java.awt.Container.dispatchEventImpl(Container.java:2296)
java.awt.Component.dispatchEvent(Component.java:4711)
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4897)
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4534)
java.awt.LightweightDispatcher.dispatchEvent(Container.java:4475)
java.awt.Container.dispatchEventImpl(Container.java:2282)
java.awt.Window.dispatchEventImpl(Window.java:2746)
java.awt.Component.dispatchEvent(Component.java:4711)
java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
java.awt.EventQueue.access$500(EventQueue.java:97)
java.awt.EventQueue$3.run(EventQueue.java:709)
java.awt.EventQueue$3.run(EventQueue.java:703)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
java.awt.EventQueue$4.run(EventQueue.java:733)
java.awt.EventQueue$4.run(EventQueue.java:731)
java.security.AccessController.doPrivileged(Native Method)
java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
---

Could you help me with this?
Thanks.

Hi Philippe,

I never really played with aliases but I think you can do it from jive simply by right-clicking on a device node and by selecting “Define device alias” right-click menu item.

About the error reported by the Database server, it looks like this error is returned when the length of the DevVarStringArray passed in argument to DbPutDeviceAlias command is < 2.
So it looks like there was a problem in the transmission of your DevVarStringArray parameters…
What did you use to send this command? AtkPanel?

I hope this helps,

Kind regards,
Reynald

Hi Reynald, thank you for your answer.

[quote=“Reynald”]Hi Philippe,

I never really played with aliases but I think you can do it from jive simply by right-clicking on a device node and by selecting “Define device alias” right-click menu item.
[/quote]
If I understand well, this should display the alias in the “Alias” tab of jive.
I tried to create “redpitaya” device alias but nothing is displayed into this tab so I understand I missed something… :s

Yes, I opened AtkPanel through jive.
When reading TangoDatabase/DataBase.cpp at main · tango-controls/TangoDatabase · GitHub I understood 1st parameter Str[0] should be “device name” while 2d parameter should be “device alias”. I do not understand what should be added as argin (which would be a third parameter if I understand the DbPutDeviceAlias method).

If you confirm DbPutDeviceAlias is the good method to use to add a device alias, then I will continue with an issue on GitHub - tango-controls/TangoDatabase.
Thank you for these bits of information.

Regards.

Hi Philippe :slight_smile:

An easy way to define an alias is to open Jive. Deploy the tree until your server instance (“er/ca/rac05-elr.01-rdp1” in your case), and then right click on it. Normally, you should see “Define Server Alias”. Put the alias you want, and then it shall appear on the “Alias Tab” after refresh.

On jive, if you open an ATK on the databaseDS, and you execute command, you should send parameter as follow :

[“er/ca/rac05-elr.01-rdp1”,“myNewAlias”]

This works on my base.

Hope it helps :slight_smile:

Regards,

Florian Pourchayre
Thales Group

Thank you for your answer Florian.
In fact, it seems it took a while to appear but my alias is here.
Thanks to both Florian and Reynald. :slight_smile: