This commit is contained in:
luciomaranta
2020-06-25 13:02:17 +02:00
23 changed files with 11350 additions and 11786 deletions
+1 -6
View File
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
namespace CMS_CORE_Library.Demo.Models
{
+1 -6
View File
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
namespace CMS_CORE_Library.Demo.Models
{
+1 -6
View File
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
namespace CMS_CORE_Library.Demo.Models
{
+1 -7
View File
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CMS_CORE_Library.Demo.Models
namespace CMS_CORE_Library.Demo.Models
{
class NcDataModel
{
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CMS_CORE_Library.Demo.Models
namespace CMS_CORE_Library.Demo.Models
{
class NcProcessModel
{
@@ -1,6 +1,5 @@
using CMS_CORE_Library.Models;
using System.Collections.Generic;
using static CMS_CORE_Library.Models.DataStructures;
namespace CMS_CORE_Library.Demo.Models
{
File diff suppressed because it is too large Load Diff
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CMS_CORE_Library.Exceptions
{
+8 -8
View File
@@ -1573,7 +1573,7 @@ namespace CMS_CORE_Library.Fanuc
public override CmsError PLC_RToolMovement(ref MovementBetweenMagazinesModel toolMovement)
{
List<ushort> values = new List<ushort>();
CmsError cmsError = MEM_RWWordList(R, 0, TOOL_MOVEMENT_AREA.MemType, TOOL_MOVEMENT_AREA.Address, TOOL_MOVEMENT_AREA.Size/2, ref values);
CmsError cmsError = MEM_RWWordList(R, 0, TOOL_MOVEMENT_AREA.MemType, TOOL_MOVEMENT_AREA.Address, TOOL_MOVEMENT_AREA.Size / 2, ref values);
if (cmsError.IsError())
return cmsError;
@@ -3125,10 +3125,10 @@ namespace CMS_CORE_Library.Fanuc
nReturn = Focas1.cnc_rdpdf_subdirn(nLibHandle[0], absolutePath, dataNum);
if (nReturn != 0)
return GetNcError(nReturn);
short maxFiles = 1;
// Check if there are directories
if(dataNum.dir_num > 0)
if (dataNum.dir_num > 0)
{
IDBPDFSDIR funcInput = new IDBPDFSDIR();
ODBPDFSDIR dirData = new ODBPDFSDIR();
@@ -3156,7 +3156,7 @@ namespace CMS_CORE_Library.Fanuc
}
// Check if there are files
if (dataNum.file_num > 0 )
if (dataNum.file_num > 0)
{
IDBPDFADIR funcInput = new IDBPDFADIR();
ODBPDFADIR fileData = new ODBPDFADIR();
@@ -3615,7 +3615,7 @@ namespace CMS_CORE_Library.Fanuc
cmsError = TOOLS_RMagazineStatus(ref magazineStatus);
if (cmsError.IsError())
return cmsError;
config.Magazines = conf.Select(x => new SiemensMagazineConfigModel()
{
Id = x.Id,
@@ -5486,7 +5486,7 @@ namespace CMS_CORE_Library.Fanuc
internal static MEMORY_CELL M154_SWITCH_ONOFF = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, STARTING_ADDRESS, 1, 2);
internal static MEMORY_CELL M154_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, STARTING_ADDRESS + 3031, 1);
internal static MEMORY_CELL M154_STROBE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, STARTING_ADDRESS + 3032, 1);
internal static MEMORY_CELL M156_INPUT_NEEDED = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 23053, 1);
internal static MEMORY_CELL M156_INPUT_ACK = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 23054, 1);
internal static MEMORY_CELL M156_INPUT_STROBE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 23055, 1);
@@ -5529,7 +5529,7 @@ namespace CMS_CORE_Library.Fanuc
internal static MEMORY_CELL TOOL_MOVEMENT_AREA = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, STARTING_ADDRESS + 4019, 1, 12);
internal static MEMORY_CELL TOOL_MOVEMENT_STROBE_END= new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, STARTING_ADDRESS + 4020, 1, 0);
internal static MEMORY_CELL TOOL_MOVEMENT_STROBE_END = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, STARTING_ADDRESS + 4020, 1, 0);
internal static MEMORY_CELL TOOL_MOVEMENT_HMI_RESPONSE = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, STARTING_ADDRESS + 4030, 1, 12);
// Tool table indexes
@@ -5551,6 +5551,6 @@ namespace CMS_CORE_Library.Fanuc
// Machine number
internal static MEMORY_CELL MATR_MACCH_FANUC = new MEMORY_CELL(MEMORY_TYPE.Fanuc_D, 4018, 0, 1);
internal static MEMORY_CELL NEW_MATR_MACCH = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 23049 , 0, 1);
internal static MEMORY_CELL NEW_MATR_MACCH = new MEMORY_CELL(MEMORY_TYPE.Fanuc_R, 23049, 0, 1);
}
}
File diff suppressed because it is too large Load Diff
@@ -172,6 +172,10 @@ namespace CMS_CORE_Library.Models
public static CmsError NO_ERROR = new CmsError(CMS_ERROR_CODES.OK, "");
public static CmsError NOT_CONNECTED_ERROR = new CmsError(CMS_ERROR_CODES.NOT_CONNECTED, "error_not_connected");
public static CmsError NOT_FOUND_ERROR = new CmsError(CMS_ERROR_CODES.INTERNAL_ERROR, "error_not_found");
public static CmsError S7_PLC_EMPTY_READ = new CmsError(CMS_ERROR_CODES.PLC_MEM_CONF_ERROR, "error_s7_empy_data");
public static CmsError S7_PLC_WRONG_DATA = new CmsError(CMS_ERROR_CODES.PLC_MEM_CONF_ERROR, "error_s7_wrong_data");
public static CmsError S7_PLC_READ_ERROR = new CmsError(CMS_ERROR_CODES.PLC_MEM_CONF_ERROR, "error_s7_read_error");
public static CmsError S7_PLC_WRITE_ERROR = new CmsError(CMS_ERROR_CODES.PLC_MEM_CONF_ERROR, "error_s7_write_error");
public static CmsError PROC_NOT_FOUND_ERROR = new CmsError(CMS_ERROR_CODES.FUNCTION_NOT_ALLOWED, "error_process_not_found");
public static CmsError FUNCTION_NOT_ALLOWED_ERROR = new CmsError(CMS_ERROR_CODES.FUNCTION_NOT_ALLOWED, "error_function_not_allowed");
public static CmsError BIT_NOT_IN_RANGE_ERROR = new CmsError(CMS_ERROR_CODES.BIT_NOT_IN_RANGE, "error_bit_not_in_range");
+23 -3
View File
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CMS_CORE_Library.Models
{
@@ -245,6 +242,29 @@ namespace CMS_CORE_Library.Models
{
return base.GetHashCode();
}
/// <summary>
/// Converte un singolo item in un array di byte per scrittura su PLC S7
/// </summary>
/// <returns></returns>
public byte[] convertToByte()
{
byte[] answ = new byte[50];
Buffer.BlockCopy(S7.Net.Types.Int.ToByteArray(NumTarget), 0, answ, 0, 2);
Buffer.BlockCopy(S7.Net.Types.Int.ToByteArray(NumDone), 0, answ, 2, 2);
Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeWarm), 0, answ, 6, 4);
Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeVent), 0, answ, 10, 4);
Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeVacuum), 0, answ, 14, 4);
Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeCycleGross), 0, answ, 18, 4);
Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(TimeCycleNet), 0, answ, 22, 4);
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MaterialTempEndWarm), 0, answ, 26, 4);
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MaterialTempEndVent), 0, answ, 30, 4);
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MoldTemp), 0, answ, 34, 4);
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(VacuumReadVal), 0, answ, 38, 4);
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MouldEnergyOUT), 0, answ, 42, 4);
Buffer.BlockCopy(S7.Net.Types.Double.ToByteArray(MouldEnergyIN), 0, answ, 46, 4);
return answ;
}
}
public class ProdCycleModel
+1 -1
View File
@@ -2056,7 +2056,7 @@ namespace CMS_CORE_Library
internal MEMORY_CELL PARAM_LING_FANUC = new MEMORY_CELL(MEMORY_TYPE.Null, 3281, 0, 1);
internal MEMORY_CELL PARAM_LING_FANUC_W = new MEMORY_CELL(MEMORY_TYPE.Fanuc_G, 581, 0, 1);
#endregion Fixed memory area
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+8 -2
View File
@@ -7,7 +7,6 @@ using System.IO;
using System.Reflection;
using static CMS_CORE_Library.Models.DataStructures;
using static CMS_CORE_Library.Nc;
using static CMS_CORE_Library.Nc.MEMORY_TYPE;
namespace CMS_CORE_Library
{
@@ -640,7 +639,7 @@ namespace CMS_CORE_Library
/// </summary>
/// <returns></returns>
public abstract CmsError PLC_WAckProdUpdate();
/// <summary>
/// Get current recipe parameter list
/// </summary>
@@ -725,6 +724,13 @@ namespace CMS_CORE_Library
/// <returns></returns>
public abstract CmsError PLC_RProdInfo(ref ThermoModels.ProdInfoModel currProdInfo);
/// <summary>
/// Set ProdInfo data
/// </summary>
/// <param name="numTarget">Qty requested (target)</param>
/// <param name="doReset">Reset counter (actual counter)</param>
/// <returns></returns>
public abstract CmsError PLC_WProdInfo(short NumTarget, bool doReset);
/// <summary>
/// Get current Production Cycle data
/// </summary>
/// <param name="currProdCycle"></param>
+48 -50
View File
@@ -7,16 +7,13 @@ using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.ServiceModel;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Windows.Forms;
using static CMS_CORE_Library.Models.DataStructures;
using static CMS_CORE_Library.Nc;
using static CMS_CORE_Library.Osai.MEMORY_ADDRESS;
@@ -52,7 +49,7 @@ namespace CMS_CORE_Library.Osai
//private const string TOOL_MANAGER_DIRECTORY_PATH = @"active\OEM\CMS\SYS\ACTIVE\";
private static List<string> EXT_PP = new List<string>() { "", "TXT", "CNC", "INI" };
private static List<string> EXT_PP = new List<string>() { "", "TXT", "CNC", "INI" };
private static List<string> EXT_IMG = new List<string>() { "PNG", "JPG", "JPEG" };
private const uint MAX_ROWS_FILE_PREVIEW = 10; // massimo 10 righe
@@ -134,7 +131,7 @@ namespace CMS_CORE_Library.Osai
bool directoryFound = false;
CmsError cmsError = FileExist(TOOL_MANAGER_DIRECTORY_PATH, ref directoryFound);
if(cmsError.IsError())
if (cmsError.IsError())
return cmsError;
if (!directoryFound)
@@ -145,9 +142,9 @@ namespace CMS_CORE_Library.Osai
//// Check if tool manager folder exist
//nReturn = OpenNC.LogFSFindFirst(TOOL_MANAGER_DIRECTORY_PATH, out FILEFINDDATA findData, out uint finder, out errorClass, out errorNum);
////If there's an error
//if (errorClass != 0 || errorNum != 0 || nReturn == 0)
// return GetNCError(errorClass, errorNum);
////If there's an error
//if (errorClass != 0 || errorNum != 0 || nReturn == 0)
// return GetNCError(errorClass, errorNum);
}
catch (Exception ex)
{
@@ -346,7 +343,7 @@ namespace CMS_CORE_Library.Osai
MachNumber = Encoding.ASCII.GetString(lists.ToArray());
}
return NO_ERROR;
}
@@ -723,7 +720,7 @@ namespace CMS_CORE_Library.Osai
return NO_ERROR;
}
// MACHINE COUNTERS
public override CmsError PLC_RMachineCounters(ref List<CounterModel> counters)
{
@@ -893,7 +890,7 @@ namespace CMS_CORE_Library.Osai
return NO_ERROR;
}
public override CmsError PLC_RWorkedTimeHead(int head, ref uint time)
{
int index = (head - 1) * 2;
@@ -905,12 +902,12 @@ namespace CMS_CORE_Library.Osai
return NO_ERROR;
}
public override CmsError PLC_WResetWorkedTimeHead(int head)
{
ushort usControlWord = 0;
if(head <= 0 || head > MAX_HEADS_NUMBER)
if (head <= 0 || head > MAX_HEADS_NUMBER)
return INCORRECT_PARAMETERS_ERROR;
// Read status
@@ -952,12 +949,12 @@ namespace CMS_CORE_Library.Osai
bool bitValue = true;
int nTry = 0;
for (int i = 0; i<=4; i++)
for (int i = 0; i <= 4; i++)
{
//Scrivo il bit
bitValue = true;
nTry = 0;
cmsError = MEM_RWBoolean(W, 0, MACHINE_RESET_WORKED_TIME.MemType, MACHINE_RESET_WORKED_TIME.Address,0, ref bitValue);
cmsError = MEM_RWBoolean(W, 0, MACHINE_RESET_WORKED_TIME.MemType, MACHINE_RESET_WORKED_TIME.Address, 0, ref bitValue);
if (cmsError.IsError())
return cmsError;
@@ -1125,9 +1122,9 @@ namespace CMS_CORE_Library.Osai
// Parse line & get parameters
value.Add(new M156InputIsNeededModel()
{
Process = (uint)processId,
Id = vals.ElementAt(processId - 1),
Value = responseVal
Process = (uint)processId,
Id = vals.ElementAt(processId - 1),
Value = responseVal
});
}
}
@@ -1178,7 +1175,7 @@ namespace CMS_CORE_Library.Osai
TimerInputNeeded = true,
CountdownIsActive = false,
Timer = 0
});
});
}
else if (countdownActiveNeeded[processId - 1])
{
@@ -1284,7 +1281,7 @@ namespace CMS_CORE_Library.Osai
case "MD": Type = MEMORY_TYPE.Osai_MD; break;
case "GD": Type = MEMORY_TYPE.Osai_GD; break;
};
index = index[1].Split('.');
try
@@ -1330,7 +1327,7 @@ namespace CMS_CORE_Library.Osai
}
}
catch(Exception ex)
catch (Exception ex)
{
return ManageException(ex);
}
@@ -1470,7 +1467,7 @@ namespace CMS_CORE_Library.Osai
}
public override CmsError PLC_WTerminateAssistedToolingProcedure()
{
{
// Terminate procedure with ACK-STROBE method
CmsError cmsError = PLC_ManageActiveAck(PLC_ASSISTED_TOOLING_STROBE.Address, PLC_ASSISTED_TOOLING_STROBE.SubAddress,
HMI_ASSISTED_TOOLING_ACK.Address, HMI_ASSISTED_TOOLING_ACK.SubAddress,
@@ -1697,7 +1694,7 @@ namespace CMS_CORE_Library.Osai
return cmsError;
// Build Long value
value = ((long)word << 32) + firtInt;
value = ((long)word << 32) + firtInt;
return NO_ERROR;
}
@@ -2072,10 +2069,10 @@ namespace CMS_CORE_Library.Osai
OffsetModel offsetData = new OffsetModel();
// Read offset data
if(info.actualtooloff != 0)
if (info.actualtooloff != 0)
cmsError = TOOLS_ROffset((short)info.actualtooloff, ref offsetData);
if (cmsError.IsError())
return cmsError;
if (cmsError.IsError())
return cmsError;
processData = new SelectedProcessData()
{
@@ -2090,11 +2087,11 @@ namespace CMS_CORE_Library.Osai
return NO_ERROR;
}
catch(Exception ex)
catch (Exception ex)
{
return ManageException(ex);
}
}
#endregion PROCESS (PATH) High-level data
@@ -2440,11 +2437,11 @@ namespace CMS_CORE_Library.Osai
//if (errorClass != 0 || errorNum != 0 || nReturn == 0)
// return GetNCError(errorClass, errorNum);
// Read axes info from NC
// Read axes info from NC
nReturn = OpenNC.GetAxesInfo3(ushort.MaxValue, ref axesNumber, out unsignedshortarray axesProcess, out byte[] axesName, out unsignedshortarray axesType, out unsignedshortarray axesInterface, out uint errorClass, out uint errorNum);
if (errorClass != 0 || errorNum != 0 || nReturn == 0)
return GetNCError(errorClass, errorNum);
// Get from PLC which axis can be selected
List<byte> ids = new List<byte>();
List<int> ints = new List<int>();
@@ -2461,7 +2458,7 @@ namespace CMS_CORE_Library.Osai
if ((charName < 'a' || charName > 'z') && charName != 'S' && charName != '\0' && axesProcess[i] == process)
{
var isVisible = ids.Where(x => x == i + 1)?.FirstOrDefault() == 0 ? false : true;
if(isVisible)
if (isVisible)
// Add to returned value
axesData.Add(new AxisModel()
{
@@ -2511,7 +2508,7 @@ namespace CMS_CORE_Library.Osai
public override CmsError AXES_ROrigin(int numberOfAxes)
{
for(uint i = 1; i <= 100; i++)
for (uint i = 1; i <= 100; i++)
{
OpenNC.GetOriginTabRecordII(i, out ORIGINTABLEII recordBuff, out uint errClass, out uint errNum);
}
@@ -3189,7 +3186,7 @@ namespace CMS_CORE_Library.Osai
return NO_ERROR;
}
catch(Exception ex)
catch (Exception ex)
{
return ManageException(ex);
}
@@ -3247,7 +3244,7 @@ namespace CMS_CORE_Library.Osai
//If there's an error launch exception
if (errorClass != 0 || errorNum != 0 || nReturn == 0)
return GetNCError(errorClass, errorNum);
}
}
catch (Exception ex)
{
return ManageException(ex);
@@ -3421,7 +3418,7 @@ namespace CMS_CORE_Library.Osai
CmsError cmsError = FILES_WProgram(newFilePath, customPartProgramContent);
if (cmsError.IsError())
return cmsError;
// Activate custom file
return FILES_WSetActiveProgram(processId, newFilePath, ref activeData);
}
@@ -3478,7 +3475,7 @@ namespace CMS_CORE_Library.Osai
Id = x.Id,
Type = ConvertToSiemensMagazineType(x.Type),
Name = x.Id.ToString(),
LoadingIsActive = x.Type != NC_MAGAZINE_TYPE.MAGAZINE_TOOL_BUFFER,
LoadingIsActive = x.Type != NC_MAGAZINE_TYPE.MAGAZINE_TOOL_BUFFER,
MaxPositions = x.MaxPositions
}).ToList();
@@ -3744,7 +3741,7 @@ namespace CMS_CORE_Library.Osai
CmsError cmsError = CheckConnection();
if (cmsError.IsError())
return cmsError;
cmsError = CreateBackup();
if (cmsError.IsError())
return cmsError;
@@ -4012,7 +4009,7 @@ namespace CMS_CORE_Library.Osai
CmsError cmsError = CheckConnection();
if (cmsError.IsError())
return cmsError;
ushort nReturn;
try
@@ -4076,7 +4073,7 @@ namespace CMS_CORE_Library.Osai
offsetData.LenVal[0].ValOrig = offset.Length * divider;
offsetData.LenVal[0].ActChangeVal = offset.WearLength * divider;
for(int i = 0; i < offset.CustomDouble.Count(); i++)
for (int i = 0; i < offset.CustomDouble.Count(); i++)
{
offsetData.Duser[i] = offset.CustomDouble[i];
offsetData.Suser[i] = offset.CustomInt[i];
@@ -4317,7 +4314,7 @@ namespace CMS_CORE_Library.Osai
return cmsError;
bool[] values = IntToBits(val);
for(int i = 0; i < values.Length; i++ )
for (int i = 0; i < values.Length; i++)
{
if (values[i])
ids.Add(i);
@@ -4707,13 +4704,14 @@ namespace CMS_CORE_Library.Osai
//Read From Files
PlcMessages = File.ReadAllLines(Path)
.Select(line => line.Split(','))
.ToDictionary(line => Convert.ToInt32(line[0]), line => {
.ToDictionary(line => Convert.ToInt32(line[0]), line =>
{
if (line.Count() > 1)
return line[1];
return "";
});
});
return NO_ERROR;
}
catch (Exception ex)
@@ -4802,7 +4800,7 @@ namespace CMS_CORE_Library.Osai
//Manage the Exception Launch
private CmsError ManageException(Exception ex)
{
{
Connected = false;
//Catch the .Net exceptions
@@ -4819,7 +4817,7 @@ namespace CMS_CORE_Library.Osai
Connected = false;
return NOT_CONNECTED_ERROR;
}
else if(errorClass == 23)
else if (errorClass == 23)
{
return NO_ERROR;
}
@@ -5086,7 +5084,7 @@ namespace CMS_CORE_Library.Osai
{
switch (errorNum)
{
case 1: szErrorDesc = "file_not_valid";break;
case 1: szErrorDesc = "file_not_valid"; break;
case 161: szErrorDesc = "file_not_valid"; break;
}
}
@@ -5212,11 +5210,11 @@ namespace CMS_CORE_Library.Osai
internal static MEMORY_CELL SELF_ADAPTIVE_PATH = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 3472, 4);
// Assisted tooling
internal static MEMORY_CELL ASSISTED_TOOLING_DATA = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 4512, 7);
internal static MEMORY_CELL HMI_ASSISTED_TOOLING_STROBE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 4518, 0, 1);
internal static MEMORY_CELL HMI_ASSISTED_TOOLING_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 4518, 1, 1);
internal static MEMORY_CELL ASSISTED_TOOLING_DATA = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 4512, 7);
internal static MEMORY_CELL HMI_ASSISTED_TOOLING_STROBE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 4518, 0, 1);
internal static MEMORY_CELL HMI_ASSISTED_TOOLING_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 4518, 1, 1);
internal static MEMORY_CELL PLC_ASSISTED_TOOLING_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 4519, 1, 1);
internal static MEMORY_CELL PLC_ASSISTED_TOOLING_ACK = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 4519, 1, 1);
internal static MEMORY_CELL PLC_ASSISTED_TOOLING_STROBE = new MEMORY_CELL(MEMORY_TYPE.Osai_MW, 4519, 1, 1);
}
+5 -9
View File
@@ -1,18 +1,14 @@
using CndexLinkDotNet;
using CMS_CORE_Library.OPENControl;
using CndexLinkDotNet;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using CMS_CORE_Library.OPENControl;
namespace CMS_CORE_Library.Osai
{
partial class NativeConstants
{
//NUM_LINE_PER_MSG -> 4
//NUM_LINE_PER_MSG -> 4
public const int NUM_LINE_PER_MSG = 4;
//NUM_WCHAR_PER_LINE -> 512
@@ -38,7 +34,7 @@ namespace CMS_CORE_Library.Osai
return new MESSAGE_TEXT() { Line1 = value, Line2 = value, Line3 = value, Line4 = value };
}
}
class OSAIErrorManagerLibrary
{
/// <summary>
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Le informazioni generali relative a un assembly sono controllate dal seguente
File diff suppressed because it is too large Load Diff
+31 -31
View File
@@ -9,7 +9,6 @@ using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Windows.Forms;
using System.Xml.Linq;
using static CMS_CORE_Library.Models.DataStructures;
using static CMS_CORE_Library.Nc;
@@ -198,7 +197,7 @@ namespace CMS_CORE_Library.Siemens
Connected = true;
// InitializeSiemens objects
if(this.EnableAxes)
if (this.EnableAxes)
{
if (AxesSvc == null)
AxesSvc = new DataSvc();
@@ -529,7 +528,7 @@ namespace CMS_CORE_Library.Siemens
var splittedFileName = fileName.Split('_');
if (splittedFileName.Count() == 2)
{
if(splittedFileName[0].ToLower() == "cmsalarm")
if (splittedFileName[0].ToLower() == "cmsalarm")
{
// Get lang from threeletter
var lang = GetCultureFromThreeLetter(splittedFileName[1]);
@@ -786,7 +785,7 @@ namespace CMS_CORE_Library.Siemens
var a = fileSvc.ReadMdaBuffer(1);
fileSvc.WriteMdaBuffer(processId, mdiString);
}
catch(Exception ex)
catch (Exception ex)
{
return ManageException(ex);
}
@@ -1145,10 +1144,10 @@ namespace CMS_CORE_Library.Siemens
short toolId = SwapShortEndianFormat(BitConverter.ToInt16(readValues.ToArray(), headOffset + 4));
double residualLife = 0;
// Find tool
var tool = ToolTableData.Where(x => x.Id == toolId).FirstOrDefault();
// Check if process is selected
if (readValues[headOffset] != 0)
{
@@ -1170,7 +1169,7 @@ namespace CMS_CORE_Library.Siemens
residualLife = edge.ResidualLife;
}
}
catch(Exception ex)
catch (Exception ex)
{
return ManageException(ex);
}
@@ -1551,7 +1550,7 @@ namespace CMS_CORE_Library.Siemens
DataSvc dataSvc = new DataSvc();
dataSvc.Read(item);
}
catch(Exception ex)
catch (Exception ex)
{
return ManageException(ex);
}
@@ -1650,7 +1649,7 @@ namespace CMS_CORE_Library.Siemens
value = val;
}
}
catch(Exception ex)
catch (Exception ex)
{
return ManageException(ex);
}
@@ -1805,7 +1804,7 @@ namespace CMS_CORE_Library.Siemens
{
return ManageException(ex);
}
return NO_ERROR;
}
@@ -2098,7 +2097,7 @@ namespace CMS_CORE_Library.Siemens
return cmsError;
byte readValues = 0;
cmsError = MEM_RWByte(R, 0, ACTIVE_CLIENT.MemType, ACTIVE_CLIENT.Address, ACTIVE_CLIENT.SubAddress, 0,ref readValues);
cmsError = MEM_RWByte(R, 0, ACTIVE_CLIENT.MemType, ACTIVE_CLIENT.Address, ACTIVE_CLIENT.SubAddress, 0, ref readValues);
if (cmsError.IsError())
return cmsError;
@@ -2118,7 +2117,7 @@ namespace CMS_CORE_Library.Siemens
{
return FUNCTION_NOT_ALLOWED_ERROR;
}
public override CmsError PLC_WTerminateMovementProcedure(MOVEMENT_RESPONSE resp)
{
return FUNCTION_NOT_ALLOWED_ERROR;
@@ -2434,7 +2433,7 @@ namespace CMS_CORE_Library.Siemens
new Item { Path = "/Tool/Compensation/edgeData[u1,c"+ actualToolId +","+ (offsetEdge + 15) + "]" } // $TC_DP15
};
dataSvc.Read(itemsToolEdge);
dataSvc.Read(itemsToolEdge);
offset = new OffsetModel()
{
@@ -2497,7 +2496,7 @@ namespace CMS_CORE_Library.Siemens
ProcessMessage = "",
WorkOverride = Convert.ToByte(items[3].Value),
RapidOverride = Convert.ToByte(items[4].Value),
OffsetData = offset,
OffsetData = offset,
FeedOverride = Convert.ToDouble(items[5].Value)
};
}
@@ -2738,7 +2737,7 @@ namespace CMS_CORE_Library.Siemens
int processAxes = Convert.ToInt32(ncAxes[i].Value);
// If axis is visible, add it to the output
if (processAxes == channel && axesAreVisible[i])
{
{
// Check if axes is configurated axes
var axis = configuredAxes.Where(x => x.Id == (i + 1)).FirstOrDefault();
if (axis != null)
@@ -2814,8 +2813,8 @@ namespace CMS_CORE_Library.Siemens
List<AxisModel> axes = new List<AxisModel>();
CmsError cmsError = AXES_RAxesNames(1, ref axes);
for(int i = 1; i <= 4; i++)
for (int i = 1; i <= 4; i++)
{
foreach (var axis in axes)
{
@@ -4469,14 +4468,14 @@ namespace CMS_CORE_Library.Siemens
// Check if tool can fit in the position considering disabled positions
if (magConfig.Type != SIEMENS_MAGAZINE_TYPE.BOX_MAGAZINE)
{
foreach(var pos in MagazinePositionsData)
foreach (var pos in MagazinePositionsData)
{
if (pos.Disabled && pos.MagazineId == magazineId)
{
// If magazine is circular, move position before ( for left case ) or after ( right case ) the location you want to mount the tool
var right = pos.PositionId < newMagazineTool.PositionId ? pos.PositionId + magConfig.MaxPositions : pos.PositionId;
var left = pos.PositionId > newMagazineTool.PositionId ? pos.PositionId - magConfig.MaxPositions : pos.PositionId;
// Calculate right space needed
double rightToBeMount = newMagazineTool.PositionId + ((tool as SiemensToolModel).RightSize / 2.0);
if (right < rightToBeMount)
@@ -4493,11 +4492,11 @@ namespace CMS_CORE_Library.Siemens
else
{
// Check if near positions are disabled
var posizionDisabled = MagazinePositionsData.Where(
x => x.MagazineId == magazineId && x.Disabled == true &&
((x.PositionId > newMagazineTool.PositionId && x.PositionId <= newMagazineTool.PositionId + (tool as SiemensToolModel).RightSize / 2.0)
|| (x.PositionId < newMagazineTool.PositionId && x.PositionId >= newMagazineTool.PositionId - (tool as SiemensToolModel).LeftSize / 2.0)))
.ToList();
var posizionDisabled = MagazinePositionsData.Where(
x => x.MagazineId == magazineId && x.Disabled == true &&
((x.PositionId > newMagazineTool.PositionId && x.PositionId <= newMagazineTool.PositionId + (tool as SiemensToolModel).RightSize / 2.0)
|| (x.PositionId < newMagazineTool.PositionId && x.PositionId >= newMagazineTool.PositionId - (tool as SiemensToolModel).LeftSize / 2.0)))
.ToList();
if (posizionDisabled.Count() > 0)
return MAGAZINE_POSITION_OCCUPIED_ERROR;
@@ -4739,7 +4738,7 @@ namespace CMS_CORE_Library.Siemens
public override CmsError TOOLS_WStartTDIUnloading(ushort magazineId, ushort positionId, ushort toolId)
{
var mountedTool = MagazineMountedTools.Where(x => x.ToolId == toolId).FirstOrDefault();
if(mountedTool == null || (mountedTool.ToolId != toolId && mountedTool.PositionId != positionId))
if (mountedTool == null || (mountedTool.ToolId != toolId && mountedTool.PositionId != positionId))
return INCORRECT_PARAMETERS_ERROR;
List<ushort> words = new List<ushort>()
@@ -4808,13 +4807,14 @@ namespace CMS_CORE_Library.Siemens
if (edge.EdgeAdditionalParams.ContainsKey(conf.Name) && toolEdgesConfig.TDIEdgeFields.ContainsKey(conf.Path))
{
var formattedValue = GetSiemensFormattedDouble(edge.EdgeAdditionalParams[conf.Name]);
items.Add(new Item() {
items.Add(new Item()
{
Path = string.Format(toolEdgesConfig.TDIEdgeFields[conf.Path], BALLUF_EMPTY_TABLE.Address),
Value = formattedValue
});
}
}
// Life Parameters
switch (tool.LifeType)
{
@@ -4864,7 +4864,7 @@ namespace CMS_CORE_Library.Siemens
return BitConverter.ToUInt32(byteVal, 0);
}
public override CmsError TOOLS_WAbortBallufTablet()
{
return WBallufAction(SIEMENS_TDI_ACTION.ABORT);
@@ -5117,7 +5117,7 @@ namespace CMS_CORE_Library.Siemens
{
return FUNCTION_NOT_ALLOWED_ERROR;
}
public override CmsError TOOLS_RAdatpivePathStep(ref Byte step)
{
// Check ACK
@@ -6533,7 +6533,7 @@ namespace CMS_CORE_Library.Siemens
int magazineId = Convert.ToInt32(item[0].Value);
int positionId = Convert.ToInt32(item[1].Value);
if(magazineId != 0 && positionId != 0)
if (magazineId != 0 && positionId != 0)
MoveToolInMagazineList(newTool.Id, magazineId, positionId);
}
//*SHANK FIX*else if (MULTITOOL_OPTION_ACTIVE)
@@ -6568,7 +6568,7 @@ namespace CMS_CORE_Library.Siemens
new Item(){ Path = string.Format("/Tool/Data/toolInPlace[{0}]", toolInfo.tNo) }
};
dataSvc.Read(item);
int magazineId = Convert.ToInt32(item[0].Value);
int positionId = Convert.ToInt32(item[1].Value);
+2 -2
View File
@@ -130,7 +130,7 @@ namespace CMS_CORE_Library
{6, "loading_station" },
{7, "loading_point" }
};
private static Dictionary<int, string> cmsRotationTypeList = new Dictionary<int, string>()
{
{0, "none"},
@@ -378,7 +378,7 @@ namespace CMS_CORE_Library
new FieldsConfiguration{ Name = "type", Type = "select", SelectValues = toolTypeCodeList, Category = "magPosType", ReadOnly = false, MinValue = 0, MaxValue = 0 },
new FieldsConfiguration{ Name = "disabled", Type = "boolean", SelectValues = null, Category = "general", ReadOnly = false, MinValue = 0, MaxValue = 0 }
};
public static EdgesConfiguration NcOffsetFieldsConfiguration = new EdgesConfiguration()
{
EdgeConfiguration = new List<FieldsConfiguration>()
+4 -6
View File
@@ -1,11 +1,9 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using static CMS_CORE_Library.Models.DataStructures;
@@ -167,9 +165,9 @@ namespace CMS_CORE_Library.Utils
return String.Empty;
}
// Convert one integer in array of bools
internal static bool[] IntToBits(int val)
internal static bool[] IntToBits(int val)
{
return IntToBits(new int[] { val });
}
@@ -243,7 +241,7 @@ namespace CMS_CORE_Library.Utils
{
string tmpString = codeLine;
if (endPos != -1)
tmpString = codeLine.Substring(startPos + 1 , endPos - startPos - 1);
tmpString = codeLine.Substring(startPos + 1, endPos - startPos - 1);
returnVal = tmpString.Trim(';').Split(',');
@@ -278,7 +276,7 @@ namespace CMS_CORE_Library.Utils
}
else
{
returnVal = new string[0];
returnVal = new string[0];
}
return returnVal;
+209 -166
View File
@@ -37,6 +37,7 @@
this.label3 = new System.Windows.Forms.Label();
this.txtMemSize = new System.Windows.Forms.TextBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.cmbOutType = new System.Windows.Forms.ComboBox();
this.txtNumRep = new System.Windows.Forms.TextBox();
this.label13 = new System.Windows.Forms.Label();
this.btnReadStruct = new System.Windows.Forms.Button();
@@ -87,7 +88,7 @@
this.label15 = new System.Windows.Forms.Label();
this.label14 = new System.Windows.Forms.Label();
this.label12 = new System.Windows.Forms.Label();
this.cmbOutType = new System.Windows.Forms.ComboBox();
this.chkDoParallel = new System.Windows.Forms.CheckBox();
this.groupBox1.SuspendLayout();
this.groupBox3.SuspendLayout();
this.statusStrip1.SuspendLayout();
@@ -105,10 +106,10 @@
//
// txtIP
//
this.txtIP.Location = new System.Drawing.Point(85, 23);
this.txtIP.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtIP.Location = new System.Drawing.Point(64, 19);
this.txtIP.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtIP.Name = "txtIP";
this.txtIP.Size = new System.Drawing.Size(109, 22);
this.txtIP.Size = new System.Drawing.Size(83, 20);
this.txtIP.TabIndex = 0;
this.txtIP.Text = "192.168.0.102";
this.txtIP.TextChanged += new System.EventHandler(this.txtIP_TextChanged);
@@ -116,9 +117,10 @@
// lblIP
//
this.lblIP.AutoSize = true;
this.lblIP.Location = new System.Drawing.Point(16, 26);
this.lblIP.Location = new System.Drawing.Point(12, 21);
this.lblIP.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblIP.Name = "lblIP";
this.lblIP.Size = new System.Drawing.Size(63, 17);
this.lblIP.Size = new System.Drawing.Size(51, 13);
this.lblIP.TabIndex = 1;
this.lblIP.Text = "IP ADDR";
//
@@ -131,10 +133,10 @@
"S7400",
"S71200",
"S71500"});
this.cbCpuType.Location = new System.Drawing.Point(85, 62);
this.cbCpuType.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.cbCpuType.Location = new System.Drawing.Point(64, 50);
this.cbCpuType.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cbCpuType.Name = "cbCpuType";
this.cbCpuType.Size = new System.Drawing.Size(109, 24);
this.cbCpuType.Size = new System.Drawing.Size(83, 21);
this.cbCpuType.TabIndex = 2;
this.cbCpuType.Text = "S71500";
this.cbCpuType.SelectedIndexChanged += new System.EventHandler(this.cbCpuType_SelectedIndexChanged);
@@ -142,27 +144,29 @@
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(7, 64);
this.label1.Location = new System.Drawing.Point(5, 52);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(72, 17);
this.label1.Size = new System.Drawing.Size(56, 13);
this.label1.TabIndex = 3;
this.label1.Text = "CPU Type";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(9, 23);
this.label2.Location = new System.Drawing.Point(7, 19);
this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(80, 17);
this.label2.Size = new System.Drawing.Size(64, 13);
this.label2.TabIndex = 5;
this.label2.Text = "MEM AREA";
//
// txtMemArea
//
this.txtMemArea.Location = new System.Drawing.Point(148, 20);
this.txtMemArea.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtMemArea.Location = new System.Drawing.Point(111, 16);
this.txtMemArea.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtMemArea.Name = "txtMemArea";
this.txtMemArea.Size = new System.Drawing.Size(101, 22);
this.txtMemArea.Size = new System.Drawing.Size(77, 20);
this.txtMemArea.TabIndex = 4;
this.txtMemArea.Text = "DB600.DBB20";
this.txtMemArea.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
@@ -171,18 +175,19 @@
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(9, 52);
this.label3.Location = new System.Drawing.Point(7, 42);
this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(123, 17);
this.label3.Size = new System.Drawing.Size(96, 13);
this.label3.TabIndex = 7;
this.label3.Text = "MEM SIZE (BYTE)";
//
// txtMemSize
//
this.txtMemSize.Location = new System.Drawing.Point(148, 50);
this.txtMemSize.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtMemSize.Location = new System.Drawing.Point(111, 41);
this.txtMemSize.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtMemSize.Name = "txtMemSize";
this.txtMemSize.Size = new System.Drawing.Size(101, 22);
this.txtMemSize.Size = new System.Drawing.Size(77, 20);
this.txtMemSize.TabIndex = 6;
this.txtMemSize.Text = "200";
this.txtMemSize.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
@@ -190,6 +195,7 @@
//
// groupBox1
//
this.groupBox1.Controls.Add(this.chkDoParallel);
this.groupBox1.Controls.Add(this.cmbOutType);
this.groupBox1.Controls.Add(this.txtNumRep);
this.groupBox1.Controls.Add(this.label13);
@@ -203,21 +209,38 @@
this.groupBox1.Controls.Add(this.txtMemSize);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Location = new System.Drawing.Point(6, 5);
this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.groupBox1.Location = new System.Drawing.Point(4, 4);
this.groupBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.groupBox1.Size = new System.Drawing.Size(672, 105);
this.groupBox1.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.groupBox1.Size = new System.Drawing.Size(504, 85);
this.groupBox1.TabIndex = 8;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Memoria: READ testing";
//
// cmbOutType
//
this.cmbOutType.FormattingEnabled = true;
this.cmbOutType.Items.AddRange(new object[] {
"byte",
"word",
"dword",
"real",
"struct"});
this.cmbOutType.Location = new System.Drawing.Point(392, 19);
this.cmbOutType.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.cmbOutType.Name = "cmbOutType";
this.cmbOutType.Size = new System.Drawing.Size(92, 21);
this.cmbOutType.TabIndex = 16;
this.cmbOutType.Text = "byte";
this.cmbOutType.SelectedIndexChanged += new System.EventHandler(this.cmbOutType_SelectedIndexChanged);
//
// txtNumRep
//
this.txtNumRep.Location = new System.Drawing.Point(148, 76);
this.txtNumRep.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtNumRep.Location = new System.Drawing.Point(111, 62);
this.txtNumRep.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtNumRep.Name = "txtNumRep";
this.txtNumRep.Size = new System.Drawing.Size(101, 22);
this.txtNumRep.Size = new System.Drawing.Size(77, 20);
this.txtNumRep.TabIndex = 14;
this.txtNumRep.Text = "1";
this.txtNumRep.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
@@ -225,18 +248,19 @@
// label13
//
this.label13.AutoSize = true;
this.label13.Location = new System.Drawing.Point(9, 79);
this.label13.Location = new System.Drawing.Point(7, 64);
this.label13.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(72, 17);
this.label13.Size = new System.Drawing.Size(55, 13);
this.label13.TabIndex = 15;
this.label13.Text = "# samples";
//
// btnReadStruct
//
this.btnReadStruct.Location = new System.Drawing.Point(405, 75);
this.btnReadStruct.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnReadStruct.Location = new System.Drawing.Point(304, 61);
this.btnReadStruct.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnReadStruct.Name = "btnReadStruct";
this.btnReadStruct.Size = new System.Drawing.Size(110, 25);
this.btnReadStruct.Size = new System.Drawing.Size(82, 20);
this.btnReadStruct.TabIndex = 12;
this.btnReadStruct.Text = "Read Struc";
this.btnReadStruct.TextImageRelation = System.Windows.Forms.TextImageRelation.TextAboveImage;
@@ -245,10 +269,10 @@
//
// btnReadString
//
this.btnReadString.Location = new System.Drawing.Point(405, 49);
this.btnReadString.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnReadString.Location = new System.Drawing.Point(304, 40);
this.btnReadString.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnReadString.Name = "btnReadString";
this.btnReadString.Size = new System.Drawing.Size(110, 25);
this.btnReadString.Size = new System.Drawing.Size(82, 20);
this.btnReadString.TabIndex = 11;
this.btnReadString.Text = "Read String";
this.btnReadString.UseVisualStyleBackColor = true;
@@ -256,10 +280,10 @@
//
// btnReadDWord
//
this.btnReadDWord.Location = new System.Drawing.Point(289, 75);
this.btnReadDWord.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnReadDWord.Location = new System.Drawing.Point(217, 61);
this.btnReadDWord.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnReadDWord.Name = "btnReadDWord";
this.btnReadDWord.Size = new System.Drawing.Size(110, 25);
this.btnReadDWord.Size = new System.Drawing.Size(82, 20);
this.btnReadDWord.TabIndex = 10;
this.btnReadDWord.Text = "Read DWord";
this.btnReadDWord.TextImageRelation = System.Windows.Forms.TextImageRelation.TextAboveImage;
@@ -268,10 +292,10 @@
//
// btnReadWord
//
this.btnReadWord.Location = new System.Drawing.Point(289, 48);
this.btnReadWord.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnReadWord.Location = new System.Drawing.Point(217, 39);
this.btnReadWord.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnReadWord.Name = "btnReadWord";
this.btnReadWord.Size = new System.Drawing.Size(110, 25);
this.btnReadWord.Size = new System.Drawing.Size(82, 20);
this.btnReadWord.TabIndex = 10;
this.btnReadWord.Text = "Read Word";
this.btnReadWord.UseVisualStyleBackColor = true;
@@ -279,10 +303,10 @@
//
// btnReadReal
//
this.btnReadReal.Location = new System.Drawing.Point(405, 19);
this.btnReadReal.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnReadReal.Location = new System.Drawing.Point(304, 15);
this.btnReadReal.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnReadReal.Name = "btnReadReal";
this.btnReadReal.Size = new System.Drawing.Size(110, 25);
this.btnReadReal.Size = new System.Drawing.Size(82, 20);
this.btnReadReal.TabIndex = 9;
this.btnReadReal.Text = "Read Real";
this.btnReadReal.UseVisualStyleBackColor = true;
@@ -290,10 +314,10 @@
//
// btnReadByte
//
this.btnReadByte.Location = new System.Drawing.Point(289, 19);
this.btnReadByte.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnReadByte.Location = new System.Drawing.Point(217, 15);
this.btnReadByte.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnReadByte.Name = "btnReadByte";
this.btnReadByte.Size = new System.Drawing.Size(110, 25);
this.btnReadByte.Size = new System.Drawing.Size(82, 20);
this.btnReadByte.TabIndex = 9;
this.btnReadByte.Text = "Read Byte";
this.btnReadByte.UseVisualStyleBackColor = true;
@@ -311,11 +335,11 @@
this.groupBox3.Controls.Add(this.txtIP);
this.groupBox3.Controls.Add(this.lblIP);
this.groupBox3.Controls.Add(this.label1);
this.groupBox3.Location = new System.Drawing.Point(6, 5);
this.groupBox3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.groupBox3.Location = new System.Drawing.Point(4, 4);
this.groupBox3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.groupBox3.Size = new System.Drawing.Size(479, 105);
this.groupBox3.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.groupBox3.Size = new System.Drawing.Size(359, 85);
this.groupBox3.TabIndex = 10;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Parametri PLC";
@@ -323,27 +347,29 @@
// label11
//
this.label11.AutoSize = true;
this.label11.Location = new System.Drawing.Point(301, 39);
this.label11.Location = new System.Drawing.Point(226, 32);
this.label11.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(148, 51);
this.label11.Size = new System.Drawing.Size(115, 39);
this.label11.TabIndex = 7;
this.label11.Text = "S7-1200/S7-1500: 0/1\r\nS7-300/S7-400: 0/2\r\nSlot > 0 se eth ext";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(301, 14);
this.label6.Location = new System.Drawing.Point(226, 11);
this.label6.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(114, 17);
this.label6.Size = new System.Drawing.Size(91, 13);
this.label6.TabIndex = 6;
this.label6.Text = "Note Rack / Slot:";
//
// txtSlot
//
this.txtSlot.Location = new System.Drawing.Point(253, 62);
this.txtSlot.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtSlot.Location = new System.Drawing.Point(190, 50);
this.txtSlot.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtSlot.Name = "txtSlot";
this.txtSlot.Size = new System.Drawing.Size(41, 22);
this.txtSlot.Size = new System.Drawing.Size(32, 20);
this.txtSlot.TabIndex = 5;
this.txtSlot.Text = "1";
this.txtSlot.TextChanged += new System.EventHandler(this.txtSlot_TextChanged);
@@ -351,18 +377,19 @@
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(208, 64);
this.label5.Location = new System.Drawing.Point(156, 52);
this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(32, 17);
this.label5.Size = new System.Drawing.Size(25, 13);
this.label5.TabIndex = 4;
this.label5.Text = "Slot";
//
// txtRack
//
this.txtRack.Location = new System.Drawing.Point(253, 23);
this.txtRack.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtRack.Location = new System.Drawing.Point(190, 19);
this.txtRack.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtRack.Name = "txtRack";
this.txtRack.Size = new System.Drawing.Size(41, 22);
this.txtRack.Size = new System.Drawing.Size(32, 20);
this.txtRack.TabIndex = 5;
this.txtRack.Text = "0";
this.txtRack.TextChanged += new System.EventHandler(this.txtRack_TextChanged);
@@ -370,9 +397,10 @@
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(208, 26);
this.label4.Location = new System.Drawing.Point(156, 21);
this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(40, 17);
this.label4.Size = new System.Drawing.Size(33, 13);
this.label4.TabIndex = 4;
this.label4.Text = "Rack";
//
@@ -384,34 +412,34 @@
this.toolStripStatusLabel1,
this.toolStripProgressBar1,
this.tslRTime});
this.statusStrip1.Location = new System.Drawing.Point(0, 583);
this.statusStrip1.Location = new System.Drawing.Point(0, 472);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 13, 0);
this.statusStrip1.Size = new System.Drawing.Size(906, 28);
this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 10, 0);
this.statusStrip1.Size = new System.Drawing.Size(680, 24);
this.statusStrip1.TabIndex = 11;
this.statusStrip1.Text = "statusStrip1";
//
// tslConn
//
this.tslConn.Name = "tslConn";
this.tslConn.Size = new System.Drawing.Size(72, 22);
this.tslConn.Size = new System.Drawing.Size(59, 19);
this.tslConn.Text = "Conn: ND";
//
// toolStripStatusLabel1
//
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(13, 22);
this.toolStripStatusLabel1.Size = new System.Drawing.Size(10, 19);
this.toolStripStatusLabel1.Text = "|";
//
// toolStripProgressBar1
//
this.toolStripProgressBar1.Name = "toolStripProgressBar1";
this.toolStripProgressBar1.Size = new System.Drawing.Size(100, 20);
this.toolStripProgressBar1.Size = new System.Drawing.Size(75, 18);
//
// tslRTime
//
this.tslRTime.Name = "tslRTime";
this.tslRTime.Size = new System.Drawing.Size(37, 22);
this.tslRTime.Size = new System.Drawing.Size(32, 19);
this.tslRTime.Text = "...ms";
//
// groupBox4
@@ -430,21 +458,21 @@
this.groupBox4.Controls.Add(this.label10);
this.groupBox4.Controls.Add(this.txtWriteAddr1);
this.groupBox4.Controls.Add(this.label7);
this.groupBox4.Location = new System.Drawing.Point(7, 7);
this.groupBox4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.groupBox4.Location = new System.Drawing.Point(5, 6);
this.groupBox4.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.groupBox4.Size = new System.Drawing.Size(1809, 71);
this.groupBox4.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.groupBox4.Size = new System.Drawing.Size(1357, 58);
this.groupBox4.TabIndex = 12;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Memoria: WRITE param";
//
// btnStrWrite
//
this.btnStrWrite.Location = new System.Drawing.Point(799, 25);
this.btnStrWrite.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnStrWrite.Location = new System.Drawing.Point(599, 20);
this.btnStrWrite.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnStrWrite.Name = "btnStrWrite";
this.btnStrWrite.Size = new System.Drawing.Size(41, 23);
this.btnStrWrite.Size = new System.Drawing.Size(31, 19);
this.btnStrWrite.TabIndex = 10;
this.btnStrWrite.Text = "SW";
this.btnStrWrite.UseVisualStyleBackColor = true;
@@ -452,10 +480,10 @@
//
// btnNumWriteB
//
this.btnNumWriteB.Location = new System.Drawing.Point(329, 5);
this.btnNumWriteB.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnNumWriteB.Location = new System.Drawing.Point(247, 4);
this.btnNumWriteB.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnNumWriteB.Name = "btnNumWriteB";
this.btnNumWriteB.Size = new System.Drawing.Size(48, 23);
this.btnNumWriteB.Size = new System.Drawing.Size(36, 19);
this.btnNumWriteB.TabIndex = 10;
this.btnNumWriteB.Text = "B";
this.btnNumWriteB.UseVisualStyleBackColor = true;
@@ -463,10 +491,10 @@
//
// btnNumWriteDW
//
this.btnNumWriteDW.Location = new System.Drawing.Point(329, 44);
this.btnNumWriteDW.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnNumWriteDW.Location = new System.Drawing.Point(247, 36);
this.btnNumWriteDW.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnNumWriteDW.Name = "btnNumWriteDW";
this.btnNumWriteDW.Size = new System.Drawing.Size(48, 23);
this.btnNumWriteDW.Size = new System.Drawing.Size(36, 19);
this.btnNumWriteDW.TabIndex = 10;
this.btnNumWriteDW.Text = "DW";
this.btnNumWriteDW.UseVisualStyleBackColor = true;
@@ -474,10 +502,10 @@
//
// btnNumWriteW
//
this.btnNumWriteW.Location = new System.Drawing.Point(329, 23);
this.btnNumWriteW.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.btnNumWriteW.Location = new System.Drawing.Point(247, 19);
this.btnNumWriteW.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.btnNumWriteW.Name = "btnNumWriteW";
this.btnNumWriteW.Size = new System.Drawing.Size(48, 23);
this.btnNumWriteW.Size = new System.Drawing.Size(36, 19);
this.btnNumWriteW.TabIndex = 10;
this.btnNumWriteW.Text = "W";
this.btnNumWriteW.UseVisualStyleBackColor = true;
@@ -485,10 +513,10 @@
//
// txtWriteVal2
//
this.txtWriteVal2.Location = new System.Drawing.Point(612, 25);
this.txtWriteVal2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtWriteVal2.Location = new System.Drawing.Point(459, 20);
this.txtWriteVal2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtWriteVal2.Name = "txtWriteVal2";
this.txtWriteVal2.Size = new System.Drawing.Size(187, 22);
this.txtWriteVal2.Size = new System.Drawing.Size(141, 20);
this.txtWriteVal2.TabIndex = 8;
this.txtWriteVal2.Text = "SAMUELEL";
this.txtWriteVal2.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
@@ -496,18 +524,19 @@
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(571, 27);
this.label9.Location = new System.Drawing.Point(428, 22);
this.label9.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(36, 17);
this.label9.Size = new System.Drawing.Size(29, 13);
this.label9.TabIndex = 9;
this.label9.Text = "STR";
//
// txtWriteVal1
//
this.txtWriteVal1.Location = new System.Drawing.Point(237, 25);
this.txtWriteVal1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtWriteVal1.Location = new System.Drawing.Point(178, 20);
this.txtWriteVal1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtWriteVal1.Name = "txtWriteVal1";
this.txtWriteVal1.Size = new System.Drawing.Size(85, 22);
this.txtWriteVal1.Size = new System.Drawing.Size(65, 20);
this.txtWriteVal1.TabIndex = 8;
this.txtWriteVal1.Text = "987654321";
this.txtWriteVal1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
@@ -515,18 +544,19 @@
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(197, 27);
this.label8.Location = new System.Drawing.Point(148, 22);
this.label8.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(39, 17);
this.label8.Size = new System.Drawing.Size(32, 13);
this.label8.TabIndex = 9;
this.label8.Text = "NUM";
//
// txtWriteAddr2
//
this.txtWriteAddr2.Location = new System.Drawing.Point(448, 25);
this.txtWriteAddr2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtWriteAddr2.Location = new System.Drawing.Point(336, 20);
this.txtWriteAddr2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtWriteAddr2.Name = "txtWriteAddr2";
this.txtWriteAddr2.Size = new System.Drawing.Size(116, 22);
this.txtWriteAddr2.Size = new System.Drawing.Size(88, 20);
this.txtWriteAddr2.TabIndex = 6;
this.txtWriteAddr2.Text = "DB600.DBB2";
this.txtWriteAddr2.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
@@ -534,18 +564,19 @@
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(389, 27);
this.label10.Location = new System.Drawing.Point(292, 22);
this.label10.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(59, 17);
this.label10.Size = new System.Drawing.Size(47, 13);
this.label10.TabIndex = 7;
this.label10.Text = "ADDR 2";
//
// txtWriteAddr1
//
this.txtWriteAddr1.Location = new System.Drawing.Point(71, 25);
this.txtWriteAddr1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtWriteAddr1.Location = new System.Drawing.Point(53, 20);
this.txtWriteAddr1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtWriteAddr1.Name = "txtWriteAddr1";
this.txtWriteAddr1.Size = new System.Drawing.Size(123, 22);
this.txtWriteAddr1.Size = new System.Drawing.Size(93, 20);
this.txtWriteAddr1.TabIndex = 6;
this.txtWriteAddr1.Text = "DB600.DBB0";
this.txtWriteAddr1.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
@@ -553,9 +584,10 @@
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(5, 27);
this.label7.Location = new System.Drawing.Point(4, 22);
this.label7.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(59, 17);
this.label7.Size = new System.Drawing.Size(47, 13);
this.label7.TabIndex = 7;
this.label7.Text = "ADDR 1";
//
@@ -565,12 +597,12 @@
this.txtOut.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.txtOut.Font = new System.Drawing.Font("Microsoft Sans Serif", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtOut.ForeColor = System.Drawing.Color.Yellow;
this.txtOut.Location = new System.Drawing.Point(4, 21);
this.txtOut.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.txtOut.Location = new System.Drawing.Point(3, 17);
this.txtOut.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.txtOut.Multiline = true;
this.txtOut.Name = "txtOut";
this.txtOut.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.txtOut.Size = new System.Drawing.Size(569, 388);
this.txtOut.Size = new System.Drawing.Size(427, 315);
this.txtOut.TabIndex = 0;
this.txtOut.Text = "...";
//
@@ -578,11 +610,11 @@
//
this.groupBox2.AutoSize = true;
this.groupBox2.Controls.Add(this.txtOut);
this.groupBox2.Location = new System.Drawing.Point(3, 11);
this.groupBox2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.groupBox2.Location = new System.Drawing.Point(2, 9);
this.groupBox2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.groupBox2.Size = new System.Drawing.Size(579, 428);
this.groupBox2.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.groupBox2.Size = new System.Drawing.Size(434, 349);
this.groupBox2.TabIndex = 9;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Risultati";
@@ -594,19 +626,21 @@
this.tabCtrl.Controls.Add(this.tabReadTest);
this.tabCtrl.Controls.Add(this.tabWriteTest);
this.tabCtrl.Controls.Add(this.tabParam);
this.tabCtrl.Location = new System.Drawing.Point(15, 9);
this.tabCtrl.Location = new System.Drawing.Point(11, 7);
this.tabCtrl.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tabCtrl.Name = "tabCtrl";
this.tabCtrl.SelectedIndex = 0;
this.tabCtrl.Size = new System.Drawing.Size(879, 143);
this.tabCtrl.Size = new System.Drawing.Size(659, 116);
this.tabCtrl.TabIndex = 13;
//
// tabReadTest
//
this.tabReadTest.Controls.Add(this.groupBox1);
this.tabReadTest.Location = new System.Drawing.Point(4, 25);
this.tabReadTest.Location = new System.Drawing.Point(4, 22);
this.tabReadTest.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tabReadTest.Name = "tabReadTest";
this.tabReadTest.Padding = new System.Windows.Forms.Padding(3);
this.tabReadTest.Size = new System.Drawing.Size(871, 114);
this.tabReadTest.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tabReadTest.Size = new System.Drawing.Size(651, 90);
this.tabReadTest.TabIndex = 0;
this.tabReadTest.Text = "Read Test";
this.tabReadTest.UseVisualStyleBackColor = true;
@@ -614,9 +648,10 @@
// tabWriteTest
//
this.tabWriteTest.Controls.Add(this.groupBox4);
this.tabWriteTest.Location = new System.Drawing.Point(4, 25);
this.tabWriteTest.Location = new System.Drawing.Point(4, 22);
this.tabWriteTest.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tabWriteTest.Name = "tabWriteTest";
this.tabWriteTest.Size = new System.Drawing.Size(871, 114);
this.tabWriteTest.Size = new System.Drawing.Size(651, 90);
this.tabWriteTest.TabIndex = 2;
this.tabWriteTest.Text = "Write Test";
this.tabWriteTest.UseVisualStyleBackColor = true;
@@ -624,10 +659,11 @@
// tabParam
//
this.tabParam.Controls.Add(this.groupBox3);
this.tabParam.Location = new System.Drawing.Point(4, 25);
this.tabParam.Location = new System.Drawing.Point(4, 22);
this.tabParam.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tabParam.Name = "tabParam";
this.tabParam.Padding = new System.Windows.Forms.Padding(3);
this.tabParam.Size = new System.Drawing.Size(871, 114);
this.tabParam.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.tabParam.Size = new System.Drawing.Size(651, 90);
this.tabParam.TabIndex = 1;
this.tabParam.Text = "Parametri";
this.tabParam.UseVisualStyleBackColor = true;
@@ -637,7 +673,8 @@
this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.splitContainer1.Location = new System.Drawing.Point(15, 158);
this.splitContainer1.Location = new System.Drawing.Point(11, 128);
this.splitContainer1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
@@ -656,17 +693,19 @@
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.groupBox2);
this.splitContainer1.Size = new System.Drawing.Size(875, 422);
this.splitContainer1.SplitterDistance = 291;
this.splitContainer1.Size = new System.Drawing.Size(656, 343);
this.splitContainer1.SplitterDistance = 218;
this.splitContainer1.SplitterWidth = 3;
this.splitContainer1.TabIndex = 15;
//
// lblThroughtput
//
this.lblThroughtput.AutoSize = true;
this.lblThroughtput.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblThroughtput.Location = new System.Drawing.Point(224, 105);
this.lblThroughtput.Location = new System.Drawing.Point(168, 85);
this.lblThroughtput.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblThroughtput.Name = "lblThroughtput";
this.lblThroughtput.Size = new System.Drawing.Size(35, 17);
this.lblThroughtput.Size = new System.Drawing.Size(28, 13);
this.lblThroughtput.TabIndex = 9;
this.lblThroughtput.Text = "000";
this.lblThroughtput.TextAlign = System.Drawing.ContentAlignment.TopRight;
@@ -675,18 +714,20 @@
//
this.label18.AutoSize = true;
this.label18.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label18.Location = new System.Drawing.Point(19, 105);
this.label18.Location = new System.Drawing.Point(14, 85);
this.label18.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label18.Name = "label18";
this.label18.Size = new System.Drawing.Size(57, 17);
this.label18.Size = new System.Drawing.Size(48, 13);
this.label18.TabIndex = 8;
this.label18.Text = "Kb/sec";
//
// lblTotSize
//
this.lblTotSize.AutoSize = true;
this.lblTotSize.Location = new System.Drawing.Point(227, 20);
this.lblTotSize.Location = new System.Drawing.Point(170, 16);
this.lblTotSize.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblTotSize.Name = "lblTotSize";
this.lblTotSize.Size = new System.Drawing.Size(32, 17);
this.lblTotSize.Size = new System.Drawing.Size(25, 13);
this.lblTotSize.TabIndex = 7;
this.lblTotSize.Text = "000";
this.lblTotSize.TextAlign = System.Drawing.ContentAlignment.TopRight;
@@ -694,9 +735,10 @@
// lblTimeMin
//
this.lblTimeMin.AutoSize = true;
this.lblTimeMin.Location = new System.Drawing.Point(227, 41);
this.lblTimeMin.Location = new System.Drawing.Point(170, 33);
this.lblTimeMin.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblTimeMin.Name = "lblTimeMin";
this.lblTimeMin.Size = new System.Drawing.Size(32, 17);
this.lblTimeMin.Size = new System.Drawing.Size(25, 13);
this.lblTimeMin.TabIndex = 6;
this.lblTimeMin.Text = "000";
this.lblTimeMin.TextAlign = System.Drawing.ContentAlignment.TopRight;
@@ -704,9 +746,10 @@
// lblTimeMax
//
this.lblTimeMax.AutoSize = true;
this.lblTimeMax.Location = new System.Drawing.Point(227, 75);
this.lblTimeMax.Location = new System.Drawing.Point(170, 61);
this.lblTimeMax.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblTimeMax.Name = "lblTimeMax";
this.lblTimeMax.Size = new System.Drawing.Size(32, 17);
this.lblTimeMax.Size = new System.Drawing.Size(25, 13);
this.lblTimeMax.TabIndex = 5;
this.lblTimeMax.Text = "000";
this.lblTimeMax.TextAlign = System.Drawing.ContentAlignment.TopRight;
@@ -715,9 +758,10 @@
//
this.lblTimeAvg.AutoSize = true;
this.lblTimeAvg.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblTimeAvg.Location = new System.Drawing.Point(224, 58);
this.lblTimeAvg.Location = new System.Drawing.Point(168, 47);
this.lblTimeAvg.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblTimeAvg.Name = "lblTimeAvg";
this.lblTimeAvg.Size = new System.Drawing.Size(35, 17);
this.lblTimeAvg.Size = new System.Drawing.Size(28, 13);
this.lblTimeAvg.TabIndex = 4;
this.lblTimeAvg.Text = "000";
this.lblTimeAvg.TextAlign = System.Drawing.ContentAlignment.TopRight;
@@ -726,64 +770,62 @@
//
this.label16.AutoSize = true;
this.label16.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label16.Location = new System.Drawing.Point(19, 58);
this.label16.Location = new System.Drawing.Point(14, 47);
this.label16.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(80, 17);
this.label16.Size = new System.Drawing.Size(66, 13);
this.label16.TabIndex = 3;
this.label16.Text = "TIME: avg";
//
// label15
//
this.label15.AutoSize = true;
this.label15.Location = new System.Drawing.Point(19, 75);
this.label15.Location = new System.Drawing.Point(14, 61);
this.label15.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label15.Name = "label15";
this.label15.Size = new System.Drawing.Size(73, 17);
this.label15.Size = new System.Drawing.Size(58, 13);
this.label15.TabIndex = 2;
this.label15.Text = "TIME: max";
//
// label14
//
this.label14.AutoSize = true;
this.label14.Location = new System.Drawing.Point(19, 41);
this.label14.Location = new System.Drawing.Point(14, 33);
this.label14.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(70, 17);
this.label14.Size = new System.Drawing.Size(55, 13);
this.label14.TabIndex = 1;
this.label14.Text = "TIME: min";
//
// label12
//
this.label12.AutoSize = true;
this.label12.Location = new System.Drawing.Point(19, 20);
this.label12.Location = new System.Drawing.Point(14, 16);
this.label12.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(58, 17);
this.label12.Size = new System.Drawing.Size(44, 13);
this.label12.TabIndex = 0;
this.label12.Text = "Tot size";
//
// cmbOutType
// chkDoParallel
//
this.cmbOutType.FormattingEnabled = true;
this.cmbOutType.Items.AddRange(new object[] {
"byte",
"word",
"dword",
"real",
"struct"});
this.cmbOutType.Location = new System.Drawing.Point(522, 23);
this.cmbOutType.Name = "cmbOutType";
this.cmbOutType.Size = new System.Drawing.Size(121, 24);
this.cmbOutType.TabIndex = 16;
this.cmbOutType.Text = "byte";
this.cmbOutType.SelectedIndexChanged += new System.EventHandler(this.cmbOutType_SelectedIndexChanged);
this.chkDoParallel.AutoSize = true;
this.chkDoParallel.Location = new System.Drawing.Point(392, 46);
this.chkDoParallel.Name = "chkDoParallel";
this.chkDoParallel.Size = new System.Drawing.Size(74, 17);
this.chkDoParallel.TabIndex = 17;
this.chkDoParallel.Text = "do parallel";
this.chkDoParallel.UseVisualStyleBackColor = true;
//
// TestMainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(906, 611);
this.ClientSize = new System.Drawing.Size(680, 496);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.tabCtrl);
this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
this.Name = "TestMainForm";
this.Text = "SIEMENS S7 TEST";
this.groupBox1.ResumeLayout(false);
@@ -873,6 +915,7 @@
private System.Windows.Forms.Label lblThroughtput;
private System.Windows.Forms.Label label18;
private System.Windows.Forms.ComboBox cmbOutType;
private System.Windows.Forms.CheckBox chkDoParallel;
}
}
+62 -20
View File
@@ -76,6 +76,10 @@ namespace Siemens_S7_Test
/// Array oggetti letti
/// </summary>
protected Byte[] memByteRead = new byte[0];
/// <summary>
/// Lock per connessione PLC
/// </summary>
private readonly static object connectLock = new object();
public TestMainForm()
{
@@ -212,24 +216,42 @@ namespace Siemens_S7_Test
int.TryParse(txtMemSize.Text, out numByte);
int numTest = 1;
int.TryParse(txtNumRep.Text, out numTest);
//tslRTime.Text = "Start reading BYTE";
//tslRTime.Invalidate();
// effettuo numero di test secondo indicazioni...
for (int i = 0; i < numTest; i++)
if (chkDoParallel.Checked)
{
sw.Restart();
// eseguo test
try
Parallel.For(0, numTest, (i, state) =>
{
memByteRead = currPLC.ReadBytes(DataType.DataBlock, memoria.DbNum, memoria.indiceMem, numByte);
lock (connectLock)
{
sw.Restart();
// eseguo test
memByteRead = currPLC.ReadBytes(DataType.DataBlock, memoria.DbNum, memoria.indiceMem, numByte);
sw.Stop();
// salvo risultati
PerfStats.addValue((double)sw.ElapsedMilliseconds);
}
}
catch (Exception exc)
);
}
else
{
// effettuo numero di test secondo indicazioni...
for (int i = 0; i < numTest; i++)
{
lg.Error(exc);
sw.Restart();
// eseguo test
try
{
memByteRead = currPLC.ReadBytes(DataType.DataBlock, memoria.DbNum, memoria.indiceMem, numByte);
}
catch (Exception exc)
{
lg.Error(exc);
}
sw.Stop();
// salvo risultati
PerfStats.addValue((double)sw.ElapsedMilliseconds);
}
sw.Stop();
// salvo risultati
PerfStats.addValue((double)sw.ElapsedMilliseconds);
}
// mostro update lettura
@@ -264,14 +286,34 @@ namespace Siemens_S7_Test
int numTest = 1;
int.TryParse(txtNumRep.Text, out numTest);
// effettuo numero di test secondo indicazioni...
for (int i = 0; i < numTest; i++)
if (chkDoParallel.Checked)
{
sw.Restart();
// eseguo test
memByteRead = currPLC.ReadBytes(DataType.DataBlock, memoria.DbNum, memoria.indiceMem, numByte);
sw.Stop();
// salvo risultati
PerfStats.addValue((double)sw.ElapsedMilliseconds);
Parallel.For(0, numTest, (i, state) =>
{
lock (connectLock)
{
sw.Restart();
// eseguo test
memByteRead = currPLC.ReadBytes(DataType.DataBlock, memoria.DbNum, memoria.indiceMem, numByte);
sw.Stop();
// salvo risultati
PerfStats.addValue((double)sw.ElapsedMilliseconds);
}
}
);
}
else
{
for (int i = 0; i < numTest; i++)
{
sw.Restart();
// eseguo test
memByteRead = currPLC.ReadBytes(DataType.DataBlock, memoria.DbNum, memoria.indiceMem, numByte);
sw.Stop();
// salvo risultati
PerfStats.addValue((double)sw.ElapsedMilliseconds);
}
}
// mostro update lettura