Index: trunk/Ohana/src/opihi/cmd.astro/region.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.astro/region.c	(revision 3525)
+++ trunk/Ohana/src/opihi/cmd.astro/region.c	(revision 3692)
@@ -61,5 +61,5 @@
   
   /* ask kapa for coordinate limits, so get the right aspect ratio */
-  status = write (Xgraph, "LIMS", 4); 
+  SendGraphCommand (Xgraph, 4, "LIMS"); 
   read (Xgraph, buffer, 30); 
   sscanf (buffer, "%*s %lf %lf", &dx, &dy); 
@@ -100,11 +100,7 @@
   graphmode.coords.cdelt1 = graphmode.coords.cdelt2 = 1.0;
 
-  write (Xgraph, "ERAS", 4);
-    
-  write (Xgraph, "SLIM", 4);
-  sprintf (buffer, "%f %f %f %f ", graphmode.xmin, graphmode.xmax, graphmode.ymin, graphmode.ymax);
-  sprintf (buffer2, "NBYTES: %6d ", strlen (buffer));
-  write (Xgraph, buffer2, 16);
-  write (Xgraph, buffer, strlen (buffer));
+  SendGraphCommand (Xgraph, 4, "ERAS");
+  SendGraphCommand (Xgraph, 4, "SLIM"); 
+  SendGraphMessage (Xgraph, "%f %f %f %f", graphmode.xmin, graphmode.xmax, graphmode.ymin, graphmode.ymax);
 
   sprintf (string, "%8.4f %8.4f (%f)", Ra, Dec, Radius);
