Commits

Elvis Cheng  committed ad485b4 Merge
  • Participants
  • Parent commits c9fcf6e, 6b63055

Comments (0)

Files changed (1)

File GPIB_a34401/a34401/a34401.m

 
 #import "a34401.h"
 #include <NI488/ni488.h>
+#define A34401_ADDR 22
+#define A34401_CUR_CMD  "MEASure:CURRent:DC?"
+#define A34401_VOL_CMD  "MEASure:VOLTage:DC?"
+#define A34401_RES_CMD  "MEASure:RESistance?"
 
 @implementation a34401
 -(void) awakeFromNib
 {
     Device=0;
     BoardIndex=0;
-    PrimaryAddress = 22;      /* Primary address of the device           */
+    PrimaryAddress = A34401_ADDR;      /* Primary address of the device           */
     SecondaryAddress = 0;    /* Secondary address of the device         */
     result_str=[[NSMutableString alloc]init];
     [result_str setString:@""];
      * Main Application Body - Write the majority of your GPIB code here.
      *****************************************************************************/
     
-    ibwrt(Device, "MEASure:VOLTage:DC?", 19);     /* Send the identification query command   */
+    ibwrt(Device, A34401_VOL_CMD, 19);     /* Send the identification query command   */
     if (ibsta & ERR) {
         [self GpibError:"ibwrt Error"];
     }
      * Main Application Body - Write the majority of your GPIB code here.
      *****************************************************************************/
     
-    ibwrt(Device, "MEASure:CURRent:DC?", 19);     /* Send the identification query command   */
+    ibwrt(Device, A34401_CUR_CMD, 19);     /* Send the identification query command   */
     if (ibsta & ERR) {
         [self GpibError:"ibwrt Error"];
     }
      * Main Application Body - Write the majority of your GPIB code here.
      *****************************************************************************/
     
-    ibwrt(Device, "MEASure:RESistance?", 19);     /* Send the identification query command   */
+    ibwrt(Device, A34401_RES_CMD, 19);     /* Send the identification query command   */
     if (ibsta & ERR) {
         [self GpibError:"ibwrt Error"];
     }