Index: trunk/Ohana/src/opihi/cmd.astro/objload.c
===================================================================
--- trunk/Ohana/src/opihi/cmd.astro/objload.c	(revision 3462)
+++ trunk/Ohana/src/opihi/cmd.astro/objload.c	(revision 3693)
@@ -66,8 +66,8 @@
   free (buffer);
 
-  write (Ximage, "LOAD", 4); /* force Ximage to look for the incoming image */
-  sprintf (line, "OVER %9d ", n);
-  write (Ximage, line, 16);
+  SendGraphCommand (Ximage, 4, "LOAD");
+  SendGraphCommand (Ximage, 16, "OVER %9d ", n);
   
+  /** NOTE: modify to use NBYTE **/
   ALLOCATE (buffer, char, 66000);
   bzero (buffer, 65536);
@@ -75,6 +75,5 @@
     snprintf (&buffer[Nout*128], 129, "%15s %20.10f %20.10f %20.10f %20.10f ", "BOX", X[i], Y[i], 5.0, 5.0);
     if (Nout == 512) {
-      sprintf (line, "NLINES  %7d ", Nout);
-      write (Ximage, line, 16);
+      SendGraphCommand (Ximage, 16, "NLINES  %7d ", Nout);
       write (Ximage, buffer, Nout*128);
       bzero (buffer, 65536);
@@ -84,10 +83,8 @@
 
   if (Nout) {
-    sprintf (line, "NLINES  %7d ", Nout);
-    write (Ximage, line, 16);
+    SendGraphCommand (Ximage, 16, "NLINES  %7d ", Nout);
     write (Ximage, buffer, Nout*128);
   }
-  sprintf (line, "DONE ");
-  write (Ximage, line, 16);
+  SendGraphCommand (Ximage, 16, "DONE");
 
   free (X);
