Merge branch 'release/Mitsubishi_01'

This commit is contained in:
Samuele Locatelli
2024-11-19 17:33:51 +01:00
13 changed files with 2508 additions and 309 deletions
+5
View File
@@ -362,6 +362,11 @@ namespace IOB_UT_NEXT
/// </summary>
ND,
/// <summary>
/// Adapter MITSUBISHI con EZCnc lib
/// </summary>
MITSUBISHI,
/// <summary>
/// Adapter ModBus TCP generico
/// </summary>
+6
View File
@@ -1,4 +1,5 @@
using IOB_UT_NEXT;
using IOB_WIN_NEXT.Iob;
using IOB_WIN_NEXT.IobSoap;
using MapoSDK;
using Newtonsoft.Json;
@@ -1690,6 +1691,11 @@ namespace IOB_WIN_NEXT
start.Enabled = true;
break;
case tipoAdapter.MITSUBISHI:
iobObj = new Mitsubishi(this, IOBConf);
start.Enabled = true;
break;
case tipoAdapter.MODBUS_TCP:
iobObj = new IobModbusTCP.ModbusTCP(this, IOBConf);
start.Enabled = true;
+5 -4
View File
@@ -40,14 +40,15 @@ CLI_INST=SteamWareSim
;STARTLIST=PIZ10
;STARTLIST=IMI_SOITAAB_Z2342_02
;STARTLIST=IMI_GOMBA
;STARTLIST=PING
;STARTLIST=SIMUL_02
;STARTLIST=SIM_DP_01
;STARTLIST=FTP_SONATEST
;STARTLIST=L020
;STARTLIST=PING
;STARTLIST=VL27
;NB: mettere copy always ai file di conf x fare test...
;STARTLIST=FTP_SONATEST
;STARTLIST=SIMUL_01
STARTLIST=VL27
;STARTLIST=L020
STARTLIST=VL28
MAXCNC=10
-54
View File
@@ -1,54 +0,0 @@
;Configurazione IOB-WIN
[IOB]
CNCTYPE=SIMULA
PING_MS_TIMEOUT=500
MinDeltaSec=5
[MACHINE]
VENDOR=STEAMWARE
MODEL=DEMO_SIMULATOR
[CNC]
IP=127.0.0.1
PORT=0000
[SERVER]
MPIP=http://10.74.82.218
MPURL=/MP/IO
CMDBASE=/IOB/input/
CMDFLOG=/IOB/flog/
CMDALIVE=/IOB
CMDENABLED=/IOB/enabled/
CMDADV1=?valore=
CMDREBO=/sendReboot.aspx?idxMacchina=
[MEMORY]
[BLINK]
MAX_COUNTER_BLINK = 15
BLINK_FILT=0
[OPTPAR]
;PZCOUNT_MODE=STD.[PAR/MEM].info|BIT.indice
PZCOUNT_MODE=BIT
; per il simulatore: 50|1 = WAIT 50, DURATION 1 con riferimento al PERIODO base (PER_BASE in ms, default 1 secondo)
PER_BASE=10200
SIM_PZCNT=5|1
SIM_ALARM=500|40
SIM_MANU=50|7
;indica gestione e simulazione bit 5 --> slow/emergenza
SIM_SLOW=2500|10
; indica simulazione delle funzionalità power ON/ OFF
SIM_POW_ON_OFF=true
T_ON=6
T_OFF=22
[BRANCH]
NAME=master
; Tags manuali
[TAGS]
Customer=Steamware
HostOS=WIN
HostName=IOB-WIN-SIMULA
HostAddr=10.74.82.76
+84
View File
@@ -0,0 +1,84 @@
;Configurazione IOB-WIN
[IOB]
CNCTYPE=MITSUBISHI
[MACHINE]
; VALVITAL 2024
VENDOR=DMG MORI
MODEL=NLX4000
[CNC]
; FANUC!
IP=192.168.213.199
PORT=683
GETPRGNAME=true
[SERVER]
MPIP=192.168.214.4
MPURL=/MP/IO
CMDBASE=/IOB/input/
CMDFLOG=/IOB/flog/
CMDALIVE=/IOB
CMDENABLED=/IOB/enabled/
CMDADV1=?valore=
CMDREBO=/sendReboot.aspx?idxMacchina=
[MEMORY]
; Green Y62=10098 | Red: Y60=10096 | Yellow: Y61=10097 | Blue Y63=10099 | Emerg: ??? (negata???)|
;BIT0=CONN
BIT1=10098
;BIT2=PZCOUNT.PAR.8002
BIT3=10096
BIT4=10097
;BIT5=!X8.4
AREAV_START=500
AREAV_SIZE=3
PAR_START=8001
PAR_SIZE=3
SIGN_START=10096
SIGN_SIZE=4
[BLINK]
;MAX_COUNTER_BLINK = 30
MAX_COUNTER_BLINK = 15
;bit0 = 0
;bit1 = 0
;bit2 = 1
;bit3 = 1
;bit4 = 1
;bit5 = 0
;bit6 = 0
;bit7 = 0
BLINK_FILT=0
;BLINK_FILT=28
[OPTPAR]
EZNC_SYS=EZNC_SYS_MELDAS700L
ENABLE_PZCOUNT=TRUE
;PZCOUNT_MODE=STD|BIT
;PZCOUNT_MODE=STD.PAR.6711
;PZGTOT_MODE=STD.PAR.6712
;;PZREQ_MODE=STD.PAR.6713
PZCOUNT_MODE=STD.PAR.8002
PZGTOT_MODE=STD.PAR.8001
PZREQ_MODE=STD.PAR.8003
ENABLE_PZ_REQ=TRUE
ENABLE_PZ_RESET=TRUE
ENABLE_PZ_RESET_stopSetup=FALSE
;gestione invio pezzi in blocco
ENABLE_SEND_PZC_BLOCK=TRUE
MIN_SEND_PZC_BLOCK=0
MAX_SEND_PZC_BLOCK=100
; conf cablata set Art/Commessa
SET_NUM_COM=STD.VAR.500
SET_NUM_ART=STD.VAR.501
SET_NUM_PZ=STD.VAR.502
MAX_CHAR_DESC=7
;indica se il numero articolo sia semplicemente il trim dei caratteri alfabetici (chiama comunque server...)
NUM_ART_CHR_TRIM=TRUE
; conf parametri memoria READ/WRITE
PARAM_CONF=VL28.json
DISABLE_SEND_WDST=TRUE
[BRANCH]
NAME=master
+91
View File
@@ -0,0 +1,91 @@
{
"mMapWrite": {
"setArt": {
"name": "setArt",
"description": "Articolo",
"memAddr": "NONE.01",
"tipoMem": "String",
"index": 0,
"size": 20,
"displOrdinal": 1
},
"setArtNum": {
"name": "setArtNum",
"description": "# Num Articolo",
"memAddr": "MACRO.966",
"tipoMem": "Int",
"index": 966,
"size": 4,
"displOrdinal": 1
},
"setComm": {
"name": "setComm",
"description": "Commessa",
"memAddr": "NONE.02",
"tipoMem": "String",
"index": 0,
"size": 20,
"displOrdinal": 2
},
"setCommNum": {
"name": "setCommNum",
"description": "# NumCommessa",
"memAddr": "MACRO.965",
"tipoMem": "Int",
"index": 965,
"size": 4,
"displOrdinal": 2
},
"setPzComm": {
"name": "setPzComm",
"description": "Qta Richiesta",
"memAddr": "PAR.8003",
"tipoMem": "Int",
"index": 8003,
"size": 4,
"displOrdinal": 3
}
},
"mMapRead": {
"PZ_GTOT": {
"name": "PZ_GTOT",
"description": "Contatore GTot",
"memAddr": "",
"tipoMem": "Int",
"index": 0,
"size": 4,
"func": "MAX",
"period": 60,
"factor": 1,
"displOrdinal": 7
},
"PZ_COUNT": {
"name": "PZ_COUNT",
"description": "Contatore",
"memAddr": "",
"tipoMem": "Int",
"index": 0,
"size": 4,
"func": "MAX",
"period": 60,
"factor": 1,
"displOrdinal": 8
},
"PROG": {
"name": "PROG",
"description": "Programma",
"memAddr": "",
"tipoMem": "Int",
"index": 0,
"size": 4,
"func": "MAX",
"period": 60,
"factor": 1,
"displOrdinal": 9
}
},
"mMapWriteLink": {
"setArt": "setArtNum",
"setComm": "setCommNum"
}
}
+57 -114
View File
@@ -444,6 +444,7 @@
<Compile Include="IobOpc\OpcUaEwonMecolpress.cs" />
<Compile Include="IobOpc\OpcUaEwonMonti.cs" />
<Compile Include="IobSiemens\SiemensNWSE.cs" />
<Compile Include="Iob\Mitsubishi.cs" />
<Compile Include="TcAdsClient.cs" />
<Compile Include="Enums.cs" />
<Compile Include="ControlExtensions.cs" />
@@ -510,16 +511,10 @@
<None Include="DATA\CONF\2014.ini" />
<None Include="DATA\CONF\2014.json" />
<None Include="DATA\CONF\3028.json" />
<None Include="DATA\CONF\3028.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\3028.ini" />
<None Include="DATA\CONF\GIACO_CENTERFRIGO_MBlock_all.json" />
<None Include="DATA\CONF\FTP_SONATEST.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\FTP_SONATEST.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\FTP_SONATEST.ini" />
<None Include="DATA\CONF\FTP_SONATEST.json" />
<None Include="DATA\CONF\GT593.ini" />
<None Include="DATA\CONF\GT593.json" />
<None Include="DATA\CONF\GT613.ini" />
@@ -535,53 +530,28 @@
<None Include="DATA\CONF\GT696.ini" />
<None Include="DATA\CONF\GT694.ini" />
<None Include="DATA\CONF\GT693.ini" />
<None Include="DATA\CONF\IMI_SONATEST.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\IMI_SONATEST.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\IMI_SONATEST.ini" />
<None Include="DATA\CONF\IMI_SONATEST.json" />
<None Include="DATA\CONF\FOV098.ini" />
<None Include="DATA\CONF\FOV099.ini" />
<None Include="DATA\CONF\L019.ini" />
<None Include="DATA\CONF\L020.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\L020.json" />
<None Include="DATA\CONF\L020_Rest.wrong.json" />
<None Include="DATA\CONF\L020.ini">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\VL27.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\VL27.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\SIMUL_01.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\L020.ini" />
<None Include="DATA\CONF\SIMUL_01_WD.ini" />
<None Include="DATA\CONF\VL27.json" />
<None Include="DATA\CONF\VL27.ini" />
<None Include="DATA\CONF\SIMUL_01.json" />
<None Include="DATA\CONF\STEL_210.ini" />
<None Include="DATA\CONF\STEL_210.json" />
<None Include="DATA\CONF\TFT_RAMA_001.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\TFT_RAMA_001.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\STEL_210_alarm.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\TFT_RAMA_001_alarm.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\IMI_GOMBA.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\TFT_RAMA_001.ini" />
<None Include="DATA\CONF\TFT_RAMA_001.json" />
<None Include="DATA\CONF\STEL_210_alarm.json" />
<None Include="DATA\CONF\TFT_RAMA_001_alarm.json" />
<None Include="DATA\CONF\IMI_GOMBA.json" />
<None Include="DATA\CONF\IMI_PAMA_392.ini" />
<None Include="DATA\CONF\IMI_PAMA_392.json" />
<None Include="DATA\CONF\IMI_GOMBA.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\IMI_GOMBA.ini" />
<None Include="DATA\CONF\IMI_SOITAAB_Z2342_02.ini" />
<None Include="DATA\CONF\IMI_SOITAAB_Z2342_02.json" />
<None Include="DATA\CONF\IMI_SOITAAB_Z2342_01.ini" />
@@ -608,6 +578,12 @@
<None Include="DATA\CONF\IMI_RIMOR_SAB_01_alarm.json" />
<None Include="DATA\CONF\IMI_RIMOR_SAB_01.json" />
<None Include="DATA\CONF\IMI_RIMOR_SAB_01.ini" />
<None Include="DATA\CONF\VL28.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\VL28.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\MES_Setup\setupConsumi.json" />
<None Include="DATA\PROC\setupConsumi.json" />
<None Include="Tools\ExcImport.exe">
@@ -617,12 +593,8 @@
<None Include="DATA\CONF\1033.ini" />
<None Include="DATA\CONF\3026-MBus.ini" />
<None Include="DATA\CONF\3026-MBus.json" />
<None Include="DATA\CONF\BAGLIETTO_CIMOLAI_01.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\BAGLIETTO_CIMOLAI_01.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\BAGLIETTO_CIMOLAI_01.ini" />
<None Include="DATA\CONF\BAGLIETTO_CIMOLAI_01.json" />
<None Include="DATA\CONF\3026.ini" />
<None Include="DATA\CONF\3026.json" />
<None Include="DATA\CONF\GIACO_CEDAX_001.ini" />
@@ -639,9 +611,7 @@
<None Include="DATA\CONF\GIACO_CEDAX_003.json" />
<None Include="DATA\CONF\GIACO_CEDAX_003_alarm.json" />
<None Include="DATA\CONF\GIACO_CEDAX_003_MBlock.json" />
<None Include="DATA\CONF\BAGLIETTO_CIMOLAI_01_alarm.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\BAGLIETTO_CIMOLAI_01_alarm.json" />
<None Include="DATA\CONF\GIACO_CENTERFRIGO_MBlock.json" />
<None Include="DATA\CONF\GIACO_CENTERFRIGO_alarm.json" />
<None Include="DATA\CONF\GIACO_CENTERFRIGO.ini" />
@@ -700,9 +670,7 @@
<None Include="DATA\CONF\GT594.json" />
<None Include="DATA\CONF\L018.ini" />
<None Include="DATA\CONF\SIM_DP_02.json" />
<None Include="DATA\CONF\SIM_DP_01.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\SIM_DP_01.json" />
<None Include="DATA\IobOpcUaClient.Config.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
@@ -853,9 +821,7 @@
<None Include="DATA\CONF\SIMUL_04.json" />
<None Include="DATA\CONF\SIMUL_03.json" />
<None Include="DATA\CONF\SIMUL_02.json" />
<None Include="DATA\CONF\SIMUL_01_alarm.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\SIMUL_01_alarm.json" />
<None Include="DATA\CONF\INTERCL_02.json" />
<None Include="DATA\CONF\INTERCL_01.json" />
<None Include="DATA\CONF\3019.json" />
@@ -878,12 +844,8 @@
<None Include="DATA\CONF\SIMUL_06.ini" />
<None Include="DATA\CONF\SIMUL_05.ini" />
<None Include="DATA\CONF\SIM_DP_02.ini" />
<None Include="DATA\CONF\SIM_DP_01.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\SIMUL_01.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="DATA\CONF\SIM_DP_01.ini" />
<None Include="DATA\CONF\SIMUL_01.ini" />
<None Include="DATA\CONF\SIMUL_02.ini" />
<None Include="DATA\CONF\3006.ini" />
<None Include="DATA\CONF\3007.ini" />
@@ -947,51 +909,21 @@
<None Include="EUR63_JOB\.placeholder">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="EUR63_JOB\SESS0000.REQ">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="EUR63_JOB\SESS0001.JOB">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="EUR63_JOB\SESS0001.REQ">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="EUR63_JOB\SESS0019.JOB">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="EUR63_JOB\SESS0019.REQ">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="EUR63_JOB\SESS0003.JOB">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="EUR63_JOB\SESS0003.REQ">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="EUR63_JOB\SESS0002.JOB">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="EUR63_JOB\SESS0002.REQ">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="EUR63_JOB\SESS0010.JOB">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="EUR63_JOB\SESS0010.REQ">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="EUR63_JOB\SESS0004.JOB">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="EUR63_JOB\SESS0004.REQ">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="EUR63_JOB\SESS0005.JOB">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="EUR63_JOB\SESS0005.REQ">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="EUR63_JOB\SESS0000.REQ" />
<None Include="EUR63_JOB\SESS0001.JOB" />
<None Include="EUR63_JOB\SESS0001.REQ" />
<None Include="EUR63_JOB\SESS0019.JOB" />
<None Include="EUR63_JOB\SESS0019.REQ" />
<None Include="EUR63_JOB\SESS0003.JOB" />
<None Include="EUR63_JOB\SESS0003.REQ" />
<None Include="EUR63_JOB\SESS0002.JOB" />
<None Include="EUR63_JOB\SESS0002.REQ" />
<None Include="EUR63_JOB\SESS0010.JOB" />
<None Include="EUR63_JOB\SESS0010.REQ" />
<None Include="EUR63_JOB\SESS0004.JOB" />
<None Include="EUR63_JOB\SESS0004.REQ" />
<None Include="EUR63_JOB\SESS0005.JOB" />
<None Include="EUR63_JOB\SESS0005.REQ" />
<None Include="DATA\HIST\.placeholder">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
@@ -1050,6 +982,17 @@
<Name>IOB-UT-NEXT</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<COMReference Include="EZNCAUTLib">
<Guid>{1B93D6AF-FD32-4281-83FE-533F666FAE6C}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>"$(ProjectDir)setupTgt.bat" "$(ConfigurationName)" "$(ProjectDir)"</PreBuildEvent>
+4 -5
View File
@@ -24,6 +24,7 @@ namespace IOB_WIN_NEXT.Iob
/// <param name="adpConf"></param>
public Fanuc(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf)
{
lgInfo("Start init Fanuc");
// i dati RAW principali sono 6 byte...
RawInput = new byte[6];
@@ -89,7 +90,7 @@ namespace IOB_WIN_NEXT.Iob
string memArea = "";
for (int i = 0; i < 8; i++)
{
currBit = string.Format("BIT{0}", i);
currBit = $"BIT{i}";
memArea = fIni.ReadString("MEMORY", currBit, "");
// se trovo un valore...
if (!string.IsNullOrEmpty(memArea))
@@ -103,7 +104,7 @@ namespace IOB_WIN_NEXT.Iob
enablePzCountByIob = (getOptPar("ENABLE_PZCOUNT") == "TRUE");
disablePzCountByIob = (getOptPar("DISABLE_PZCOUNT") == "TRUE");
// gestione override contatore articoli...
// gestione override idx articoli...
if (!string.IsNullOrEmpty(getOptPar("NUM_ART_CHR_TRIM")))
{
string NUM_ART_CHR_TRIM = getOptPar("NUM_ART_CHR_TRIM");
@@ -2036,7 +2037,7 @@ namespace IOB_WIN_NEXT.Iob
int byte2check = 0;
for (int i = 0; i < 8; i++)
{
bKey = string.Format("BIT{0}", i);
bKey = $"BIT{i}";
// cerco se ci sia in LUT
if (signLUT.ContainsKey(bKey))
{
@@ -2376,13 +2377,11 @@ namespace IOB_WIN_NEXT.Iob
lgTrace($"inizio getValByMemAddr | memAddr: {memAddr}");
string answ = "";
// verifico quale modalità sia richiesta: STD (6711) oppure BIT (Custom, con indicazione area)
#if true
if (memAddr.StartsWith("STD"))
{
// inizio verifica area memoria/parametro levando prima parte codice
memAddr = memAddr.Replace("STD.", "");
}
#endif
// var di appoggio
int cntAddr = 0;
object outputVal = new object();
+134 -124
View File
@@ -735,6 +735,46 @@ namespace IOB_WIN_NEXT.Iob
}
}
/// <summary>
/// URL per recupero traduzione CodArt in numerico...
/// </summary>
public string urlGetNumArt
{
get
{
string answ = "";
try
{
answ = $@"{cIobConf.serverData.TRANSP}://{cIobConf.serverData.MPIP}{cIobConf.serverData.MPURL}{cIobConf.serverData.CMDALIVE}/getArtNum/{cIobConf.codIOB}";
}
catch (Exception exc)
{
lgError(exc, "Errore in composizione urlGetNumArt");
}
return answ;
}
}
/// <summary>
/// URL per recupero traduzione CodComm in numerico...
/// </summary>
public string urlGetNumComm
{
get
{
string answ = "";
try
{
answ = $@"{cIobConf.serverData.TRANSP}://{cIobConf.serverData.MPIP}{cIobConf.serverData.MPURL}{cIobConf.serverData.CMDALIVE}/getXdlNum/{cIobConf.codIOB}";
}
catch (Exception exc)
{
lgError(exc, "Errore in composizione urlGetNumComm");
}
return answ;
}
}
/// <summary>
/// URL per recupero num pezzi ODL corrente...
/// </summary>
@@ -835,46 +875,6 @@ namespace IOB_WIN_NEXT.Iob
}
}
/// <summary>
/// URL per recupero traduzione CodArt in numerico...
/// </summary>
public string urlGetNumArt
{
get
{
string answ = "";
try
{
answ = $@"{cIobConf.serverData.TRANSP}://{cIobConf.serverData.MPIP}{cIobConf.serverData.MPURL}{cIobConf.serverData.CMDALIVE}/getArtNum/{cIobConf.codIOB}";
}
catch (Exception exc)
{
lgError(exc, "Errore in composizione urlGetNumArt");
}
return answ;
}
}
/// <summary>
/// URL per recupero traduzione CodComm in numerico...
/// </summary>
public string urlGetNumComm
{
get
{
string answ = "";
try
{
answ = $@"{cIobConf.serverData.TRANSP}://{cIobConf.serverData.MPIP}{cIobConf.serverData.MPURL}{cIobConf.serverData.CMDALIVE}/getXdlNum/{cIobConf.codIOB}";
}
catch (Exception exc)
{
lgError(exc, "Errore in composizione urlGetNumComm");
}
return answ;
}
}
/// <summary>
/// URL per recupero idle time IOB...
/// </summary>
@@ -1551,7 +1551,8 @@ namespace IOB_WIN_NEXT.Iob
break;
case taskType.setArtNum:
// in primis faccio una chiamata per tutta la tab SE fosse vuoto il dict di traduzione
// in primis faccio una chiamata per tutta la tab SE fosse vuoto il
// dict di traduzione
if (DictNumArt == null || DictNumArt.Count == 0)
{
getNumArt("");
@@ -2907,7 +2908,7 @@ namespace IOB_WIN_NEXT.Iob
}
}
// verifico parametro sintesi... che ricalcolo ogni volta
if(!currDynData.ContainsKey("DYNDATA"))
if (!currDynData.ContainsKey("DYNDATA"))
{
currDynData.Add("DYNDATA", "");
}
@@ -4463,6 +4464,11 @@ namespace IOB_WIN_NEXT.Iob
/// </summary>
protected bool needRefresh = true;
/// <summary>
/// Indica se usare la parte numerica di un articolo come codice INT
/// </summary>
protected bool numArtCharTrim = false;
/// <summary>
/// Variabile numero errori vari (in lettura) --&gt; se supera soglia maxErroriCheck --&gt; disconnette
/// </summary>
@@ -4478,6 +4484,14 @@ namespace IOB_WIN_NEXT.Iob
/// </summary>
protected int pzCountDelay;
/// <summary>
/// Periodo di campionamento x refresh info
/// </summary>
protected int samplePeriod = 1000;
/// <summary>
/// Sample Period base x campionamenti tpo OCP-UA
/// </summary>
protected int samplePeriodBase = 600;
/// <summary>
@@ -4557,6 +4571,8 @@ namespace IOB_WIN_NEXT.Iob
}
}
protected Dictionary<string, string> DictNumArt { get; set; } = new Dictionary<string, string>();
/// <summary>
/// Folder in cui è presente il tool import excel + file json di conf
/// </summary>
@@ -5275,6 +5291,82 @@ namespace IOB_WIN_NEXT.Iob
return answ;
}
/// <summary>
/// Recupera valore numerico ARTICOLO x salvataggio valori INT
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
protected string getNumArt(string value)
{
string answ = "";
// cerco in dizionario corrente...
if (DictNumArt.Count > 0 && DictNumArt.ContainsKey(value))
{
answ = DictNumArt[value];
}
// altrimenti chiamo servizio
else
{
// chiamo MP-IO server
if (checkServerAlive)
{
string url2call = $"{urlGetNumArt}?CodArt={value}";
if (verboseLog)
{
lgInfo("chiamata URL " + url2call);
}
var rawData = utils.callUrlNow(url2call);
// deserializzo e recupero KVP...
var dictArtSrv = JsonConvert.DeserializeObject<Dictionary<string, string>>(rawData);
// se fosse una chiamata con valore vuoto --> salvo intera tabella...
if (string.IsNullOrEmpty(value))
{
DictNumArt = dictArtSrv;
}
// altrimenti aggiungo a dizionario
else
{
foreach (var item in dictArtSrv)
{
if (!DictNumArt.ContainsKey(item.Key))
{
DictNumArt.Add(item.Key, item.Value);
}
}
}
// ora cerco valore e restituisco
if (DictNumArt.ContainsKey(value))
{
answ = DictNumArt[value];
}
}
}
return answ;
}
/// <summary>
/// Recupera valore numerico COMMESSA x salvataggio valori INT
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
protected string getNumComm(string value)
{
string answ = "";
// chiamo MP-IO server
if (checkServerAlive)
{
string url2call = $"{urlGetNumComm}?CodXdl={value}";
if (verboseLog)
{
lgInfo("chiamata URL " + url2call);
}
// è direttamente il risultato!
answ = utils.callUrlNow(url2call);
}
// restituisco
return answ;
}
/// <summary>
/// Stringa raw dei parametri da scrivere...
/// </summary>
@@ -7766,84 +7858,6 @@ namespace IOB_WIN_NEXT.Iob
}
}
/// <summary>
/// Recupera valore numerico ARTICOLO x salvataggio valori INT
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
protected string getNumArt(string value)
{
string answ = "";
// cerco in dizionario corrente...
if (DictNumArt.Count > 0 && DictNumArt.ContainsKey(value))
{
answ = DictNumArt[value];
}
// altrimenti chiamo servizio
else
{
// chiamo MP-IO server
if (checkServerAlive)
{
string url2call = $"{urlGetNumArt}?CodArt={value}";
if (verboseLog)
{
lgInfo("chiamata URL " + url2call);
}
var rawData = utils.callUrlNow(url2call);
// deserializzo e recupero KVP...
var dictArtSrv = JsonConvert.DeserializeObject<Dictionary<string, string>>(rawData);
// se fosse una chiamata con valore vuoto --> salvo intera tabella...
if (string.IsNullOrEmpty(value))
{
DictNumArt = dictArtSrv;
}
// altrimenti aggiungo a dizionario
else
{
foreach (var item in dictArtSrv)
{
if (!DictNumArt.ContainsKey(item.Key))
{
DictNumArt.Add(item.Key, item.Value);
}
}
}
// ora cerco valore e restituisco
if (DictNumArt.ContainsKey(value))
{
answ = DictNumArt[value];
}
}
}
return answ;
}
protected Dictionary<string, string> DictNumArt { get; set; } = new Dictionary<string, string>();
/// <summary>
/// Recupera valore numerico COMMESSA x salvataggio valori INT
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
protected string getNumComm(string value)
{
string answ = "";
// chiamo MP-IO server
if (checkServerAlive)
{
string url2call = $"{urlGetNumComm}?CodXdl={value}";
if (verboseLog)
{
lgInfo("chiamata URL " + url2call);
}
// è direttamente il risultato!
answ = utils.callUrlNow(url2call);
}
// restituisco
return answ;
}
#if false
/// <summary>
/// Traduzione del valore chiave configurato dal dizionario RecipeKeyTranslate + BaseKeyTranslate
@@ -8094,10 +8108,6 @@ namespace IOB_WIN_NEXT.Iob
accodaFLog(sVal, qEncodeFLog("PROG", currPrgName));
}
}
/// <summary>
/// Indica se usare la parte numerica di un articolo come codice INT
/// </summary>
protected bool numArtCharTrim = false;
/// <summary>
/// Processo lettura dati sysinfo
File diff suppressed because it is too large Load Diff
-2
View File
@@ -270,8 +270,6 @@ namespace IOB_WIN_NEXT.IobRest
/// </summary>
protected Dictionary<string, string> RestDataLUT = new Dictionary<string, string>();
protected int samplePeriod = 1000;
/// <summary>
/// Timeout chiamate REST
/// </summary>
+9
View File
@@ -131,6 +131,15 @@ namespace IOB_WIN_NEXT
string answ = new string(input.Where(c => char.IsLetter(c) || char.IsDigit(c)).ToArray());
return answ;
}
/// <summary>
/// Converte una stringa libera in una stringa valida (ovvero SOLO numeri/lettere)
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public static string purgedChar2String(string input)
{
return purgedChar2String(input.ToCharArray());
}
#endregion Public Methods
}
+18 -6
View File
@@ -38,11 +38,11 @@ namespace Mitsubishi
// [Local variable declaration]
object BlockValue = "";
int Ret = 0;
int iRet = 0;
//Open communication
Ret = oEZNcAutCom.SetTCPIPProtocol("192.168.213.199", 683);
//Console.WriteLine($"R: {Ret}");
Ret = oEZNcAutCom.Open3(5, 1, 10, "EZNC_LOCALHOST");
iRet = oEZNcAutCom.SetTCPIPProtocol("192.168.213.199", 683);
//Console.WriteLine($"R: {iRet}");
iRet = oEZNcAutCom.Open3(5, 1, 10, "EZNC_LOCALHOST");
DoLog(sep);
DoLog("Retrieve Serial/Vers");
@@ -90,6 +90,12 @@ namespace Mitsubishi
// preparo memorie
string prgText = "";
int prgState = 0;
// solo nome...
iRet = oEZNcAutCom.Program_GetProgramNumber2((Int32)PROGRAMTYPE.EZNC_MAINPRG, out String strProgramNo);
DoLog($"ProgramName: {strProgramNo}");
DoLog("");
// leggo contenuto
try
{
oEZNcAutCom.Program_CurrentBlockRead(10, out prgText, out prgState);
@@ -125,7 +131,7 @@ namespace Mitsubishi
double pdPosit = 0;
for (int i = 1; i < 4; i++)
{
Ret = oEZNcAutCom.Position_GetCurrentPosition(i, out pdPosit);
iRet = oEZNcAutCom.Position_GetCurrentPosition(i, out pdPosit);
DoLog($"Pos: {i} | {pdPosit}");
}
DoLog(sep);
@@ -287,7 +293,7 @@ namespace Mitsubishi
DoLog("");
// Close.
Ret = oEZNcAutCom.Close();
iRet = oEZNcAutCom.Close();
//Release object
oEZNcAutCom = null;
@@ -302,6 +308,12 @@ namespace Mitsubishi
Console.WriteLine(logMessage);
}
public enum PROGRAMTYPE
{
EZNC_MAINPRG = 0, //メインプログラム
EZNC_SUBPRG = 1, //サブプログラム
}
protected static string outPath = "";
private static string sep = "------------------------";