labrad / pylabrad

python interface for labrad
52 stars 31 forks source link

Signals vs. Named Messages #218

Open roboguy222 opened 8 years ago

roboguy222 commented 8 years ago

The wiki has a nice tutorial on signals, but a lot of the servers (gpib_server.py and gpib_device_manager.py, for example) use "named messages" instead of signals, it seems. What is the difference, and when should one use each?

In upgrading from delphi labrad manager to the newer scalabrad, I noticed these named messages did not seem to be working anymore in my servers. It is entirely possible that I did something wrong, but I also noticed that the old Explorer, while mostly working with the new scalabrad, does not update the connected servers as more are opened. I am guessing this is because these named messages indicating new servers are not getting through for some reason. Any ideas?

ejeffrey commented 8 years ago

Named messages are more like global broadcasts, and don't require the client and server to directly know about each other. For instance, multiple servers (serial, GPIB) can provide "new device available" signals without the GPIB device manager having to know about each possible server.

Regular signals are typically only of interest to one particular client, usually one specific context. For instance, the datavault sends a signal when new data is added to a dataset that the grapher application has open which lets is know to fetch the rest of the data. The signal is specific to the context or contexts that have that particular dataset open. Other contexts may be listening for changes to different datasets, so a general notification is not appropriate.

I believe that matthew made the named signals case sensitive in scalabrad, that is almost certainly the problem you are having.

On Thu, Feb 18, 2016 at 4:32 PM, Chris Wilen notifications@github.com wrote:

The wiki has a nice tutorial on signals, but a lot of the servers (gpib_server.py and gpib_device_manager.py, for example) use "named messages" instead of signals, it seems. What is the difference, and when should one use each?

In upgrading from delphi labrad manager to the newer scalabrad, I noticed these named messages did not seem to be working anymore in my servers. It is entirely possible that I did something wrong, but I also noticed that the old Explorer, while mostly working with the new scalabrad, does not update the connected servers as more are opened. I am guessing this is because these named messages indicating new servers are not getting through for some reason. Any ideas?

— Reply to this email directly or view it on GitHub https://github.com/labrad/pylabrad/issues/218.

ejeffrey commented 8 years ago

Should add @maffoo

I don't think anyone here has used the Explorer in years. If you find it useful, I am happy to try and dig up the source code and fix the signal names. It is also possible that explorer is not using the named messages -- they were added to the protocol later, so some of the oldest software still uses signals for new server notification.

On Thu, Feb 18, 2016 at 6:26 PM, Evan Jeffrey hobbes@permutationcity.net wrote:

Named messages are more like global broadcasts, and don't require the client and server to directly know about each other. For instance, multiple servers (serial, GPIB) can provide "new device available" signals without the GPIB device manager having to know about each possible server.

Regular signals are typically only of interest to one particular client, usually one specific context. For instance, the datavault sends a signal when new data is added to a dataset that the grapher application has open which lets is know to fetch the rest of the data. The signal is specific to the context or contexts that have that particular dataset open. Other contexts may be listening for changes to different datasets, so a general notification is not appropriate.

I believe that matthew made the named signals case sensitive in scalabrad, that is almost certainly the problem you are having.

On Thu, Feb 18, 2016 at 4:32 PM, Chris Wilen notifications@github.com wrote:

The wiki has a nice tutorial on signals, but a lot of the servers (gpib_server.py and gpib_device_manager.py, for example) use "named messages" instead of signals, it seems. What is the difference, and when should one use each?

In upgrading from delphi labrad manager to the newer scalabrad, I noticed these named messages did not seem to be working anymore in my servers. It is entirely possible that I did something wrong, but I also noticed that the old Explorer, while mostly working with the new scalabrad, does not update the connected servers as more are opened. I am guessing this is because these named messages indicating new servers are not getting through for some reason. Any ideas?

— Reply to this email directly or view it on GitHub https://github.com/labrad/pylabrad/issues/218.

roboguy222 commented 8 years ago

I would not make the Explorer a high priority, but I do sometimes like it for debugging.