From 0acaee8ab496889d1a2e7bf3145260d1f53ba03d Mon Sep 17 00:00:00 2001
From: Xavier Elattaoui <xavier.elattaoui@synchrotron-soleil.fr>
Date: Wed, 15 Jul 2020 16:48:32 +0000
Subject: [PATCH] 6485 better management

---
 pom.xml                      | 2 +-
 src/KeithleySCPIProtocol.cpp | 7 ++-----
 src/Keithley_6485.cpp        | 8 +++++---
 src/Keithley_6487.cpp        | 2 +-
 src/Keithley_6514.cpp        | 8 ++++----
 5 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/pom.xml b/pom.xml
index ce57ddc..3f762c9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,7 +8,7 @@
    </parent>
    <groupId>fr.soleil.lib</groupId>
    <artifactId>Electrometers-${aol}-${library}-${mode}</artifactId>
-   <version>2.5.27-SNAPSHOT</version>
+   <version>2.5.27</version>
    <packaging>nar</packaging>
    <name>Electrometers library</name>
    <description>Electrometers library</description>
diff --git a/src/KeithleySCPIProtocol.cpp b/src/KeithleySCPIProtocol.cpp
index 27af680..ef71f58 100644
--- a/src/KeithleySCPIProtocol.cpp
+++ b/src/KeithleySCPIProtocol.cpp
@@ -83,11 +83,10 @@ bool KeithleySCPIProtocol::build_communicationLink()
 
 	try
 	{
+		reset();
 		//- configure tthe SCPI Keithley device
 		std::string cmd_to_send("");
-		//- Select reading only
-		cmd_to_send = "FORM:ELEM READ";
-		_communication_link->write(cmd_to_send);
+
 		//- Select control source : IMMediate
 		cmd_to_send = "ARM:SOUR IMM";
 		_communication_link->write(cmd_to_send);
@@ -1214,8 +1213,6 @@ void KeithleySCPIProtocol::reset (void)
 
   //- Select reading only
   cmd_to_send = "FORM:ELEM READ";
-
-	//- send command
 	_communication_link->write(cmd_to_send);
 }
 
diff --git a/src/Keithley_6485.cpp b/src/Keithley_6485.cpp
index 5088fec..8e020df 100644
--- a/src/Keithley_6485.cpp
+++ b/src/Keithley_6485.cpp
@@ -28,7 +28,7 @@ static const std::string K6485_rangeValue[] = {"2E-9","2E-8","2E-7","2E-6","2E-5
 /*
 * Max Index Range value for a K_6485
 */
-static const short K6485_rangeLimit = 7;
+static const short K6485_rangeLimit = 8;
 
 static const unsigned short MAX_SAVED_CONFIG = 2;
 
@@ -40,8 +40,8 @@ Keithley_6485::Keithley_6485 (std::string& comLink_device_name)
 {
 	std::cout << "Keithley_6485::Keithley_6485 <-" << std::endl;
 
-  _numPLC     = 0;
-  _trigCounts = 0;
+  _numPLC     = 0.1;
+  _trigCounts = 1;
   _size       = 0;
 
 	std::cout << "Keithley_6485::Keithley_6485 ->" << std::endl;
@@ -78,6 +78,8 @@ bool Keithley_6485::init_protocol (void)
 		    _kscpi->set_isDiffSuportedMode(false);
 
       success = _electrometerProtocol->build_communicationLink();
+
+      set_knplc(_numPLC);
     }
   }
   catch(Tango::DevFailed& df)
diff --git a/src/Keithley_6487.cpp b/src/Keithley_6487.cpp
index 95e4995..e1709ef 100644
--- a/src/Keithley_6487.cpp
+++ b/src/Keithley_6487.cpp
@@ -28,7 +28,7 @@ static const std::string K6487_rangeValue[8] = {"2E-2","2E-3","2E-4","2E-5","2E-
 /*
 * Max Index Range value for a K_6487
 */
-static const short K6487_rangeLimit = 7;
+static const short K6487_rangeLimit = 8;
 
 static const unsigned short MAX_SAVED_CONFIG = 2;
 
diff --git a/src/Keithley_6514.cpp b/src/Keithley_6514.cpp
index 6d56793..1d1c32d 100644
--- a/src/Keithley_6514.cpp
+++ b/src/Keithley_6514.cpp
@@ -32,10 +32,10 @@ static const std::string K6514_COU_rangeStr[] = {"2E-8","2E-7","2E-6","2E-5"};
 /*
 * Max Index Range value for a K_6514
 */
-static const short K6514_AMP_rangeLimit = 9;
-static const short K6514_VOLT_rangeLimit= 2;
-static const short K6514_OHM_rangeLimit = 8;
-static const short K6514_COU_rangeLimit = 3;
+static const short K6514_AMP_rangeLimit = 10;
+static const short K6514_VOLT_rangeLimit= 3;
+static const short K6514_OHM_rangeLimit = 9;
+static const short K6514_COU_rangeLimit = 4;
 
 static const unsigned short MAX_SAVED_CONFIG = 2;
 
-- 
GitLab