This commit is contained in:
@@ -45,6 +45,7 @@ namespace CMS_CORE_Application
|
||||
NCType = NcCombo.SelectedItem.ToString().Trim();
|
||||
NCIp = TXTip.Text.Trim();
|
||||
NCPort = ushort.Parse(TXTport.Text.Trim());
|
||||
|
||||
if (NCType != "")
|
||||
{
|
||||
Connect.Enabled = false;
|
||||
@@ -71,18 +72,15 @@ namespace CMS_CORE_Application
|
||||
List<AlarmModel> Msg = new List<AlarmModel>();
|
||||
List<AlarmModel> ncAlarms = new List<AlarmModel>();
|
||||
List<String> Lines = new List<string>();
|
||||
PostPowerOnModel postPowerOn = new PostPowerOnModel();
|
||||
AxisResetDataModel axisResetDataModel = new AxisResetDataModel();
|
||||
List<CounterModel> counters = new List<CounterModel>();
|
||||
List<SoftKeysModel> keys = new List<SoftKeysModel>();
|
||||
|
||||
N = SetNcByType();
|
||||
|
||||
CmsError cmsError = N.NC_Connect();
|
||||
cmsError = N.NC_RModelName(ref ModelName);
|
||||
N.NC_RProcessesNum(ref procnum);
|
||||
N.NC_RMachineNumber(ref MachNumber);
|
||||
bool error = false;
|
||||
string serial = "";
|
||||
|
||||
while (true)
|
||||
{
|
||||
cmsError = N.PROC_RMode(1, ref mode);
|
||||
@@ -115,12 +113,8 @@ namespace CMS_CORE_Application
|
||||
error = true;
|
||||
SetError(Lines, cmsError);
|
||||
}
|
||||
cmsError = N.NC_RSoftwareVersion(ref SFTVersion);
|
||||
if (cmsError.IsError())
|
||||
{
|
||||
error = true;
|
||||
SetError(Lines, cmsError);
|
||||
}
|
||||
|
||||
|
||||
cmsError = N.NC_RDateTime(ref NcTime);
|
||||
if (cmsError.IsError())
|
||||
{
|
||||
@@ -129,6 +123,14 @@ namespace CMS_CORE_Application
|
||||
}
|
||||
|
||||
cmsError = N.NC_RSerialNumber(ref serial);
|
||||
if (cmsError.IsError())
|
||||
{
|
||||
error = true;
|
||||
SetError(Lines, cmsError);
|
||||
}
|
||||
|
||||
cmsError = N.PLC_WSoftKey(1);
|
||||
|
||||
sw.Stop();
|
||||
|
||||
if (!this.IsDisposed && this.InvokeRequired)
|
||||
@@ -158,7 +160,7 @@ namespace CMS_CORE_Application
|
||||
}
|
||||
|
||||
error = false;
|
||||
//sw.Stop();
|
||||
|
||||
if ((200 - (int)sw.ElapsedMilliseconds) < 0)
|
||||
Debug.WriteLine("Ritardo " + sw.ElapsedMilliseconds);
|
||||
|
||||
@@ -350,8 +352,8 @@ namespace CMS_CORE_Application
|
||||
{
|
||||
if (t != null)
|
||||
t.Abort();
|
||||
if (toolThread != null)
|
||||
toolThread.Abort();
|
||||
//if (toolThread != null)
|
||||
// toolThread.Abort();
|
||||
|
||||
TXTPath1.Text = "";
|
||||
TXTStat1.Text = "";
|
||||
|
||||
@@ -98,22 +98,24 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CndexLinkDotNet">
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\OSAI\WinNBI\UserLibrary\CndexLinkDotNet.dll</HintPath>
|
||||
<Reference Include="CndexLinkDotNet, Version=4.3.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>libs\CndexLinkDotNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Siemens.Sinumerik.Operate.Services, Version=4.7.4.0, Culture=neutral, PublicKeyToken=bdd90fa02fd1c4ee, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Siemens\MotionControl\siemens\sinumerik\hmi\base\Siemens.Sinumerik.Operate.Services.dll</HintPath>
|
||||
<HintPath>libs\Siemens.Sinumerik.Operate.Services.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Siemens.Sinumerik.Operate.Services.Wrapper, Version=4.7.4.0, Culture=neutral, PublicKeyToken=bdd90fa02fd1c4ee, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Siemens\MotionControl\siemens\sinumerik\hmi\base\Siemens.Sinumerik.Operate.Services.Wrapper.dll</HintPath>
|
||||
<HintPath>libs\Siemens.Sinumerik.Operate.Services.Wrapper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.ServiceModel.Web" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@@ -879,30 +881,30 @@
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="fwlib30i.dll">
|
||||
<EmbeddedResource Include="fwlib30i.dll">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="fwlib30i64.dll">
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="fwlib30i64.dll">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Fwlib32.dll">
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Fwlib32.dll">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Fwlib64.dll">
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Fwlib64.dll">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="fwlibe1.dll">
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="fwlibe1.dll">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="fwlibe64.dll">
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="fwlibe64.dll">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="OsaiTool.dll">
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="OsaiTool.dll">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="OSAI_ErrorMgr.dll">
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="OSAI_ErrorMgr.dll">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -263,6 +263,13 @@ namespace CMS_CORE_Library
|
||||
public uint Value;
|
||||
}
|
||||
|
||||
public class SoftKeysModel
|
||||
{
|
||||
public int Id;
|
||||
public bool Active;
|
||||
public bool Value;
|
||||
}
|
||||
|
||||
#endregion Data structor models
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -327,5 +334,11 @@ namespace CMS_CORE_Library
|
||||
internal static CmsError SIEMENS_HMI_NOT_RUNNING_ERROR = new CmsError(CMS_ERROR_CODES.SIEMENS_HMI_NOT_RUNNING, "CMS-Core-Error: Siemens HMI is not Running / Ready");
|
||||
|
||||
#endregion Cms Errors Codes
|
||||
|
||||
#region Constants
|
||||
|
||||
public const int SOFTKEY_NUMBER = 128;
|
||||
|
||||
#endregion Constants
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Description;
|
||||
using System.Threading;
|
||||
using static CMS_CORE_Library.DataStructures;
|
||||
|
||||
namespace CMS_CORE.Demo
|
||||
@@ -58,7 +59,9 @@ namespace CMS_CORE.Demo
|
||||
|
||||
public override CmsError NC_Disconnect()
|
||||
{
|
||||
cf.Close();
|
||||
if (cf != null)
|
||||
cf.Close();
|
||||
|
||||
Connected = false;
|
||||
|
||||
return NO_ERROR;
|
||||
@@ -379,15 +382,15 @@ namespace CMS_CORE.Demo
|
||||
|
||||
public override CmsError PLC_RFunctionAccess(ref List<FunctionalityModel> functions)
|
||||
{
|
||||
List<int> readValue = new List<int>();
|
||||
List<int> readedValues = new List<int>();
|
||||
// Read functions access data from memory
|
||||
CmsError cmsError = MEM_RWIntegerList(R, 0, MEMORY_ADDRESS.FUNCTION_ACCESS.MemType, MEMORY_ADDRESS.FUNCTION_ACCESS.Address, 4, ref readValue);
|
||||
CmsError cmsError = MEM_RWIntegerList(R, 0, MEMORY_ADDRESS.FUNCTION_ACCESS.MemType, MEMORY_ADDRESS.FUNCTION_ACCESS.Address, 4, ref readedValues);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
functions = new List<FunctionalityModel>();
|
||||
// Convert int into to true/false array
|
||||
bool[] bits = new BitArray(readValue.ToArray()).Cast<bool>().ToArray();
|
||||
bool[] bits = new BitArray(readedValues.ToArray()).Cast<bool>().ToArray();
|
||||
// Convert array into structured data
|
||||
for (int i = 0; i < bits.Count(); i++)
|
||||
{
|
||||
@@ -420,7 +423,7 @@ namespace CMS_CORE.Demo
|
||||
Percentage = percentage
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
@@ -431,11 +434,11 @@ namespace CMS_CORE.Demo
|
||||
counters = new List<CounterModel>();
|
||||
List<int> readedValues = new List<int>();
|
||||
// Read on data from memory
|
||||
CmsError cmsError = MEM_RWIntegerList(R, 0, MEMORY_ADDRESS.COUNTERS.MemType, MEMORY_ADDRESS.COUNTERS.Address, MEMORY_ADDRESS.COUNTERS.Size / 4 , ref readedValues);
|
||||
CmsError cmsError = MEM_RWIntegerList(R, 0, MEMORY_ADDRESS.COUNTERS.MemType, MEMORY_ADDRESS.COUNTERS.Address, MEMORY_ADDRESS.COUNTERS.Size / 4, ref readedValues);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
for ( int i = 0; i < readedValues.Count; i++)
|
||||
|
||||
for (int i = 0; i < readedValues.Count; i++)
|
||||
{
|
||||
counters.Add(new CounterModel()
|
||||
{
|
||||
@@ -475,6 +478,120 @@ namespace CMS_CORE.Demo
|
||||
// return NO_ERROR;
|
||||
//}
|
||||
|
||||
public override CmsError PLC_RSoftKeys(ref List<SoftKeysModel> softKeys)
|
||||
{
|
||||
try
|
||||
{
|
||||
softKeys = new List<SoftKeysModel>();
|
||||
List<int> readedValues = new List<int>();
|
||||
|
||||
int memorySize = (MEMORY_ADDRESS.SOFT_KEYS_VALUE.Size + MEMORY_ADDRESS.SOFT_KEYS_CLICKABLE.Size);
|
||||
|
||||
// Read on data from memory
|
||||
CmsError cmsError = MEM_RWIntegerList(R, 0,
|
||||
MEMORY_ADDRESS.SOFT_KEYS_VALUE.MemType,
|
||||
MEMORY_ADDRESS.SOFT_KEYS_VALUE.Address,
|
||||
memorySize / 4,
|
||||
ref readedValues);
|
||||
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
bool[] bits = new BitArray(readedValues.ToArray()).Cast<bool>().ToArray();
|
||||
|
||||
// Convert array into structured data
|
||||
for (int i = 0; i < bits.Count() / 2; i++)
|
||||
{
|
||||
softKeys.Add(new SoftKeysModel()
|
||||
{
|
||||
Id = i,
|
||||
Value = bits[i],
|
||||
Active = bits[i + 128]
|
||||
});
|
||||
}
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return ManageException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public override CmsError PLC_WSoftKey(uint id)
|
||||
{
|
||||
try
|
||||
{
|
||||
CmsError cmsError;
|
||||
bool readedValue = false;
|
||||
bool writeValue = true;
|
||||
// Check ACK
|
||||
cmsError = MEM_RWBoolean(R, 0, MEMORY_ADDRESS.SOFT_KEYS_ACK.MemType, MEMORY_ADDRESS.SOFT_KEYS_ACK.Address, (int)id, ref readedValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
// If PLC it's performing another request then return
|
||||
if (readedValue)
|
||||
return NO_ERROR;
|
||||
|
||||
// Check bit range
|
||||
if (id > SOFTKEY_NUMBER - 1)
|
||||
return INCORRECT_PARAMETERS_ERROR;
|
||||
|
||||
// Write data
|
||||
cmsError = MEM_RWBoolean(W, 0, MEMORY_ADDRESS.SOFT_KEYS_CLICKED.MemType, MEMORY_ADDRESS.SOFT_KEYS_CLICKED.Address, (int)id, ref writeValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
cmsError = ResetStrobe((int)id, MEMORY_ADDRESS.SOFT_KEYS_CLICKED, MEMORY_ADDRESS.SOFT_KEYS_ACK);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return ManageException(ex);
|
||||
}
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
private CmsError ResetStrobe(int id, MEMORY_CELL strobeMemoryCell, MEMORY_CELL ackMemoryCell)
|
||||
{
|
||||
int n = 5;
|
||||
bool readedValue = false;
|
||||
bool writeValue = false;
|
||||
CmsError cmsError;
|
||||
do
|
||||
{
|
||||
// Check ACK
|
||||
cmsError = MEM_RWBoolean(R, 0, ackMemoryCell.MemType, ackMemoryCell.Address, id, ref readedValue);
|
||||
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
|
||||
// If true reset strobe
|
||||
if (readedValue == true)
|
||||
{
|
||||
// Reset strobe to 0
|
||||
cmsError = MEM_RWBoolean(W, 0, strobeMemoryCell.MemType, strobeMemoryCell.Address, id, ref writeValue);
|
||||
if (cmsError.IsError())
|
||||
return cmsError;
|
||||
// Exit from cycle
|
||||
n = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Decrement
|
||||
n--;
|
||||
// Wait befor next cycle
|
||||
Thread.Sleep(20);
|
||||
}
|
||||
|
||||
} while (n > 0);
|
||||
|
||||
return cmsError;
|
||||
}
|
||||
|
||||
#endregion PLC High-level data
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -575,27 +692,28 @@ namespace CMS_CORE.Demo
|
||||
|
||||
// Convert Byte into true/false array
|
||||
BitArray bits = new BitArray(new byte[] { bytes[0] }); //1st byte -> 0 : Proccess type (AUX-WORK), 1: Process in alarm status, 2: Run, 3: Hold, 4: Read, 5: PartProgramVisible
|
||||
|
||||
// Populate response structure
|
||||
processData.Type = bits[0] ? "WORK" : "AUX";
|
||||
processData.IsInAlarm = bits[1];
|
||||
|
||||
// Choose process status
|
||||
if (bits[2])
|
||||
processData.Status = "RUN";
|
||||
if (bits[3])
|
||||
processData.Status = "HOLD";
|
||||
else
|
||||
{
|
||||
if (bits[3])
|
||||
processData.Status = "HOLD";
|
||||
if (bits[2])
|
||||
processData.Status = "RUN";
|
||||
else
|
||||
processData.Status = "READY";
|
||||
}
|
||||
|
||||
// Get Reps from 2nd byte
|
||||
processData.Reps = bytes[1];
|
||||
|
||||
// Get part program info visibility
|
||||
processData.Visible = bits[4];
|
||||
|
||||
// Get Reps from 2nd byte
|
||||
processData.Reps = bytes[1];
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
@@ -1333,22 +1451,26 @@ namespace CMS_CORE.Demo
|
||||
internal const int STARTING_ADDRESS = 0;
|
||||
|
||||
internal static MEMORY_CELL FUNCTION_ACCESS = new MEMORY_CELL(MEMORY_TYPE.Demo, 13, 16);
|
||||
internal static MEMORY_CELL STROBE = new MEMORY_CELL(MEMORY_TYPE.Demo, 29, 16);
|
||||
|
||||
internal static MEMORY_CELL PRE_POWER_ON = new MEMORY_CELL(MEMORY_TYPE.Demo, 45, 1);
|
||||
internal static MEMORY_CELL PRE_POWER_ON_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Demo, 46, 1);
|
||||
internal static MEMORY_CELL PRE_POWER_ON = new MEMORY_CELL(MEMORY_TYPE.Demo, 29, 1);
|
||||
internal static MEMORY_CELL PRE_POWER_ON_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Demo, 30, 1);
|
||||
|
||||
internal static MEMORY_CELL POST_POWER_ON = new MEMORY_CELL(MEMORY_TYPE.Demo, 47, 1);
|
||||
internal static MEMORY_CELL POST_POWER_ON_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Demo, 48, 1);
|
||||
internal static MEMORY_CELL POST_POWER_ON = new MEMORY_CELL(MEMORY_TYPE.Demo, 31, 1);
|
||||
internal static MEMORY_CELL POST_POWER_ON_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Demo, 32, 1);
|
||||
|
||||
internal static MEMORY_CELL PRE_POWER_ON_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Demo, 49, 1);
|
||||
internal static MEMORY_CELL POST_POWER_ON_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Demo, 50, 1);
|
||||
internal static MEMORY_CELL PRE_POWER_ON_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Demo, 33, 1);
|
||||
internal static MEMORY_CELL POST_POWER_ON_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Demo, 34, 1);
|
||||
|
||||
internal static MEMORY_CELL AXIS_RESET_PROCEDURE = new MEMORY_CELL(MEMORY_TYPE.Demo, 51, 7, 2);
|
||||
internal static MEMORY_CELL AXIS_RESET_PROCEDURE = new MEMORY_CELL(MEMORY_TYPE.Demo, 35, 7, 2);
|
||||
|
||||
internal static MEMORY_CELL PROCESS_STATUS = new MEMORY_CELL(MEMORY_TYPE.Demo, 55, 0, 16);
|
||||
internal static MEMORY_CELL PROCESS_STATUS = new MEMORY_CELL(MEMORY_TYPE.Demo, 39, 0, 16);
|
||||
|
||||
internal static MEMORY_CELL COUNTERS = new MEMORY_CELL(MEMORY_TYPE.Demo, 71, 0, 40);
|
||||
internal static MEMORY_CELL COUNTERS = new MEMORY_CELL(MEMORY_TYPE.Demo, 55, 0, 40);
|
||||
|
||||
internal static MEMORY_CELL SOFT_KEYS_VALUE = new MEMORY_CELL(MEMORY_TYPE.Demo, 119, 0, 16);
|
||||
internal static MEMORY_CELL SOFT_KEYS_CLICKABLE = new MEMORY_CELL(MEMORY_TYPE.Demo, 135, 0, 16);
|
||||
internal static MEMORY_CELL SOFT_KEYS_CLICKED = new MEMORY_CELL(MEMORY_TYPE.Demo, 151, 16);
|
||||
internal static MEMORY_CELL SOFT_KEYS_ACK = new MEMORY_CELL(MEMORY_TYPE.Demo, 167, 16);
|
||||
}
|
||||
|
||||
#endregion Memory addresses
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using static CMS_CORE_Library.DataStructures;
|
||||
|
||||
#pragma warning disable 1591
|
||||
@@ -141,7 +142,7 @@ namespace CMS_CORE.Fanuc
|
||||
return cmsError;
|
||||
|
||||
SN = Cnc_SeriesNum;
|
||||
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
@@ -360,33 +361,48 @@ namespace CMS_CORE.Fanuc
|
||||
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
// Get pre and post power on data
|
||||
public override CmsError PLC_RPowerOnData(ref PreAndPostPowerOnModel powerOnModel)
|
||||
{
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
// Write power on data
|
||||
public override CmsError PLC_WPowerOnData(uint id, bool value)
|
||||
{
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
// Get functionality data
|
||||
public override CmsError PLC_RFunctionAccess(ref List<FunctionalityModel> functions)
|
||||
{
|
||||
functions = new List<FunctionalityModel>();
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
// Get axis reset procedure data
|
||||
public override CmsError PLC_RAxesResetData(ref AxisResetDataModel axisResetData)
|
||||
{
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
// Get all the machine counters
|
||||
public override CmsError PLC_RMachineCounters(ref List<CounterModel> counters)
|
||||
{
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
public override CmsError PLC_RSoftKeys(ref List<SoftKeysModel> softKeys)
|
||||
{
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
public override CmsError PLC_WSoftKey(uint id)
|
||||
{
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
#endregion PLC High-level data
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1723,18 +1739,32 @@ namespace CMS_CORE.Fanuc
|
||||
//Read Language from NC PARAM
|
||||
cmsError = NC_RParam((short)PARAM_LING_FANUC.Address, ref FanucLanguage);
|
||||
if (cmsError.IsError())
|
||||
{
|
||||
MessageBox.Show(cmsError.message);
|
||||
return cmsError;
|
||||
}
|
||||
|
||||
//Execute the method
|
||||
nReturn1 = Focas1.cnc_sysinfo(nLibHandle[0], tmpNode);
|
||||
MessageBox.Show("return 1 dopo metodo " + nReturn1);
|
||||
|
||||
node = tmpNode;
|
||||
nReturn2 = Focas1.cnc_rdcncid(nLibHandle[0], out SerialNumber);
|
||||
MessageBox.Show("return 1 dopo n return 2" + nReturn1);
|
||||
|
||||
//Throw Exception if there's an error
|
||||
if (nReturn1 != 0)
|
||||
{
|
||||
MessageBox.Show("return 1 " + nReturn1);
|
||||
|
||||
return GetNcError(nReturn1);
|
||||
}
|
||||
else if (nReturn2 != 0 && nReturn2 != 1)
|
||||
{
|
||||
MessageBox.Show("return 2 " + nReturn2);
|
||||
|
||||
return GetNcError(nReturn2);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Setup the name
|
||||
@@ -1959,7 +1989,7 @@ namespace CMS_CORE.Fanuc
|
||||
case Focas1.focas_ret.EW_STOP: return ErrororOwner + "CNC is not running";
|
||||
case Focas1.focas_ret.EW_PASSWD: return ErrororOwner + "protection data error";
|
||||
}
|
||||
return ErrororOwner + "Generic Error On Function";
|
||||
return ErrororOwner + "Generic Error On Function, Error Number: " + Val;
|
||||
}
|
||||
|
||||
#endregion Subordinate Private Functions
|
||||
|
||||
+19
-4
@@ -398,14 +398,14 @@ namespace CMS_CORE
|
||||
|
||||
/**
|
||||
* <summary>
|
||||
* Write the status of the Power on data ( Pre-Power-On / Post-Power-On )
|
||||
* Write PowerOn data and status ( Pre-Power-On / Post-Power-On )
|
||||
* <para>
|
||||
* Compatibility: Fanuc | Osai | Demo | Siemens
|
||||
* </para>
|
||||
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
|
||||
* </summary>
|
||||
* <param name="id"> Id of the edited power on data </param>
|
||||
* <param name="value"> New value of the power on data</param>
|
||||
* <param name="value"> Reference to the value of the power on data</param>
|
||||
**/
|
||||
public abstract CmsError PLC_WPowerOnData(uint id, bool value);
|
||||
|
||||
@@ -427,7 +427,7 @@ namespace CMS_CORE
|
||||
* Compatibility: Fanuc | Osai | Demo | Siemens
|
||||
* </para>
|
||||
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
|
||||
* <param name="functions">Reference to the data of axes reset procedure</param>
|
||||
* <param name="functions">Reference to the axes reset procedure data</param>
|
||||
* </summary>
|
||||
**/
|
||||
public abstract CmsError PLC_RAxesResetData(ref AxisResetDataModel axisResetData);
|
||||
@@ -439,11 +439,26 @@ namespace CMS_CORE
|
||||
* Compatibility: Fanuc | Osai | Demo | Siemens
|
||||
* </para>
|
||||
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
|
||||
* <param name="counters">Reference to the data of counters</param>
|
||||
* <param name="counters">Reference to the counters data</param>
|
||||
* </summary>
|
||||
**/
|
||||
public abstract CmsError PLC_RMachineCounters(ref List<CounterModel> counters);
|
||||
|
||||
|
||||
/**
|
||||
* <summary>
|
||||
* Read user softkeys values from PLC
|
||||
* <para>
|
||||
* Compatibility: Fanuc | Osai | Demo | Siemens
|
||||
* </para>
|
||||
* <returns cref="CmsError">Returns an error when an internal or a library error occours</returns>
|
||||
* <param name="softKeys">Reference to the softkey data</param>
|
||||
* </summary>
|
||||
**/
|
||||
public abstract CmsError PLC_RSoftKeys(ref List<SoftKeysModel> softKeys);
|
||||
|
||||
public abstract CmsError PLC_WSoftKey(uint id);
|
||||
|
||||
#endregion
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -413,6 +413,16 @@ namespace CMS_CORE.Osai
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
public override CmsError PLC_RSoftKeys(ref List<SoftKeysModel> softKeys)
|
||||
{
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
public override CmsError PLC_WSoftKey(uint id)
|
||||
{
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
#endregion PLC High-level data
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -315,6 +315,15 @@ namespace CMS_CORE.Siemens
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
public override CmsError PLC_RSoftKeys(ref List<SoftKeysModel> softKeys)
|
||||
{
|
||||
return NO_ERROR;
|
||||
}
|
||||
|
||||
public override CmsError PLC_WSoftKey(uint id)
|
||||
{
|
||||
return NO_ERROR;
|
||||
}
|
||||
#endregion PLC High-level data
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -142,8 +142,8 @@ namespace Nc_Demo_Application.Server.Service
|
||||
public void GetBoolean(string index, string bit, out bool value)
|
||||
{
|
||||
string binaryByte = DatabaseController.getInstance().GetBinaryByteValue(Convert.ToInt32(index));
|
||||
binaryByte = binaryByte.Substring(8 - Convert.ToInt32(bit + 1), 1);
|
||||
value = Convert.ToBoolean(binaryByte);
|
||||
binaryByte = binaryByte.Substring(8 - Convert.ToInt32(bit), 1);
|
||||
value = binaryByte == "0" ? false : true;
|
||||
}
|
||||
|
||||
public void GetByte(string index, out byte value)
|
||||
|
||||
@@ -228,7 +228,7 @@ namespace Nc_Demo_Application
|
||||
// Update cell
|
||||
integerCell.Value = Convert.ToInt32(binaryIntegerCellValue, 2).ToString();
|
||||
}
|
||||
if(e.RowIndex == 51 && (int)decimalCell.Value == 0 && !axisResetRunning)
|
||||
if(e.RowIndex == 35 && (int)decimalCell.Value == 0 && !axisResetRunning)
|
||||
{
|
||||
axisResetRunning = true;
|
||||
Task.Run(() => AxisResetProcedureAsync(binaryMemoryGridView.Rows[e.RowIndex]));
|
||||
|
||||
Reference in New Issue
Block a user