Some instruments provide the capability to mechanically change which sample is in the beam, by moving motors. The sample changer panel allows you define a mapping between sample-slots (locations where samples can be placed/mounted) and the positions of motors or other higher-level nodes. The sample-slot, which is currently in the beam, is represented by the slotID node and this can optionally be associated with samples defined in the Sample Table Panel (see the Slot and Sample Linking section for more details).
Here is an example of what the panel might look on an instrument with a linear motor named sampleMotor, which controls which slot is in the beam. In this case, slotID 1 is mapped to sampleMotor=5mm and slotID 2 is mapped to sampleMotor=12mm.
This instrument’s sampleMotor is at 4.98mm, which is within the motor’s tolerance of 5mm and thus slotID has a value of 1. The user has designated that “Sample-X” is in slot with ID 1. Note: Sample-X is a user-defined sample from the Sample Table Panel.
Slot/Sample Table
This table defines the mapping between slotID and nodes. The first column of the table will always be SLOT ID and its value will always correspond to the row of the table. The next column will be Sample ID, unless the slotLink node is set to None, in which case it will be hidden. Following will be all the motors and nodes which have been designated as related to sample-slot control on this instrument.
Note: Two rows cannot have the same Sample ID value.
Move to Selected SlotID
Moves the slotID node to the value of the currently selected row.
Redefine Slot to Current Node Position
Update the selected row with the current values of the nodes the columns represent
Add Slot
Adds a row to the table, the default value of the rows will be the current node values
Copy Slot
Copy the selected row(s) and appends the copies to the end of the table
Move Slot Up/Move Slot Down
Rearrange the selected row accordingly. You can also use the cursor to drag the rows in place.
Delete Slot
Delete the current row(s)
Clear Table
Clear the table and the current file loaded (if any)
Copies all the slots to the end of the table with the specified horizontal offset number added to the node value of the copied slot
Save
Save the current table to a file (if there is no file, you will be asked to create one). The file is added to the Recent Files drop down box
Save As…
Save the current table to a new file. The file is added to the Recent Files combobox
Load
Load the selected file in the combo box
Delete File
Delete the selected file in the combo box, Right click to just remove the file name from the combo box (This will not delete the actual file)
Load File…
Load a new file from the server. The file is added to the Recent Files combobox
The node sampleID.slotLink defines the association between sampleID and slotID
There are three possible values for the slotLink:
The sample changer table is only visible if sample changer is installed. Additionally, the columns in the table can be configured via add/removable configuration file (e.g. sample-changer.cfg)
Sample-changer can be installed if configuration file exists.
sample_changer.cfg includes a map with a unique nodes key. It lets you specify which columns (devices/nodes) can be controlled by each slot.
NOTE: Always include tolerance node if you are including a position node, so the panel can figure out if the position node is where it needs to be.
BOTH
Both SampleID and slotID affects each other. When you move sampleID and there is a corresponding slot in the table, it will also move slotID to that slot. If there is no slotID match to a sampleID, there will be an error.
Likewise, sampleID value is determind by slotID.
If slotID validity is BAD, then sampleID is BAD, otherwise sampleID is the associated sample for the slot id current value. If the slot has no sample, then the sample ID is 0 (0 is reserved for “no sample”).
Let’s take this table state for example
User Input | Result |
---|---|
User moves sample Id to 5 | The slot moves to 3, which moves
|
sampleID to 6 | Device model errors out, because sample 6 is not associated with any slot |
User read sampleID, slotID is currently 3 | Sample Id is 3 |
User reads sampleID, slotID’s validity is BAD | sampleID’s validity is BAD |
User reads sampleID, slotID is current 4 | There is no sample attached to slot 4 sampleID is 0 |
User move slotID to 3 from 2 User read sampleID | There is a Sample ID column associated with row 2:2 sampleID is 2 |
sampleID affects slotID, but not the other way around. When you move sampleID and there is a corresponding slot in the table, it will also move slotID to that slot. If there is no slotID match to a sampleID, there will be an error.
User Input | Result |
---|---|
User moves sample Id to 5 | The slot moves to 3, which moves chamberRotation to -6 degrees. |
User moves sampleID to 6 | Devices model errors out, because sample 6 is not associated with any slot. |
User read sampleID | sampleID will be 4 |
sampleID and slotID are fully independent nodes. A move on one node doesn’t affect the other.
This will also hide the Sample ID column in the table