aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Stubs Collection/stubs
diff options
context:
space:
mode:
authorAvi Levkovich <avi@twine-s.com>2020-12-28 16:50:45 +0200
committerAvi Levkovich <avi@twine-s.com>2020-12-28 16:50:45 +0200
commit8813991f69a68b13403f05e357ff96e5f3fcb55a (patch)
tree9d028efc80873b56095b81ff27738fcae8971abb /Software/Stubs Collection/stubs
parent7304ec47c65430cf4202a02b54ca18fbc0d6a646 (diff)
downloadTango-8813991f69a68b13403f05e357ff96e5f3fcb55a.tar.gz
Tango-8813991f69a68b13403f05e357ff96e5f3fcb55a.zip
Add stubs scripts for BTSR
Diffstat (limited to 'Software/Stubs Collection/stubs')
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/10_DEVICE_INFORMATION_READ.cs71
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/11_DEVICE_CALIBRATION.cs94
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/13_BAUDRATE_SET.cs75
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/14_DISPLAY_LANGUAGE_SET.cs81
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/15_CONFIGURATION_SET.cs104
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/17_ADVANCED_CONFIGURATION_SET.cs79
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/18_ADVANCED_PROGRAMMING_READ.cs81
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/20_INPUT_CURRENT_CONTROL_SET.cs86
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/21_ADVANCED_TENSION_PROGRAMMING.cs111
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/23_ADVANCED_TENSION_READ.cs77
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/25_ADVANCED_STYLE_LOAD.cs106
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/27_APPLICATION_AND_YARN_TYPOLOGY_SET.cs77
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/28_APPLICATION_AND_YARN_TYPOLOGY_READ.cs81
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/29_WORK_TENSION_AND_OPERATION_STATUS_SET.cs79
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/30_ALARM_AND_ENABLING_STATUS_READ.cs78
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/32_PC_LINK_READ.cs77
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/35_ALARM_STATUS_RESET.cs79
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/36_RESETS_ALL_THE_COUNTERS.cs73
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/37_METERS_TOTAL_COUNTER_READ_LOW.cs71
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/38_METERS_TOTAL_COUNTER_RESET_LOW.cs73
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/39_METERS_TOTAL_COUNTER_READ_HIGH.cs71
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/40_METERS_TOTAL_COUNTER_RESET_HIGH.cs71
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/41_METER_TOTAL_COUNTER_READ_HIGHEST.cs71
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/42_METERS_TOTAL_COUNTER_RESET_HIGHEST.cs71
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/FILENAME.TXT35
-rw-r--r--Software/Stubs Collection/stubs/Scripts/BTSR/test gpio uart 4.cs35
26 files changed, 2007 insertions, 0 deletions
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/10_DEVICE_INFORMATION_READ.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/10_DEVICE_INFORMATION_READ.cs
new file mode 100644
index 000000000..eb5db4330
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/10_DEVICE_INFORMATION_READ.cs
@@ -0,0 +1,71 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x3E;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 12;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = YES;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(int i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- DEVICE INFORMATION READ --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/11_DEVICE_CALIBRATION.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/11_DEVICE_CALIBRATION.cs
new file mode 100644
index 000000000..8b63f368c
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/11_DEVICE_CALIBRATION.cs
@@ -0,0 +1,94 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x49;
+
+const byte CALIBRATION_COMMAND = 0x84;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 1;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = NO;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CALIBRATION_COMMAND);//Byte 1 to write FUNCTION_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//NA
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//SPARE
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ int i = 0;
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead + Verify_Received_CheckSum;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead - Verify_Received_CheckSum;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+ if((Verify_Received_CheckSum == YES) && (response1.ReadBytes[i] != 0))//use the next byte to return the checksum status
+ {
+ stubManager.WriteLine("\n --- Received Wrong CheckSum !!! --- \n");
+ }
+
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- DEVICE CALIBRATION --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/13_BAUDRATE_SET.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/13_BAUDRATE_SET.cs
new file mode 100644
index 000000000..56c0dec0b
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/13_BAUDRATE_SET.cs
@@ -0,0 +1,75 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x38;
+const byte DATA_STRING = 0x03;//57600
+//const byte DATA_STRING = 0x04;//115200
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 1;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = NO;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(DATA_STRING);//Byte 2 to write
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//SPARE
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(int i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- BAUDRATE SET --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/14_DISPLAY_LANGUAGE_SET.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/14_DISPLAY_LANGUAGE_SET.cs
new file mode 100644
index 000000000..b33ee47d6
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/14_DISPLAY_LANGUAGE_SET.cs
@@ -0,0 +1,81 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x1A;
+const byte DATA_STRING = 0x01;//Set language to english
+/*
+00 ITALIAN
+01 ENGLISH
+02 FRENCH
+03 SPANISH
+04 GERMAN
+05 JAPANESE
+06 CHINESE
+*/
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 1;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = NO;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(DATA_STRING);//Byte 2 to write
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(int i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- DISPLAY LANGUAGE SET --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/15_CONFIGURATION_SET.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/15_CONFIGURATION_SET.cs
new file mode 100644
index 000000000..75224ed24
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/15_CONFIGURATION_SET.cs
@@ -0,0 +1,104 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+byte FLIP_DISPLAY = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x36;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 1;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = NO;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//1° BYTE CONFIGURATION BYTE
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//2° BYTE STOP OUTPUT
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FLIP_DISPLAY);//3° BYTE INPUT CONFIGURATION ----- D6 ‘1’ FLIP DISPLAY (0x40 / 0x00)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//4° BYTE EDITOR
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//5° SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//6° SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//7° SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//8° SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//9° SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//10° SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//11° STRETCH VALUE (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//12° STRETCH VALUE (MSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//13° SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//14° SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//15° SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0);//16° SPARE
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ int i = 0;
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead + Verify_Received_CheckSum;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead - Verify_Received_CheckSum;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+ if((Verify_Received_CheckSum == YES) && (response1.ReadBytes[i] != 0))//use the next byte to return the checksum status
+ {
+ stubManager.WriteLine("\n --- Received Wrong CheckSum !!! --- \n");
+ }
+
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ var response = stubManager.ShowResponseWindow("FLIP DISPLAY ? Y/N", "Y");
+ if(( response == "Y") || ( response == "y"))
+ FLIP_DISPLAY = 0x40;
+ else
+ FLIP_DISPLAY = 0x00;
+
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- CONFIGURATION SET --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/17_ADVANCED_CONFIGURATION_SET.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/17_ADVANCED_CONFIGURATION_SET.cs
new file mode 100644
index 000000000..72685be9f
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/17_ADVANCED_CONFIGURATION_SET.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x32;
+
+const byte STOP_OUT_CONFIG = 0x00;
+const byte CUSTOMISATION = 0x00;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 1;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = NO;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+ //DATA_STRING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(STOP_OUT_CONFIG);//1° BYTE STOP OUTPUT CONFIGURATION
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//2° BYTE SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CUSTOMISATION);//3° BYTE CUSTOMISATION
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//4° BYTE SPARE
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(int i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- ADVANCED CONFIGURATION SET --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/18_ADVANCED_PROGRAMMING_READ.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/18_ADVANCED_PROGRAMMING_READ.cs
new file mode 100644
index 000000000..7b0014fe0
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/18_ADVANCED_PROGRAMMING_READ.cs
@@ -0,0 +1,81 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x33;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 6;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = YES;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+
+ //stubI2CWriteBytesRequest.BytesTWrite.Add(CHECK_STRING LSB);//Byte 2 to write
+ //stubI2CWriteBytesRequest.BytesTWrite.Add(CHECK_STRING MSB);//Byte 3 to write
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ int i = 0;
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead + Verify_Received_CheckSum;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead - Verify_Received_CheckSum;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+ if((Verify_Received_CheckSum == YES) && (response1.ReadBytes[i] != 0))//use the next byte to return the checksum status
+ {
+ stubManager.WriteLine("\n --- Received Wrong CheckSum !!! --- \n");
+ }
+
+
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- ADVANCED PROGRAMMING READ--- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/20_INPUT_CURRENT_CONTROL_SET.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/20_INPUT_CURRENT_CONTROL_SET.cs
new file mode 100644
index 000000000..7e255607b
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/20_INPUT_CURRENT_CONTROL_SET.cs
@@ -0,0 +1,86 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x2E;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 1;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = NO;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+
+ //DATA_STRING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//1° BYTE STATUS - D0 ‘1’ SAVE DATA IN EEPROM
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//2° BYTE INPUT CURRENT PERCENTAGE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//3° BYTE TIME CURRENT ALARM (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//4° BYTE TIME CURRENT ALARM (MSB)
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//5° BYTE SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//6° BYTE SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//7° BYTE SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//8° BYTE SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//9° BYTE SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//10° BYTE SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//11° BYTE SPARE
+
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(int i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- INPUT CURRENT CONTROL SET --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/21_ADVANCED_TENSION_PROGRAMMING.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/21_ADVANCED_TENSION_PROGRAMMING.cs
new file mode 100644
index 000000000..c812afce6
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/21_ADVANCED_TENSION_PROGRAMMING.cs
@@ -0,0 +1,111 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x39;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 1;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = NO;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+
+ //DATA_STRING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//1° BYTE OUTPUT TENSION (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//2° BYTE OUTPUT TENSION (MSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//3° BYTE WORK TENSION (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//4° BYTE WORK TENSION (MSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//5° BYTE RELAX YARN (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//6° BYTE RELAX YARN (MSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//7° BYTE INC DEC TENSION
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//8° BYTE INC DEC STRETCH
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//9° BYTE METER START (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//10° BYTE METER START
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//11° BYTE METER START
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//12° BYTE METER START (MSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//13° BYTE INC-DEC METER (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//14° BYTE INC-DEC METER
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//15° BYTE INC-DEC METER
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//16° BYTE INC-DEC METER (MSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//17° BYTE TARGET (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//18° BYTE TARGET
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//19° BYTE TARGET
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//20° BYTE TARGET (MSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//21° BYTE TENSION ERROR (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//22° BYTE TENSION ERROR (MSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//23° BYTE ALARM TIME (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//24° BYTE ALARM TIME (MSB)
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//25° BYTE SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//26° BYTE SPARE
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//27° BYTE ALARM ENABLING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//28° BYTE TARGET ENABLING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x01);//29° BYTE RELAX YARN SPEED
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//30° BYTE SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//31° BYTE SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//32° BYTE SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//33° BYTE SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//34° BYTE SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//35° BYTE SPARE
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(int i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- ADVANCED TENSION PROGRAMMING --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/23_ADVANCED_TENSION_READ.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/23_ADVANCED_TENSION_READ.cs
new file mode 100644
index 000000000..904015051
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/23_ADVANCED_TENSION_READ.cs
@@ -0,0 +1,77 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x3A;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 37;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = YES;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ int i = 0;
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead + Verify_Received_CheckSum;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead - Verify_Received_CheckSum;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+ if((Verify_Received_CheckSum == YES) && (response1.ReadBytes[i] != 0))//use the next byte to return the checksum status
+ {
+ stubManager.WriteLine("\n --- Received Wrong CheckSum !!! --- \n");
+ }
+
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- ADVANCED TENSION READ --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/25_ADVANCED_STYLE_LOAD.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/25_ADVANCED_STYLE_LOAD.cs
new file mode 100644
index 000000000..599cb66ec
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/25_ADVANCED_STYLE_LOAD.cs
@@ -0,0 +1,106 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x4B;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 1;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = NO;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+
+ //DATA_STRING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0xCD);//1° BYTE WORK TENSION (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//2° BYTE WORK TENSION (MSB)
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//3° BYTE OUTPUT TENSION (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//4° BYTE OUTPUT TENSION (MSB)
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//5° BYTE RELAX YARN (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//6° BYTE RELAX YARN (MSB)
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//7° BYTE INC DEC TENSION
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//8° BYTE INC DEC STRETCH
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x02);//9° BYTE TENSION ERROR (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//10° BYTE TENSION ERROR (MSB)
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x04);//11° BYTE TIME ALARM (LSB)
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//12° BYTE TIME ALARM (MSB)
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//13° BYTE RELAX SPEED
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(10);//14° BYTE APPLICATION
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(3);//15° BYTE YARN TYPE
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//16° BYTE SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//17° BYTE SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//18° BYTE SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//19° BYTE SPARE
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//20° BYTE ALARM ENABLING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//21° BYTE ABILITAZIONE
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(int i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- ADVANCED STYLE LOAD --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/27_APPLICATION_AND_YARN_TYPOLOGY_SET.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/27_APPLICATION_AND_YARN_TYPOLOGY_SET.cs
new file mode 100644
index 000000000..b93e006ff
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/27_APPLICATION_AND_YARN_TYPOLOGY_SET.cs
@@ -0,0 +1,77 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x3F;
+const byte Application = 0x06;
+const byte Yarn_Type = 0x04;
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 1;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = NO;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(Application);//Byte 2 to write
+ stubI2CWriteBytesRequest.BytesTWrite.Add(Yarn_Type);//Byte 3 to write
+
+ //stubI2CWriteBytesRequest.BytesTWrite.Add(CHECK_STRING LSB);//Byte 4 to write
+ //stubI2CWriteBytesRequest.BytesTWrite.Add(CHECK_STRING MSB);//Byte 5 to write
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(int i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- APPLICATION AND YARN TYPOLOGY SET --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/28_APPLICATION_AND_YARN_TYPOLOGY_READ.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/28_APPLICATION_AND_YARN_TYPOLOGY_READ.cs
new file mode 100644
index 000000000..75549190b
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/28_APPLICATION_AND_YARN_TYPOLOGY_READ.cs
@@ -0,0 +1,81 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x40;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 4;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = YES;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+
+ //stubI2CWriteBytesRequest.BytesTWrite.Add(CHECK_STRING LSB);//Byte 2 to write
+ //stubI2CWriteBytesRequest.BytesTWrite.Add(CHECK_STRING MSB);//Byte 3 to write
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ int i = 0;
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead + Verify_Received_CheckSum;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead - Verify_Received_CheckSum;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+ if((Verify_Received_CheckSum == YES) && (response1.ReadBytes[i] != 0))//use the next byte to return the checksum status
+ {
+ stubManager.WriteLine("\n --- Received Wrong CheckSum !!! --- \n");
+ }
+
+
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- APPLICATION AND YARN TYPOLOGY READ --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/29_WORK_TENSION_AND_OPERATION_STATUS_SET.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/29_WORK_TENSION_AND_OPERATION_STATUS_SET.cs
new file mode 100644
index 000000000..3dd85b8ca
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/29_WORK_TENSION_AND_OPERATION_STATUS_SET.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x19;
+
+const byte OPERATION_STATUS = 0x01;
+const byte WORK_TENSION_LSB = 0x01;
+const byte WORK_TENSION_MSB = 0x01;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 1;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = NO;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(OPERATION_STATUS);//Byte 2 to write
+ stubI2CWriteBytesRequest.BytesTWrite.Add(WORK_TENSION_LSB);//Byte 3 to write
+ stubI2CWriteBytesRequest.BytesTWrite.Add(WORK_TENSION_MSB);//Byte 4 to write
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(int i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- WORK TENSION AND OPERATION STATUS SET --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/30_ALARM_AND_ENABLING_STATUS_READ.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/30_ALARM_AND_ENABLING_STATUS_READ.cs
new file mode 100644
index 000000000..463538836
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/30_ALARM_AND_ENABLING_STATUS_READ.cs
@@ -0,0 +1,78 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x1C;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 6;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = YES;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ int i = 0;
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead + Verify_Received_CheckSum;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead - Verify_Received_CheckSum;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+ if((Verify_Received_CheckSum == YES) && (response1.ReadBytes[i] != 0))//use the next (unused) byte to return the checksum status
+ {
+ stubManager.WriteLine("\n --- Received Wrong CheckSum !!! --- \n");
+ }
+
+
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- ALARM AND ENABLING STATUS READ --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/32_PC_LINK_READ.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/32_PC_LINK_READ.cs
new file mode 100644
index 000000000..a84c626b7
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/32_PC_LINK_READ.cs
@@ -0,0 +1,77 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x3B;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 52;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = YES;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ int i = 0;
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead + Verify_Received_CheckSum;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead - Verify_Received_CheckSum;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+ if((Verify_Received_CheckSum == YES) && (response1.ReadBytes[i] != 0))//use the next byte to return the checksum status
+ {
+ stubManager.WriteLine("\n --- Received Wrong CheckSum !!! --- \n");
+ }
+
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- PC-LINK READ --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/35_ALARM_STATUS_RESET.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/35_ALARM_STATUS_RESET.cs
new file mode 100644
index 000000000..ec8431264
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/35_ALARM_STATUS_RESET.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x27;
+
+const byte STOP_OUT_CONFIG = 0x00;
+const byte CUSTOMISATION = 0x00;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 1;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = NO;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+ //DATA_STRING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0X04);//1° BYTE RESET_0 - 0X04 - D2 ‘1’ TENSION ERROR ALARM RESET
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//2° BYTE RESET_1 - NA
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0X00);//3° BYTE SPARE
+ stubI2CWriteBytesRequest.BytesTWrite.Add(0x00);//4° BYTE SPARE
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(int i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- ALARM STATUS RESET --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/36_RESETS_ALL_THE_COUNTERS.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/36_RESETS_ALL_THE_COUNTERS.cs
new file mode 100644
index 000000000..3f0f1bf50
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/36_RESETS_ALL_THE_COUNTERS.cs
@@ -0,0 +1,73 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x29;
+const byte DATA_STRING = 0x00;//COUNTER RESET ID (0 - Reset All)
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 1;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = NO;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(DATA_STRING);//Byte 2 to write
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(int i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- ERRORS COUNTER RESET --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/37_METERS_TOTAL_COUNTER_READ_LOW.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/37_METERS_TOTAL_COUNTER_READ_LOW.cs
new file mode 100644
index 000000000..f722e0dab
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/37_METERS_TOTAL_COUNTER_READ_LOW.cs
@@ -0,0 +1,71 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x16;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 6;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = YES;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(int i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- METERS TOTAL COUNTER READ (LOW RESOLUTION) --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/38_METERS_TOTAL_COUNTER_RESET_LOW.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/38_METERS_TOTAL_COUNTER_RESET_LOW.cs
new file mode 100644
index 000000000..9b1f7c441
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/38_METERS_TOTAL_COUNTER_RESET_LOW.cs
@@ -0,0 +1,73 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x06;
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 2;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED3ADD; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = NO;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 1 to write CODE_STRING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 2 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 3 to write FUNCTION_STRING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 4 to write FUNCTION_STRING
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 5 to write FUNCTION_STRING
+
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = NO;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(int i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- METERS TOTAL COUNTER RESET (LOW RESOLUTION) --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/39_METERS_TOTAL_COUNTER_READ_HIGH.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/39_METERS_TOTAL_COUNTER_READ_HIGH.cs
new file mode 100644
index 000000000..bcc77ba7c
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/39_METERS_TOTAL_COUNTER_READ_HIGH.cs
@@ -0,0 +1,71 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x1D;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 6;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = YES;//1 YES, 0 NO
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(int i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- METERS TOTAL COUNTER READ (HIGH RESOLUTION) --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/40_METERS_TOTAL_COUNTER_RESET_HIGH.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/40_METERS_TOTAL_COUNTER_RESET_HIGH.cs
new file mode 100644
index 000000000..c678cacfb
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/40_METERS_TOTAL_COUNTER_RESET_HIGH.cs
@@ -0,0 +1,71 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x1E;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 2;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = NO;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(int i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- METERS TOTAL COUNTER RESET (HIGH RESOLUTION) --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/41_METER_TOTAL_COUNTER_READ_HIGHEST.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/41_METER_TOTAL_COUNTER_READ_HIGHEST.cs
new file mode 100644
index 000000000..44f025f09
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/41_METER_TOTAL_COUNTER_READ_HIGHEST.cs
@@ -0,0 +1,71 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x47;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 6;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = YES;//1 YES, 0 NO
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(int i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- METERS TOTAL COUNTER READ (HIGHEST RESOLUTION) --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/42_METERS_TOTAL_COUNTER_RESET_HIGHEST.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/42_METERS_TOTAL_COUNTER_RESET_HIGHEST.cs
new file mode 100644
index 000000000..06979ba42
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/42_METERS_TOTAL_COUNTER_RESET_HIGHEST.cs
@@ -0,0 +1,71 @@
+using System;
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.PMR.Stubs;
+using Tango.Stubs;
+const byte YES = 0x01;
+const byte NO = 0x00;
+
+//--------------------------------------------------------------------------------------------------------------
+// ------ Request Parameters ------
+const byte CODE_STRING = 0x01;//BTSR ID
+
+const byte FUNCTION_STRING = 0x48;
+
+const Int32 Auto_Calc_CheckSum = YES;//1 YES, 0 NO //if YES Don't send the checksum Bytes!!!!
+
+// ------ Response Parameters ------
+const Int32 BytesToRead = 2;//Number of the expected Bytes to read (iclude CHECK_STRING if available)
+const Int32 Verify_Received_CheckSum = NO;//1 YES, 0 NO --- TBD NA ---
+//--------------------------------------------------------------------------------------------------------------
+int BTSR_Write_and_Read()
+{
+ StubI2CWriteBytesRequest stubI2CWriteBytesRequest = new StubI2CWriteBytesRequest();
+ stubI2CWriteBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script identification)
+ stubI2CWriteBytesRequest.SlaveAddress = Auto_Calc_CheckSum;
+
+ UInt32 uInt32 = new UInt32();
+ //--------------------------------------------------------------
+ stubI2CWriteBytesRequest.BytesTWrite.Add(CODE_STRING);//Byte 0 to write CODE_STRING
+
+ stubI2CWriteBytesRequest.BytesTWrite.Add(FUNCTION_STRING);//Byte 1 to write FUNCTION_STRING
+
+ var response = stubManager.Run<StubI2CWriteBytesResponse>(stubI2CWriteBytesRequest);
+
+ return 1;
+}
+
+
+int BTSR_Get()
+{
+ StubI2CReadBytesRequest stubI2CReadBytesRequest = new StubI2CReadBytesRequest();
+ stubI2CReadBytesRequest.I2CId = 0xFEED; // - Don't Change!! BTSR FEEDR (Script indentify)
+ stubI2CReadBytesRequest.SlaveAddress = Verify_Received_CheckSum;
+ stubI2CReadBytesRequest.NumberOfBytesToRead = BytesToRead;
+
+ var response1 = stubManager.Run<StubI2CReadBytesResponse>(stubI2CReadBytesRequest);
+ uint temph=0;
+
+ for(int i=0; i<stubI2CReadBytesRequest.NumberOfBytesToRead;i++)
+ {
+ temph=response1.ReadBytes[i];
+ stubManager.WriteLineHex(temph,2);
+ }
+
+ return 1;
+}
+
+
+public void OnExecute(StubManager stubManager)
+{
+ BTSR_Write_and_Read();
+ Thread.Sleep(15); //wait 10mSec in the embedded to read all at once so this value must be > 10 milli.
+ stubManager.WriteLine("\n --- METERS TOTAL COUNTER RESET (HIGHEST RESOLUTION) --- \n");
+ BTSR_Get();
+} \ No newline at end of file
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/FILENAME.TXT b/Software/Stubs Collection/stubs/Scripts/BTSR/FILENAME.TXT
new file mode 100644
index 000000000..2d65ae591
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/FILENAME.TXT
@@ -0,0 +1,35 @@
+ Volume in drive C is OS
+ Volume Serial Number is B816-D6EE
+
+ Directory of C:\Scripts\BTSR
+
+17/12/2020 10:57 <DIR> .
+17/12/2020 10:57 <DIR> ..
+07/12/2020 16:55 2,517 10_DEVICE_INFORMATION_READ.cs
+07/12/2020 16:55 3,571 11_DEVICE_CALIBRATION.cs
+08/12/2020 14:01 2,716 13_BAUDRATE_SET.cs
+08/12/2020 13:57 2,732 14_DISPLAY_LANGUAGE_SET.cs
+15/12/2020 16:09 4,080 15_CONFIGURATION_SET.cs
+08/12/2020 14:36 2,920 17_ADVANCED_CONFIGURATION_SET.cs
+07/12/2020 14:02 2,953 18_ADVANCED_PROGRAMMING_READ.cs
+08/12/2020 14:43 3,369 20_INPUT_CURRENT_CONTROL_SET.cs
+07/12/2020 14:02 5,166 21_ADVANCED_TENSION_PROGRAMMING.cs
+07/12/2020 16:56 2,784 23_ADVANCED_TENSION_READ.cs
+08/12/2020 15:33 4,107 25_ADVANCED_STYLE_LOAD.cs
+07/12/2020 16:56 2,895 27_APPLICATION_AND_YARN_TYPOLOGY_SET.cs
+07/12/2020 16:56 2,963 28_APPLICATION_AND_YARN_TYPOLOGY_READ.cs
+07/12/2020 16:55 2,888 29_WORK_TENSION_AND_OPERATION_STATUS_SET.cs
+07/12/2020 16:56 2,805 30_ALARM_AND_ENABLING_STATUS_READ.cs
+15/12/2020 17:56 2,775 32_PC_LINK_READ.cs
+08/12/2020 14:50 2,919 35_ALARM_STATUS_RESET.cs
+07/12/2020 16:55 2,652 36_RESETS_ALL_THE_COUNTERS.cs
+08/12/2020 15:03 2,537 37_METERS_TOTAL_COUNTER_READ_LOW.cs
+07/12/2020 16:55 2,673 38_METERS_TOTAL_COUNTER_RESET_LOW.cs
+08/12/2020 15:05 2,524 39_METERS_TOTAL_COUNTER_READ_HIGH.cs
+07/12/2020 16:55 2,536 40_METERS_TOTAL_COUNTER_RESET_HIGH.cs
+08/12/2020 15:07 2,527 41_METER_TOTAL_COUNTER_READ_HIGHEST.cs
+07/12/2020 16:55 2,539 42_METERS_TOTAL_COUNTER_RESET_HIGHEST.cs
+17/12/2020 10:57 0 FILENAME.TXT
+13/12/2020 16:28 934 test gpio uart 4.cs
+ 26 File(s) 73,082 bytes
+ 2 Dir(s) 879,044,513,792 bytes free
diff --git a/Software/Stubs Collection/stubs/Scripts/BTSR/test gpio uart 4.cs b/Software/Stubs Collection/stubs/Scripts/BTSR/test gpio uart 4.cs
new file mode 100644
index 000000000..724d51099
--- /dev/null
+++ b/Software/Stubs Collection/stubs/Scripts/BTSR/test gpio uart 4.cs
@@ -0,0 +1,35 @@
+
+using System.Text;
+using System.Linq;
+using System.Drawing;
+using System.Diagnostics;
+using System.Windows.Forms;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Collections.Generic;
+using Tango.Stubs;
+
+public void OnExecute(StubManager stubManager)
+{
+
+ //RX
+ stubManager.Run("StubGPIOWriteBitRequest" ,"A", 2, false, false);//Set as output
+
+ while(true)
+ {
+ //TX
+
+ stubManager.Run("StubGPIOWriteBitRequest" ,"A", 3, true);//ON
+ stubManager.Run("StubGPIOWriteBitRequest" ,"R", 0, true);//OFF
+ stubManager.Run("StubGPIOWriteBitRequest" ,"A", 2, true);//ON
+ Thread.Sleep(50);
+ stubManager.Run("StubGPIOWriteBitRequest" ,"A", 3, false);//OFF
+ stubManager.Run("StubGPIOWriteBitRequest" ,"R", 0, true);//ON
+ stubManager.Run("StubGPIOWriteBitRequest" ,"A", 2, false);//OFF
+ Thread.Sleep(50);
+
+
+
+ }
+}
+