Branch: master

c40a208a 2019-08-05 09:58:40 Timothy Pearson
Explicitly call out the "C" and higher variants of the TDS7x4 scopes, as an updated programming manual was issued for them (distinct from the "A" variants)
Fix reassembly of waveform data on "C" scope variants -- presumed to also fix (or at least not break) "A" variant reassembly, but this remains untested
M servers/gpib_server_lin/src/gpib_functions.cpp
M servers/gpib_server_lin/src/scope_functions.cpp

servers/gpib_server_lin/src/gpib_functions.cpp

diff --git a/servers/gpib_server_lin/src/gpib_functions.cpp b/servers/gpib_server_lin/src/gpib_functions.cpp
index e3e3a38..d3e170e 100644
--- a/servers/gpib_server_lin/src/gpib_functions.cpp
+++ b/servers/gpib_server_lin/src/gpib_functions.cpp
@@ -39,6 +39,9 @@
 	else if (strcmp("TDS744AOS", scopeType) == 0) {
 		return "Tektronix 744A series";
 	}
+	else if (strcmp("TDS744COS", scopeType) == 0) {
+		return "Tektronix 744C series";
+	}
 	else {
 		return "UNKNOWN";
 	}
@@ -128,4 +131,4 @@
 		return -1;
 	}
 	return 0;
-}
\ No newline at end of file
+}

servers/gpib_server_lin/src/scope_functions.cpp

diff --git a/servers/gpib_server_lin/src/scope_functions.cpp b/servers/gpib_server_lin/src/scope_functions.cpp
index 96030c4..33d6ebf 100644
--- a/servers/gpib_server_lin/src/scope_functions.cpp
+++ b/servers/gpib_server_lin/src/scope_functions.cpp
@@ -49,7 +49,8 @@
 	if (strcmp("HP54600OS", scopeType) == 0) {
 		return 512;
 	}
-	else if (strcmp("TDS744AOS", scopeType) == 0) {
+	else if ((strcmp("TDS744AOS", scopeType) == 0)
+		|| (strcmp("TDS744COS", scopeType) == 0)) {
 		return 640;
 	}
 	else {
@@ -61,7 +62,8 @@
 	if (strcmp("HP54600OS", scopeType) == 0) {
 		return 280;
 	}
-	else if (strcmp("TDS744AOS", scopeType) == 0) {
+	else if ((strcmp("TDS744AOS", scopeType) == 0)
+		|| (strcmp("TDS744COS", scopeType) == 0)) {
 		return 480;
 	}
 	else {
@@ -73,7 +75,8 @@
 	if (strcmp("HP54600OS", scopeType) == 0) {
 		return scopeScreenWidth(scopeType)*scopeScreenHeight(scopeType)*3;
 	}
-	else if (strcmp("TDS744AOS", scopeType) == 0) {
+	else if ((strcmp("TDS744AOS", scopeType) == 0)
+		|| (strcmp("TDS744COS", scopeType) == 0)) {
 		return scopeScreenWidth(scopeType)*scopeScreenHeight(scopeType)*3;
 	}
 	else {
@@ -139,7 +142,7 @@
 	int k;
 	int m;
 
-	if ((strcmp("HP54600OS", scopeType) == 0) || (strcmp("TDS744AOS", scopeType) == 0)) {
+	if ((strcmp("HP54600OS", scopeType) == 0) || (strcmp("TDS744AOS", scopeType) == 0) || (strcmp("TDS744COS", scopeType) == 0)) {
 		printf("[INFO] Getting scope screenshot [Stage 2]\n\r");
 		if (strcmp("HP54600OS", scopeType) == 0) {
 			if (gpib_read_binblock(gpibDevice, 19768, scopeType) == 0) {
@@ -149,7 +152,8 @@
 				return 1;
 			}
 		}
-		else if (strcmp("TDS744AOS", scopeType) == 0) {
+		else if ((strcmp("TDS744AOS", scopeType) == 0)
+			|| (strcmp("TDS744COS", scopeType) == 0)) {
 			gpib_read_binary(gpibDevice, scopeScreenSize(scopeType));
 
 			int bpp;
@@ -188,7 +192,7 @@
 }
 
 int scope_get_screenshot(const char * scopeType, int gpibDevice) {
-	if ((strcmp("HP54600OS", scopeType) == 0) || (strcmp("TDS744AOS", scopeType) == 0)) {
+	if ((strcmp("HP54600OS", scopeType) == 0) || (strcmp("TDS744AOS", scopeType) == 0) || (strcmp("TDS744COS", scopeType) == 0)) {
 		printf("[INFO] Getting scope screenshot [Stage 1]\n\r");
 		if (strcmp("HP54600OS", scopeType) == 0) {
 			sprintf(falpha, "PRINT?");
@@ -202,7 +206,8 @@
 				return 2;
 			}
 		}
-		else if (strcmp("TDS744AOS", scopeType) == 0) {
+		else if ((strcmp("TDS744AOS", scopeType) == 0)
+			|| (strcmp("TDS744COS", scopeType) == 0)) {
 			sprintf(falpha, "HARDCOPY:FORMAT BMPCOLOR");
 			if (gpib_write(gpibDevice, falpha) == 0) {
 				#ifdef ENABLE_EXTRA_DEBUGGING
@@ -240,7 +245,7 @@
 }
 
 int scope_set_timebase(float desired_timebase,const char * scopeType, int gpibDevice) {
-	if ((strcmp("HP54600OS", scopeType) == 0) || (strcmp("TDS744AOS", scopeType) == 0)) {
+	if ((strcmp("HP54600OS", scopeType) == 0) || (strcmp("TDS744AOS", scopeType) == 0) || (strcmp("TDS744COS", scopeType) == 0)) {
 		printf("[INFO] Setting scope timebase to %E\n\r", desired_timebase);
 		if (strcmp("HP54600OS", scopeType) == 0) {
 			sprintf(falpha, "TIM:RANG %E", desired_timebase);
@@ -254,7 +259,8 @@
 				return 2;
 			}
 		}
-		else if (strcmp("TDS744AOS", scopeType) == 0) {
+		else if ((strcmp("TDS744AOS", scopeType) == 0)
+			|| (strcmp("TDS744COS", scopeType) == 0)) {
 			sprintf(falpha, "HORIZONTAL:MAIN:SCALE %E", desired_timebase);
 			#ifdef ENABLE_EXTRA_DEBUGGING
 			printf("[DEBG] Writing: %s\n\r", falpha);
@@ -285,7 +291,8 @@
 		// Not supported (yet)
 		return -1;
 	}
-	else if (strcmp("TDS744AOS", scopeType) == 0) {
+	else if ((strcmp("TDS744AOS", scopeType) == 0)
+		|| (strcmp("TDS744COS", scopeType) == 0)) {
 		// Send request
 		printf("[INFO] Getting scope timebase\n\r");
 		sprintf(falpha,"HORIZONTAL:MAIN:SCALE?");
@@ -325,7 +332,7 @@
 }
 
 int scope_set_volts_div(int desired_channel, double desired_volts, const char * scopeType, int gpibDevice) {
-	if ((strcmp("HP54600OS", scopeType) == 0) || (strcmp("TDS744AOS", scopeType) == 0)) {
+	if ((strcmp("HP54600OS", scopeType) == 0) || (strcmp("TDS744AOS", scopeType) == 0) || (strcmp("TDS744COS", scopeType) == 0)) {
 		printf("[INFO] Setting scope volts/div on channel %d to %E\n\r", desired_channel, desired_volts);
 		if (strcmp("HP54600OS", scopeType) == 0) {
 			sprintf(falpha, "CHAN%d:RANG %E", desired_channel, desired_volts);
@@ -339,7 +346,8 @@
 				return 2;
 			}
 		}
-		else if (strcmp("TDS744AOS", scopeType) == 0) {
+		else if ((strcmp("TDS744AOS", scopeType) == 0)
+			|| (strcmp("TDS744COS", scopeType) == 0)) {
 			sprintf(falpha, "CH%d:SCALE %E", desired_channel, desired_volts);
 			#ifdef ENABLE_EXTRA_DEBUGGING
 			printf("[DEBG] Writing: %s\n\r", falpha);
@@ -361,7 +369,7 @@
 }
 
 int scope_set_acquisition(int status,const char * scopeType, int gpibDevice) {
-	if ((strcmp("HP54600OS", scopeType) == 0) || (strcmp("TDS744AOS", scopeType) == 0)) {
+	if ((strcmp("HP54600OS", scopeType) == 0) || (strcmp("TDS744AOS", scopeType) == 0) || (strcmp("TDS744COS", scopeType) == 0)) {
 		printf("[INFO] Setting scope run status to %d\n\r", status);
 		if (strcmp("HP54600OS", scopeType) == 0) {
 			if (status == 0) {
@@ -380,7 +388,8 @@
 				return 2;
 			}
 		}
-		else if (strcmp("TDS744AOS", scopeType) == 0) {
+		else if ((strcmp("TDS744AOS", scopeType) == 0)
+			|| (strcmp("TDS744COS", scopeType) == 0)) {
 			sprintf(falpha, "ACQUIRE:STATE %d", status);
 			#ifdef ENABLE_EXTRA_DEBUGGING
 			printf("[DEBG] Writing: %s\n\r", falpha);
@@ -411,7 +420,8 @@
 		// Not supported (yet)
 		return -1;
 	}
-	else if (strcmp("TDS744AOS", scopeType) == 0) {
+	else if ((strcmp("TDS744AOS", scopeType) == 0)
+		|| (strcmp("TDS744COS", scopeType) == 0)) {
 		// Send request
 		printf("[INFO] Getting run state\n\r");
 		sprintf(falpha,"ACQUIRE:STATE?");
@@ -451,7 +461,7 @@
 }
 
 int scope_set_channel_state(int desired_channel, int status,const char * scopeType, int gpibDevice) {
-	if ((strcmp("HP54600OS", scopeType) == 0) || (strcmp("TDS744AOS", scopeType) == 0)) {
+	if ((strcmp("HP54600OS", scopeType) == 0) || (strcmp("TDS744AOS", scopeType) == 0) || (strcmp("TDS744COS", scopeType) == 0)) {
 		printf("[INFO] Setting channel %d state to %i\n\r", desired_channel, status);
 		if (strcmp("HP54600OS", scopeType) == 0) {
 			if (status == 0) {
@@ -473,7 +483,8 @@
 				return 2;
 			}
 		}
-		else if (strcmp("TDS744AOS", scopeType) == 0) {
+		else if ((strcmp("TDS744AOS", scopeType) == 0)
+			|| (strcmp("TDS744COS", scopeType) == 0)) {
 			if (status == 0) {
 				sprintf(falpha, "SELECT:CH%d OFF", desired_channel);
 			}
@@ -514,7 +525,8 @@
 		// Not supported (yet)
 		return -1;
 	}
-	else if (strcmp("TDS744AOS", scopeType) == 0) {
+	else if ((strcmp("TDS744AOS", scopeType) == 0)
+		|| (strcmp("TDS744COS", scopeType) == 0)) {
 		sprintf(falpha, "SELECT:CH%d?", desired_channel);
 		#ifdef ENABLE_EXTRA_DEBUGGING
 		printf("[DEBG] Writing: %s\n\r", falpha);
@@ -552,7 +564,7 @@
 }
 
 int scope_set_trigger_channel(int desired_channel,const char * scopeType, int gpibDevice) {
-	if ((strcmp("HP54600OS", scopeType) == 0) || (strcmp("TDS744AOS", scopeType) == 0)) {
+	if ((strcmp("HP54600OS", scopeType) == 0) || (strcmp("TDS744AOS", scopeType) == 0) || (strcmp("TDS744COS", scopeType) == 0)) {
 		printf("[INFO] Setting scope trigger channel to %d\n\r", desired_channel);
 		if (strcmp("HP54600OS", scopeType) == 0) {
 			sprintf(falpha, "TRIG:SOUR CHAN%d", desired_channel);
@@ -566,7 +578,8 @@
 				return 2;
 			}
 		}
-		else if (strcmp("TDS744AOS", scopeType) == 0) {
+		else if ((strcmp("TDS744AOS", scopeType) == 0)
+			|| (strcmp("TDS744COS", scopeType) == 0)) {
 			sprintf(falpha, "TRIGGER:MAIN:EDGE:SOURCE CH%d", desired_channel);
 			#ifdef ENABLE_EXTRA_DEBUGGING
 			printf("[DEBG] Writing: %s\n\r", falpha);
@@ -598,7 +611,8 @@
 		// Not supported (yet)
 		return -1;
 	}
-	else if (strcmp("TDS744AOS", scopeType) == 0) {
+	else if ((strcmp("TDS744AOS", scopeType) == 0)
+		|| (strcmp("TDS744COS", scopeType) == 0)) {
 		sprintf(falpha, "TRIGGER:MAIN:EDGE:SOURCE?");
 		#ifdef ENABLE_EXTRA_DEBUGGING
 		printf("[DEBG] Writing: %s\n\r", falpha);
@@ -646,7 +660,7 @@
 }
 
 int scope_set_trigger_level(float desired_level,const char * scopeType, int gpibDevice) {
-	if ((strcmp("HP54600OS", scopeType) == 0) || (strcmp("TDS744AOS", scopeType) == 0)) {
+	if ((strcmp("HP54600OS", scopeType) == 0) || (strcmp("TDS744AOS", scopeType) == 0) || (strcmp("TDS744COS", scopeType) == 0)) {
 		printf("[INFO] Setting scope trigger level to %f\n\r", desired_level);
 		if (strcmp("HP54600OS", scopeType) == 0) {
 			sprintf(falpha, "TRIG:LEV %E", desired_level);
@@ -660,7 +674,8 @@
 				return 2;
 			}
 		}
-		else if (strcmp("TDS744AOS", scopeType) == 0) {
+		else if ((strcmp("TDS744AOS", scopeType) == 0)
+			|| (strcmp("TDS744COS", scopeType) == 0)) {
 			sprintf(falpha, "TRIGGER:MAIN:LEVEL %f", desired_level);
 			#ifdef ENABLE_EXTRA_DEBUGGING
 			printf("[DEBG] Writing: %s\n\r", falpha);
@@ -691,7 +706,8 @@
 		// Not supported (yet)
 		return -1;
** Diff limit reached (max: 250 lines) **