Skip to main content
U.S. flag

An official website of the United States government

Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Sample Changer Panel

sample_changer_example
Credit: Steve Pheiffer

Introduction

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.

sample_changer_example
Credit: Steve Pheiffer

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.

Buttons

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)

Offset Sample Block – SANS Instruments ONLY

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

File operations

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

Slot and Sample Linking

A picture of the sample changer panel
An image of the sample changer panel in Candor
Credit: Adeniyi Fawaz Joseph

The node sampleID.slotLink defines the association between sampleID and slotID

There are three possible values for the slotLink:

  • BOTH – In this mode, when the sampleID node is moved, slotID will follow it, and vice-versa. In the example above, moving sampleID to <X> will change slotID to <Y> and moving slotID to <M> will change sampleID to <N>.
  • MOVE_ONLY – In this mode, when the sampleID node is moved, slotID will follow it, but when directly moving slotID, the sampleID node is left unchanged. This provides more flexibility when doing non-standard sample management.
  • NONE – In this mode, sampleID and slotID have no interaction. When selected, the Sample ID column will disappear. Note: SANS instruments permanently operate in NONE mode and it cannot be changed.

Appendix

Panel Setup

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.

The Install Devices Panel with the sample-changer config installed
The Install Devices Panel with the sample-changer config installed
Credit: Adeniyi Fawaz Joseph

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.

The nodes key in the config file that defines a sample changer
The nodes key of a config file defining the sample changer
Credit: Adeniyi Fawaz Joseph

Slot Link Details

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”).

Examples

Let’s take this table state for example

A state of the Sample Changer Table to illustrate the behavior of slotLink
Credit: Fawaz Joseph
User InputResult
User moves sample Id to 5

The slot moves to 3, which moves

  1. sample: 1
  2. chamberRotation: 14.0
  3. chamberTranslation: 0.0054
  4. huberElevation: 0
  5. huberRotation: 5.150
  6. huberTranslation: 10
sampleID to 6Device model errors out, because sample 6 is not associated with any slot
User read sampleID, slotID is currently 3Sample Id is 3
User reads sampleID, slotID’s validity is BADsampleID’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

MOVE_ONLY

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.

Examples
A state of Sample Changer Table to illustrate the behavior of the slotLink mode: MOVE_ONLY
Credit: Fawaz Joseph
User InputResult
User moves sample Id to 5The slot moves to 3, which moves chamberRotation to -6 degrees.
User moves sampleID to 6Devices model errors out, because sample 6 is not associated with any slot.
User read sampleIDsampleID will be 4

NONE

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

Created April 17, 2025, Updated July 17, 2025
Was this page helpful?