diff --git a/iocBoot/iocCygwin/auto_settings.req b/iocBoot/iocCygwin/auto_settings.req
index 5219a6dff6bd4f6cde2e0482de8ce366d48d221c..1b8621c114620cc0d971ffda8b4a592b9a4b2114 100644
--- a/iocBoot/iocCygwin/auto_settings.req
+++ b/iocBoot/iocCygwin/auto_settings.req
@@ -50,3 +50,6 @@ file auto_4step_settings.req P=$(P),Q=4step
 
 file userAve10_settings.req P=$(P)
 
+# orientation matrix
+#file orient_settings.req P=$(P),O=1
+#file orient_xtals_settings.req P=$(P),O=1
diff --git a/iocBoot/iocCygwin/orient_xtals.substitutions b/iocBoot/iocCygwin/orient_xtals.substitutions
new file mode 100644
index 0000000000000000000000000000000000000000..c27a48328cdedb6f7ae3bdf86439d921a8c8e5ac
--- /dev/null
+++ b/iocBoot/iocCygwin/orient_xtals.substitutions
@@ -0,0 +1,15 @@
+file "$(OPTICS)/opticsApp/Db/orient_xtals.db"
+{
+pattern
+{P, O, PREC, N, xtal, a, b, c, alpha, beta, gamma}
+{xxx:, 1, 4, 1, Silicon, 5.431, 5.431, 5.431, 90, 90, 90}
+{xxx:, 1, 4, 2, "Beryllium hcp", 2.2858, 2.2858, 3.5843, 90, 90, 120}
+{xxx:, 1, 4, 3, VO2, 5.743, 4.517, 5.375, 90, 122.6, 90}
+{xxx:, 1, 4, 4, undefined, 1, 1, 1, 90, 90, 90}
+{xxx:, 1, 4, 5, undefined, 1, 1, 1, 90, 90, 90}
+{xxx:, 1, 4, 6, undefined, 1, 1, 1, 90, 90, 90}
+{xxx:, 1, 4, 7, undefined, 1, 1, 1, 90, 90, 90}
+{xxx:, 1, 4, 8, undefined, 1, 1, 1, 90, 90, 90}
+{xxx:, 1, 4, 9, undefined, 1, 1, 1, 90, 90, 90}
+{xxx:, 1, 4, 10, undefined, 1, 1, 1, 90, 90, 90}
+}
diff --git a/iocBoot/iocCygwin/st.cmd b/iocBoot/iocCygwin/st.cmd
index e895a94d4f55fc7290ff2412174bf7ab71efee42..fc0dbe80ef04a3117aa6382470c14307d0032ff9 100644
--- a/iocBoot/iocCygwin/st.cmd
+++ b/iocBoot/iocCygwin/st.cmd
@@ -96,6 +96,10 @@ dbLoadRecords("$(OPTICS)/opticsApp/Db/table.db","P=xxx:,Q=Table1,T=table1,M0X=m1
 #dbLoadRecords("$(OPTICS)/opticsApp/Db/hrSeq.db","P=xxx:,N=1,M_PHI1=m9,M_PHI2=m10")
 #dbLoadRecords("$(OPTICS)/opticsApp/Db/hrSeq.db","P=xxx:,N=2,M_PHI1=m11,M_PHI2=m12")
 
+### Orientation matrix, four-circle diffractometer (see seq program 'orient' below)
+#dbLoadRecords("$(OPTICS)/opticsApp/Db/orient.db", "P=xxx:,O=1,PREC=4")
+#dbLoadTemplate("orient_xtals.substitutions")
+
 # Load single element Canberra AIM MCA and ICB modules
 #< canberra_1.cmd
 
@@ -154,6 +158,9 @@ seq &Keithley2kDMM,("P=xxx:, Dmm=D1, channels=22, model=2700")
 # sscan record
 #seq  &xia_slit, "name=hsc1, P=xxx:, HSC=hsc1:, S=xxx:seriala[6]"
 
+# Orientation-matrix
+#seq &orient, "P=xxx:orient1:,PM=xxx:,mTTH=m9,mTH=m10,mCHI=m11,mPHI=m12"
+
 ### Start up the autosave task and tell it what to do.
 # The task is actually named "save_restore".
 # Note that you can reload these sets after creating them: e.g., 
diff --git a/iocBoot/iocLinux/auto_settings.req b/iocBoot/iocLinux/auto_settings.req
index 5219a6dff6bd4f6cde2e0482de8ce366d48d221c..1b8621c114620cc0d971ffda8b4a592b9a4b2114 100644
--- a/iocBoot/iocLinux/auto_settings.req
+++ b/iocBoot/iocLinux/auto_settings.req
@@ -50,3 +50,6 @@ file auto_4step_settings.req P=$(P),Q=4step
 
 file userAve10_settings.req P=$(P)
 
+# orientation matrix
+#file orient_settings.req P=$(P),O=1
+#file orient_xtals_settings.req P=$(P),O=1
diff --git a/iocBoot/iocLinux/orient_xtals.substitutions b/iocBoot/iocLinux/orient_xtals.substitutions
new file mode 100644
index 0000000000000000000000000000000000000000..c27a48328cdedb6f7ae3bdf86439d921a8c8e5ac
--- /dev/null
+++ b/iocBoot/iocLinux/orient_xtals.substitutions
@@ -0,0 +1,15 @@
+file "$(OPTICS)/opticsApp/Db/orient_xtals.db"
+{
+pattern
+{P, O, PREC, N, xtal, a, b, c, alpha, beta, gamma}
+{xxx:, 1, 4, 1, Silicon, 5.431, 5.431, 5.431, 90, 90, 90}
+{xxx:, 1, 4, 2, "Beryllium hcp", 2.2858, 2.2858, 3.5843, 90, 90, 120}
+{xxx:, 1, 4, 3, VO2, 5.743, 4.517, 5.375, 90, 122.6, 90}
+{xxx:, 1, 4, 4, undefined, 1, 1, 1, 90, 90, 90}
+{xxx:, 1, 4, 5, undefined, 1, 1, 1, 90, 90, 90}
+{xxx:, 1, 4, 6, undefined, 1, 1, 1, 90, 90, 90}
+{xxx:, 1, 4, 7, undefined, 1, 1, 1, 90, 90, 90}
+{xxx:, 1, 4, 8, undefined, 1, 1, 1, 90, 90, 90}
+{xxx:, 1, 4, 9, undefined, 1, 1, 1, 90, 90, 90}
+{xxx:, 1, 4, 10, undefined, 1, 1, 1, 90, 90, 90}
+}
diff --git a/iocBoot/iocLinux/st.cmd b/iocBoot/iocLinux/st.cmd
index 273615a379a0665e2423c873e3149f8c7af593fa..62fe6cbe1732832951f037f250728c6598a87c54 100644
--- a/iocBoot/iocLinux/st.cmd
+++ b/iocBoot/iocLinux/st.cmd
@@ -96,6 +96,10 @@ dbLoadRecords("$(OPTICS)/opticsApp/Db/table.db","P=xxx:,Q=Table1,T=table1,M0X=m1
 #dbLoadRecords("$(OPTICS)/opticsApp/Db/hrSeq.db","P=xxx:,N=1,M_PHI1=m9,M_PHI2=m10")
 #dbLoadRecords("$(OPTICS)/opticsApp/Db/hrSeq.db","P=xxx:,N=2,M_PHI1=m11,M_PHI2=m12")
 
+### Orientation matrix, four-circle diffractometer (see seq program 'orient' below)
+#dbLoadRecords("$(OPTICS)/opticsApp/Db/orient.db", "P=xxx:,O=1,PREC=4")
+#dbLoadTemplate("orient_xtals.substitutions")
+
 # Load single element Canberra AIM MCA and ICB modules
 #< canberra_1.cmd
 
@@ -154,6 +158,9 @@ seq &Keithley2kDMM,("P=xxx:, Dmm=D1, channels=22, model=2700")
 # sscan record
 #seq  &xia_slit, "name=hsc1, P=xxx:, HSC=hsc1:, S=xxx:seriala[6]"
 
+# Orientation-matrix
+#seq &orient, "P=xxx:orient1:,PM=xxx:,mTTH=m9,mTH=m10,mCHI=m11,mPHI=m12"
+
 ### Start up the autosave task and tell it what to do.
 # The task is actually named "save_restore".
 # Note that you can reload these sets after creating them: e.g., 
diff --git a/iocBoot/iocSolaris/auto_settings.req b/iocBoot/iocSolaris/auto_settings.req
index ea3fdac502677d740f42e94ab097d9f5b8284822..f5cde6b133a21aaaa06c9ed7df4c4a1e03eb098e 100644
--- a/iocBoot/iocSolaris/auto_settings.req
+++ b/iocBoot/iocSolaris/auto_settings.req
@@ -46,3 +46,6 @@ file sseq_settings.req P=$(P),S=Sseq1
 file sseq_settings.req P=$(P),S=Sseq2
 file sseq_settings.req P=$(P),S=Sseq3
 
+# orientation matrix
+#file orient_settings.req P=$(P),O=1
+#file orient_xtals_settings.req P=$(P),O=1
diff --git a/iocBoot/iocSolaris/orient_xtals.substitutions b/iocBoot/iocSolaris/orient_xtals.substitutions
new file mode 100644
index 0000000000000000000000000000000000000000..c27a48328cdedb6f7ae3bdf86439d921a8c8e5ac
--- /dev/null
+++ b/iocBoot/iocSolaris/orient_xtals.substitutions
@@ -0,0 +1,15 @@
+file "$(OPTICS)/opticsApp/Db/orient_xtals.db"
+{
+pattern
+{P, O, PREC, N, xtal, a, b, c, alpha, beta, gamma}
+{xxx:, 1, 4, 1, Silicon, 5.431, 5.431, 5.431, 90, 90, 90}
+{xxx:, 1, 4, 2, "Beryllium hcp", 2.2858, 2.2858, 3.5843, 90, 90, 120}
+{xxx:, 1, 4, 3, VO2, 5.743, 4.517, 5.375, 90, 122.6, 90}
+{xxx:, 1, 4, 4, undefined, 1, 1, 1, 90, 90, 90}
+{xxx:, 1, 4, 5, undefined, 1, 1, 1, 90, 90, 90}
+{xxx:, 1, 4, 6, undefined, 1, 1, 1, 90, 90, 90}
+{xxx:, 1, 4, 7, undefined, 1, 1, 1, 90, 90, 90}
+{xxx:, 1, 4, 8, undefined, 1, 1, 1, 90, 90, 90}
+{xxx:, 1, 4, 9, undefined, 1, 1, 1, 90, 90, 90}
+{xxx:, 1, 4, 10, undefined, 1, 1, 1, 90, 90, 90}
+}
diff --git a/iocBoot/iocSolaris/st.cmd b/iocBoot/iocSolaris/st.cmd
index 82d0d236d2b9e7fd3da9a63f90a6491aca740e19..8c689a745a94f85ec24f008f8ad41b57a6fc7db0 100644
--- a/iocBoot/iocSolaris/st.cmd
+++ b/iocBoot/iocSolaris/st.cmd
@@ -84,6 +84,10 @@ dbLoadTemplate("scanParms.substitutions")
 # 4-bounce high-resolution monochromator
 #dbLoadRecords("$(OPTICS)/opticsApp/Db/hrSeq.db","P=xxx:,N=1,M_PHI1=m1,M_PHI2=m2")
 
+### Orientation matrix, four-circle diffractometer (see seq program 'orient' below)
+#dbLoadRecords("$(OPTICS)/opticsApp/Db/orient.db", "P=xxx:,O=1,PREC=4")
+#dbLoadTemplate("orient_xtals.substitutions")
+
 ### Stuff for user programming ###
 dbLoadRecords("$(CALC)/calcApp/Db/userCalcs10.db","P=xxx:")
 dbLoadRecords("$(CALC)/calcApp/Db/userStringCalcs10.db","P=xxx:")
@@ -121,6 +125,9 @@ iocInit
 #seq &kohzuCtl, "P=xxx:, M_THETA=m1, M_Y=m2, M_Z=m3, GEOM=1, logfile=kohzuCtl.log"
 #seq &hrCtl, "P=xxx:, N=1, M_PHI1=m1, M_PHI2=m2, logfile=hrCtl1.log"
 
+# Orientation-matrix
+#seq &orient, "P=xxx:orient1:,PM=xxx:,mTTH=m9,mTH=m10,mCHI=m11,mPHI=m12"
+
 ### Start up the autosave task and tell it what to do.
 # The task is actually named "save_restore".
 # Note that you can reload these sets after creating them: e.g.,