prima modifica con inserimento nuove variabili (da testare)

This commit is contained in:
Samuele E. Locatelli
2017-02-28 23:18:27 +01:00
parent ba56593acb
commit 6700bec68d
+57 -3
View File
@@ -35,9 +35,14 @@ namespace SCMCncLib
private UInt16 WriteNumber;
private UInt16 VAreaByteSize;
private UInt16 EOKAreaByteSize;
private UInt16 ETKAreaByteSize;
private UInt16 ETKAreaByteSize;
private UInt16 AlarmByteSize;
private UInt16 IOTByteAreaByteSize;
private UInt16 IOTWordAreaByteSize;
private UInt16 IOTDWordAreaByteSize;
private UInt16 IOTStringAreaByteSize;
private string SysLink = "";
private string DefCn = "";
@@ -58,11 +63,24 @@ namespace SCMCncLib
private TS_REG EOKAreaAddress;
private string ETKAreaAddressName;
private TS_REG ETKAreaAddress;
private TS_REG ETKAreaAddress;
private string PlcErrAreaAddressName;
private TS_REG PlcErrAreaAddress;
private string IOTByteAreaAddressName;
private TS_REG IOTByteAreaAddress;
private string IOTWordAreaAddressName;
private TS_REG IOTWordAreaAddress;
private string IOTDWordAreaAddressName;
private TS_REG IOTDWordAreaAddress;
private string IOTStringAreaAddressName;
private TS_REG IOTStringAreaAddress;
/// <summary>
/// Memorie a 4 byte (32 bit)
/// </summary>
@@ -94,6 +112,25 @@ namespace SCMCncLib
/// </summary>
public Byte[] PLC_MemoryAreaAllarmi;
/// <summary>
/// memorie a 1 byte (8 bit) x area IOT.Byte
/// </summary>
public UInt32[] PLC_MemoryAreaIOTByte;
/// <summary>
/// memorie a 2 byte (16 bit) x area IOT.Word
/// </summary>
public uint[] PLC_MemoryAreaIOTWord;
/// <summary>
/// memorie a 4 byte (32 bit) x area IOT.DWord
/// </summary>
public UInt32[] PLC_MemoryAreaIOTDWord;
/// <summary>
/// memorie stringa x area IOT.String
/// </summary>
public UInt32[] PLC_MemoryAreaIOTString;
// esa constants
#region ESA_PLC_CONSTANTS
private const UInt32 MAX_PATH = 256;
@@ -258,6 +295,23 @@ namespace SCMCncLib
// leggo da posizione memorie EOK TS_REG
iError = read_regbuffer(ref EOKAreaAddress, 60, EOKAreaByteSize, PLC_MemoryAreaEOK);
// 2017.02: modifiche x nuova versione PLC
// leggo intero buffer BYTE
iError = read_regbuffer(ref IOTByteAreaAddress, 0, IOTByteAreaByteSize, PLC_MemoryAreaIOTByte);
// leggo intero buffer WORD
iError = read_regbuffer(ref IOTWordAreaAddress, 0, IOTWordAreaByteSize, PLC_MemoryAreaIOTWord);
// leggo intero buffer DWORD
iError = read_regbuffer(ref IOTDWordAreaAddress, 0, IOTDWordAreaByteSize, PLC_MemoryAreaIOTDWord);
// leggo intero buffer STRING
iError = read_regbuffer(ref IOTStringAreaAddress, 0, IOTStringAreaByteSize, PLC_MemoryAreaIOTString);
// copio in array a byte...
try
{