Scope of this guide
This will show you how to access a database of devices so you can use them to run tests with simulacrum services (Simulating PVs 1: caget and caput) or to help you look up attributes on tao (Using tao_shell.py).
Background
The Oracle database is a great resource for looking up devices in a pinch! You won't find any modelling attributes like gradient or amplitude, but you'll find the names of all kinds of devices that you can access with tao. I use this database when I'm trying to run a service and I need an example device to test the input/output capabilities of that service. The tao_shell guide gives another option for looking up devices, but I find that this webpage is the simplest option in 80% of my situations!
Instructions
- Open up the Oracle database by opening this link in a new tab: https://oraweb.slac.stanford.edu/apex/slacprod/f?p=116:600:6961903436339
- Log in with your SLAC credentials
You should see a page like this!
Fig. 1: Oracle home page
The filter feature allows you to sort by system properties to find the device you want! You can sort by any method you prefer, but I tend to rely on 3 main filters: beampath, element, and control system name.
- Locate the "Actions" button to the right of the search bar. On the dropdown menu, select "Filter"
Fig. 2: Locating the filter feature!
"Beampath" is one filter I always turn on when I'm looking for a specific device for simulacrum. Remember that the model service in simulacrum allows you to choose devices in cu_hxr, sc_hxr, etc. We only want to see devices that belong to the same beampath as our model service!
- Set "Column" to "Beampath"
- Set "Operator" to "contains" (the "=" operator can be buggy)
- Set "Expression" to the same beampath as your model service. I'm using CU_HXR here. You'll have to type this part in manually, there won't be a dropdown.
Fig. 3: Filtering for our beampath.
Now, you should see all devices in your desired beampath come up in the search results. If you want to filter for one type of device (e.g., the device your service is modeling), then I typically filter again using either the "control system name" or the "element". If I want to find all BPMs, I might ask the database for all control system names that contain "BPM".
Fig. 4: Trying to look up cu_hxr bpms
It may take some trial and error. Sometimes the device you're looking for has multiple naming conventions. Luckily, simulacrum can give you some clues about what to search for. Every simulacrum service has a line that sends a tao command to fetch a list of device names. For the BPM service, it looks something like this:
Fig. 5: Lines 64-65 of the bpm service.
By reading the bpm service, I know that I should have searched by the "element" property, not the "control system name", since the element is what the service itself is using to pick and choose its devices. To avoid picking devices that aren't modeled by our service, I can apply either (not both) filters to get some devices that the service will recognize:
- Element contains BPM
- Element contains RFB
We cannot apply both filters at once because there are no elements that contain both of these expressions. However, either set should give you viable devices to use in your tests. If you want to know how you can play around with a modeled device, check out the article Simulating PVs 1: caget and caput.