├── .gitattributes ├── .gitignore ├── OPC2Modbus.sln ├── OPC2Modbus ├── App.config ├── FormPrincipal.Designer.cs ├── FormPrincipal.cs ├── FormPrincipal.resx ├── OPC2Modbus.csproj ├── OPCItem.cs ├── Program.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings ├── docs │ └── RS2LAN Refrigeration Installation Manual 1.4.pdf ├── etc │ └── OPC2Modbus.csv ├── img │ └── OPC2Modbus.ico ├── lib │ ├── EasyModbus.dll │ └── Interop.OPCAutomation.dll ├── packages.config └── scripts │ └── CreateLog4NetTable.sql └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | 9 | # Build results 10 | [Dd]ebug/ 11 | [Dd]ebugPublic/ 12 | [Rr]elease/ 13 | x64/ 14 | build/ 15 | bld/ 16 | [Bb]in/ 17 | [Oo]bj/ 18 | 19 | # Roslyn cache directories 20 | *.ide/ 21 | 22 | # MSTest test Results 23 | [Tt]est[Rr]esult*/ 24 | [Bb]uild[Ll]og.* 25 | 26 | #NUNIT 27 | *.VisualState.xml 28 | TestResult.xml 29 | 30 | # Build Results of an ATL Project 31 | [Dd]ebugPS/ 32 | [Rr]eleasePS/ 33 | dlldata.c 34 | 35 | *_i.c 36 | *_p.c 37 | *_i.h 38 | *.ilk 39 | *.meta 40 | *.obj 41 | *.pch 42 | *.pdb 43 | *.pgc 44 | *.pgd 45 | *.rsp 46 | *.sbr 47 | *.tlb 48 | *.tli 49 | *.tlh 50 | *.tmp 51 | *.tmp_proj 52 | *.log 53 | *.vspscc 54 | *.vssscc 55 | .builds 56 | *.pidb 57 | *.svclog 58 | *.scc 59 | 60 | # Chutzpah Test files 61 | _Chutzpah* 62 | 63 | # Visual C++ cache files 64 | ipch/ 65 | *.aps 66 | *.ncb 67 | *.opensdf 68 | *.sdf 69 | *.cachefile 70 | 71 | # Visual Studio profiler 72 | *.psess 73 | *.vsp 74 | *.vspx 75 | 76 | # TFS 2012 Local Workspace 77 | $tf/ 78 | 79 | # Guidance Automation Toolkit 80 | *.gpState 81 | 82 | # ReSharper is a .NET coding add-in 83 | _ReSharper*/ 84 | *.[Rr]e[Ss]harper 85 | *.DotSettings.user 86 | 87 | # JustCode is a .NET coding addin-in 88 | .JustCode 89 | 90 | # TeamCity is a build add-in 91 | _TeamCity* 92 | 93 | # DotCover is a Code Coverage Tool 94 | *.dotCover 95 | 96 | # NCrunch 97 | _NCrunch_* 98 | .*crunch*.local.xml 99 | 100 | # MightyMoose 101 | *.mm.* 102 | AutoTest.Net/ 103 | 104 | # Web workbench (sass) 105 | .sass-cache/ 106 | 107 | # Installshield output folder 108 | [Ee]xpress/ 109 | 110 | # DocProject is a documentation generator add-in 111 | DocProject/buildhelp/ 112 | DocProject/Help/*.HxT 113 | DocProject/Help/*.HxC 114 | DocProject/Help/*.hhc 115 | DocProject/Help/*.hhk 116 | DocProject/Help/*.hhp 117 | DocProject/Help/Html2 118 | DocProject/Help/html 119 | 120 | # Click-Once directory 121 | publish/ 122 | 123 | # Publish Web Output 124 | *.[Pp]ublish.xml 125 | *.azurePubxml 126 | ## TODO: Comment the next line if you want to checkin your 127 | ## web deploy settings but do note that will include unencrypted 128 | ## passwords 129 | #*.pubxml 130 | 131 | # NuGet Packages Directory 132 | packages/* 133 | ## TODO: If the tool you use requires repositories.config 134 | ## uncomment the next line 135 | #!packages/repositories.config 136 | 137 | # Enable "build/" folder in the NuGet Packages folder since 138 | # NuGet packages use it for MSBuild targets. 139 | # This line needs to be after the ignore of the build folder 140 | # (and the packages folder if the line above has been uncommented) 141 | !packages/build/ 142 | 143 | # Windows Azure Build Output 144 | csx/ 145 | *.build.csdef 146 | 147 | # Windows Store app package directory 148 | AppPackages/ 149 | 150 | # Others 151 | sql/ 152 | *.Cache 153 | ClientBin/ 154 | [Ss]tyle[Cc]op.* 155 | ~$* 156 | *~ 157 | *.dbmdl 158 | *.dbproj.schemaview 159 | *.pfx 160 | *.publishsettings 161 | node_modules/ 162 | 163 | # RIA/Silverlight projects 164 | Generated_Code/ 165 | 166 | # Backup & report files from converting an old project file 167 | # to a newer Visual Studio version. Backup files are not needed, 168 | # because we have git ;-) 169 | _UpgradeReport_Files/ 170 | Backup*/ 171 | UpgradeLog*.XML 172 | UpgradeLog*.htm 173 | 174 | # SQL Server files 175 | *.mdf 176 | *.ldf 177 | 178 | # Business Intelligence projects 179 | *.rdl.data 180 | *.bim.layout 181 | *.bim_*.settings 182 | 183 | # Microsoft Fakes 184 | FakesAssemblies/ 185 | 186 | # LightSwitch generated files 187 | GeneratedArtifacts/ 188 | _Pvt_Extensions/ 189 | ModelManifest.xml -------------------------------------------------------------------------------- /OPC2Modbus.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Express 2013 for Windows Desktop 4 | VisualStudioVersion = 12.0.31101.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OPC2Modbus", "OPC2Modbus\OPC2Modbus.csproj", "{A716887F-4119-4031-9294-296B979F051B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {A716887F-4119-4031-9294-296B979F051B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {A716887F-4119-4031-9294-296B979F051B}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {A716887F-4119-4031-9294-296B979F051B}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {A716887F-4119-4031-9294-296B979F051B}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /OPC2Modbus/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | INFO 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /OPC2Modbus/FormPrincipal.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace OPC2Modbus 2 | { 3 | partial class Opc2Modbus 4 | { 5 | /// 6 | /// Variable del diseñador requerida. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Limpiar los recursos que se estén utilizando. 12 | /// 13 | /// true si los recursos administrados se deben desechar; false en caso contrario. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Código generado por el Diseñador de Windows Forms 24 | 25 | /// 26 | /// Método necesario para admitir el Diseñador. No se puede modificar 27 | /// el contenido del método con el editor de código. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Opc2Modbus)); 33 | this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components); 34 | this.contextMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); 35 | this.ConfigToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 36 | this.SalirToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 37 | this.toolStrip = new System.Windows.Forms.ToolStrip(); 38 | this.Configuración = new System.Windows.Forms.ToolStripLabel(); 39 | this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); 40 | this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel(); 41 | this.AcercaDeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); 42 | this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); 43 | this.contextMenuStrip.SuspendLayout(); 44 | this.toolStrip.SuspendLayout(); 45 | this.SuspendLayout(); 46 | // 47 | // notifyIcon 48 | // 49 | this.notifyIcon.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info; 50 | this.notifyIcon.BalloonTipText = "RS2LAN OPC to Modbus TCP"; 51 | this.notifyIcon.BalloonTipTitle = "OPC2Modbus"; 52 | this.notifyIcon.ContextMenuStrip = this.contextMenuStrip; 53 | this.notifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon.Icon"))); 54 | this.notifyIcon.Text = "OPC2Modbus"; 55 | this.notifyIcon.Visible = true; 56 | this.notifyIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.configToolStripMenuItem_Click); 57 | // 58 | // contextMenuStrip 59 | // 60 | this.contextMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 61 | this.ConfigToolStripMenuItem, 62 | this.AcercaDeToolStripMenuItem, 63 | this.toolStripSeparator2, 64 | this.SalirToolStripMenuItem}); 65 | this.contextMenuStrip.Name = "contextMenuStrip1"; 66 | this.contextMenuStrip.Size = new System.Drawing.Size(160, 98); 67 | // 68 | // ConfigToolStripMenuItem 69 | // 70 | this.ConfigToolStripMenuItem.Name = "ConfigToolStripMenuItem"; 71 | this.ConfigToolStripMenuItem.Size = new System.Drawing.Size(159, 22); 72 | this.ConfigToolStripMenuItem.Text = "Configuración..."; 73 | this.ConfigToolStripMenuItem.Click += new System.EventHandler(this.configToolStripMenuItem_Click); 74 | // 75 | // SalirToolStripMenuItem 76 | // 77 | this.SalirToolStripMenuItem.Name = "SalirToolStripMenuItem"; 78 | this.SalirToolStripMenuItem.Size = new System.Drawing.Size(159, 22); 79 | this.SalirToolStripMenuItem.Text = "Salir"; 80 | this.SalirToolStripMenuItem.Click += new System.EventHandler(this.salirToolStripMenuItem_Click); 81 | // 82 | // toolStrip 83 | // 84 | this.toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { 85 | this.Configuración, 86 | this.toolStripSeparator1, 87 | this.toolStripLabel2}); 88 | this.toolStrip.Location = new System.Drawing.Point(0, 0); 89 | this.toolStrip.Name = "toolStrip"; 90 | this.toolStrip.Size = new System.Drawing.Size(507, 25); 91 | this.toolStrip.TabIndex = 1; 92 | this.toolStrip.Text = "toolStrip1"; 93 | // 94 | // Configuración 95 | // 96 | this.Configuración.Name = "Configuración"; 97 | this.Configuración.Size = new System.Drawing.Size(83, 22); 98 | this.Configuración.Text = "Configuración"; 99 | // 100 | // toolStripSeparator1 101 | // 102 | this.toolStripSeparator1.Name = "toolStripSeparator1"; 103 | this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25); 104 | // 105 | // toolStripLabel2 106 | // 107 | this.toolStripLabel2.Name = "toolStripLabel2"; 108 | this.toolStripLabel2.RightToLeftAutoMirrorImage = true; 109 | this.toolStripLabel2.Size = new System.Drawing.Size(68, 22); 110 | this.toolStripLabel2.Text = "Acerca de..."; 111 | // 112 | // AcercaDeToolStripMenuItem 113 | // 114 | this.AcercaDeToolStripMenuItem.Name = "AcercaDeToolStripMenuItem"; 115 | this.AcercaDeToolStripMenuItem.Size = new System.Drawing.Size(159, 22); 116 | this.AcercaDeToolStripMenuItem.Text = "Acerca de..."; 117 | // 118 | // toolStripSeparator2 119 | // 120 | this.toolStripSeparator2.Name = "toolStripSeparator2"; 121 | this.toolStripSeparator2.Size = new System.Drawing.Size(156, 6); 122 | // 123 | // Opc2Modbus 124 | // 125 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 126 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 127 | this.ClientSize = new System.Drawing.Size(507, 315); 128 | this.Controls.Add(this.toolStrip); 129 | this.HelpButton = true; 130 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 131 | this.MaximizeBox = false; 132 | this.Name = "Opc2Modbus"; 133 | this.Text = "Opc2Modbus"; 134 | this.WindowState = System.Windows.Forms.FormWindowState.Minimized; 135 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Opc2Modbus_FormClosing); 136 | this.Load += new System.EventHandler(this.Opc2Modbus_Load); 137 | this.Resize += new System.EventHandler(this.Opc2Modbus_Resize); 138 | this.contextMenuStrip.ResumeLayout(false); 139 | this.toolStrip.ResumeLayout(false); 140 | this.toolStrip.PerformLayout(); 141 | this.ResumeLayout(false); 142 | this.PerformLayout(); 143 | 144 | } 145 | 146 | #endregion 147 | 148 | private System.Windows.Forms.NotifyIcon notifyIcon; 149 | private System.Windows.Forms.ContextMenuStrip contextMenuStrip; 150 | private System.Windows.Forms.ToolStripMenuItem SalirToolStripMenuItem; 151 | private System.Windows.Forms.ToolStripMenuItem ConfigToolStripMenuItem; 152 | private System.Windows.Forms.ToolStrip toolStrip; 153 | private System.Windows.Forms.ToolStripLabel Configuración; 154 | private System.Windows.Forms.ToolStripLabel toolStripLabel2; 155 | private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; 156 | private System.Windows.Forms.ToolStripMenuItem AcercaDeToolStripMenuItem; 157 | private System.Windows.Forms.ToolStripSeparator toolStripSeparator2; 158 | 159 | 160 | } 161 | } 162 | 163 | -------------------------------------------------------------------------------- /OPC2Modbus/FormPrincipal.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | using System.IO; 5 | using OPCAutomation; 6 | using EasyModbus; 7 | 8 | namespace OPC2Modbus 9 | { 10 | 11 | public partial class Opc2Modbus : Form 12 | { 13 | public OPCServer ObjOPCServer; 14 | public OPCGroups ObjOPCGroups; 15 | public OPCGroup[] ObjOPCGroup; 16 | public ModbusServer modbusServer = new ModbusServer(); 17 | public Dictionary Items = new Dictionary(); 18 | public Boolean bExit = false; 19 | public Boolean bFatal = false; 20 | public Boolean bDebug = false; 21 | public int Compressors = 9; 22 | public int numItems = 100; 23 | public int numItemsCSV = 0; 24 | 25 | public Opc2Modbus() 26 | { 27 | InitializeComponent(); 28 | 29 | } 30 | 31 | private bool ReadItemsCSV() 32 | { 33 | try 34 | { 35 | //Read the items in the config file. 36 | StreamReader reader = new StreamReader(File.OpenRead(@"..\..\etc\OPC2Modbus.csv")); 37 | reader.ReadLine(); // Ignore the first line. 38 | while (!reader.EndOfStream) 39 | { 40 | String line = reader.ReadLine(); 41 | String[] values = line.Split(','); 42 | 43 | Items.Add(int.Parse(values[0]), new OPCItem { ItemID = values[1], Compressor = "C01", Description = values[2] }); 44 | numItemsCSV++; 45 | } 46 | reader.Close(); 47 | } 48 | catch (Exception ex) 49 | { 50 | OPC2Modbus.Program.Log.Fatal("Error al leer el archivo OPC2Modbus.csv. No existe o no tiene un formato correcto.", ex); 51 | MessageBox.Show("Error al leer el archivo OPC2Modbus.csv. No existe o no tiene un formato correcto.\n La aplicación va ha cerrarse.", "Error fatal", MessageBoxButtons.OK, MessageBoxIcon.Error); 52 | bExit = true; 53 | bFatal = true; 54 | Application.Exit(); 55 | return false; 56 | } 57 | 58 | //Initialize the rest of compressors 59 | for (int c = 1; c < Compressors; c++) 60 | { 61 | for (int i = 1; i <= numItemsCSV; i++) 62 | { 63 | Items.Add(c * numItems + i, new OPCItem { ItemID = Items[i].ItemID, Compressor = "C" + (c + 1).ToString("00"), Description = Items[i].Description }); 64 | } 65 | } 66 | return true; 67 | } 68 | 69 | private void Opc2Modbus_Load(object sender, EventArgs e) 70 | { 71 | if (ReadItemsCSV()) 72 | { 73 | // Visualize only in nofification bar. 74 | this.Hide(); 75 | this.WindowState = FormWindowState.Minimized; 76 | 77 | //Subscrib to OPC Server 78 | try 79 | { 80 | ObjOPCServer = new OPCServer(); 81 | ObjOPCGroup = new OPCGroup[Compressors]; 82 | String GroupName; 83 | 84 | //Conect to the server 85 | ObjOPCServer.Connect("POPCS.DAServer.1"); 86 | 87 | //Create a group 88 | ObjOPCGroups = ObjOPCServer.OPCGroups; 89 | 90 | for (int c = 0; c < Compressors; c++) 91 | { 92 | GroupName = "C" + (c + 1).ToString("00"); 93 | ObjOPCGroup[c] = ObjOPCGroups.Add(GroupName); 94 | 95 | //Define event DataChange 96 | ObjOPCGroup[c].DataChange += new DIOPCGroupEvent_DataChangeEventHandler(OPCGroup_DataChange); 97 | 98 | //Define DefaultAccessPath (necessary for POPCS.DAServer.1) 99 | ObjOPCGroup[c].OPCItems.DefaultAccessPath = GroupName; 100 | 101 | //Define Items. 102 | for (int i = 1; i <= numItemsCSV; i++) 103 | ObjOPCGroup[c].OPCItems.AddItem(Items[(c * numItems) + i].ItemID, (c * numItems) + i); 104 | 105 | //Group properties 106 | ObjOPCGroup[c].UpdateRate = 1000; 107 | ObjOPCGroup[c].IsActive = true; 108 | ObjOPCGroup[c].IsSubscribed = true; 109 | } 110 | } 111 | catch (Exception ex) 112 | { 113 | OPC2Modbus.Program.Log.Fatal("Error al suscribirse al servidor OPC", ex); 114 | MessageBox.Show("Error al suscribirse al servidor OPC.\n La aplicación va ha cerrarse.", "Error fatal", MessageBoxButtons.OK, MessageBoxIcon.Error); 115 | bExit = true; 116 | bFatal = true; 117 | Application.Exit(); 118 | } 119 | 120 | // Start modbus server. 121 | try 122 | { 123 | modbusServer.Listen(); 124 | } 125 | catch (Exception ex) 126 | { 127 | OPC2Modbus.Program.Log.Fatal("Error al iniciar el servidor Modbus TCP", ex); 128 | MessageBox.Show("Error al iniciar el servidor Modbus TCP.\n La aplicación va ha cerrarse.", "Error fatal", MessageBoxButtons.OK, MessageBoxIcon.Error); 129 | bExit = true; 130 | bFatal = true; 131 | Application.Exit(); 132 | } 133 | } 134 | } 135 | 136 | private void Opc2Modbus_Resize(object sender, EventArgs e) 137 | { 138 | if (FormWindowState.Minimized == WindowState) this.Hide(); 139 | } 140 | 141 | private void Opc2Modbus_FormClosing(object sender, FormClosingEventArgs e) 142 | { 143 | if (!bFatal) 144 | { 145 | if (bExit) 146 | { 147 | if (MessageBox.Show("¿Seguro que quiere dejar de ejecutar OPC2Modbus?", "Salir de la aplicación", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.Cancel) 148 | { 149 | e.Cancel = true; 150 | bExit = false; 151 | } 152 | } 153 | else 154 | { 155 | MessageBox.Show("OPC2Modbus va seguir ejecutándose en la barra de tareas.", "Aviso de funcionamiento", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); 156 | this.Hide(); 157 | this.WindowState = FormWindowState.Minimized; 158 | e.Cancel = true; 159 | } 160 | } 161 | } 162 | 163 | private void OPCGroup_DataChange(int TransactionID, int NumItems, ref Array ClientHandles, ref Array ItemValues, ref Array Qualities, ref Array TimeStamps) 164 | { 165 | for (int i = 1; i <= NumItems; i++) 166 | { 167 | try 168 | { 169 | modbusServer.holdingRegisters[(int)ClientHandles.GetValue(i)] = short.Parse(ItemValues.GetValue(i).ToString()); 170 | if (bDebug) 171 | OPC2Modbus.Program.Log.Debug("Parámetro [" + Items[i].ItemID + ": " + Items[i].Compressor + " - " + Items[i].Description + "]; Valor [" + ItemValues.GetValue(i) + "]"); 172 | } 173 | catch (Exception ex) 174 | { 175 | OPC2Modbus.Program.Log.Error("Parámetro [" + Items[i].ItemID + ": " + Items[i].Compressor + " - " + Items[i].Description + "]; Valor [" + ItemValues.GetValue(i) + "]", ex); 176 | } 177 | } 178 | } 179 | 180 | private void configToolStripMenuItem_Click(object sender, EventArgs e) 181 | { 182 | this.Show(); 183 | this.WindowState = FormWindowState.Normal; 184 | } 185 | 186 | private void salirToolStripMenuItem_Click(object sender, EventArgs e) 187 | { 188 | bExit = true; 189 | Application.Exit(); 190 | } 191 | 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /OPC2Modbus/FormPrincipal.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 130, 17 125 | 126 | 127 | 128 | 129 | AAABAAEAEBAAAAAAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAA 130 | AAD///8BADcPBQA8EBMAOxAVADsQFQA7EBUAOxAVADsQFQA7EBUAOxAVADsQFQA7EBUAOxAVADwQEwA4 131 | DwX///8BADgPBSNxOb0Wdy//EXgq/xF8Kv8RgCr/EYMq/xGEKf8RhCn/EYIp/xF+Kf8Rein/EXUp/xNy 132 | K/8XaC29ADwQBQA8EBMWcSn/AGsA/wB5AP8AhwD/AJQA/wCfAP8ApgD/AKYA/wCfAP+w1rD/rtOu/wh+ 133 | CP8AawD/FG4j/wBBERMAOxAVEGse/wBvAP8AfgD/AI4A/wCdAP8AqgD/ALUA/wC1AP8AqgD/dbB1/+jo 134 | 6P+y07L/CHQI/xBqHf8AQBEVADsQFQ9pGf8AcAD/AIAA/wCQAP8AoAD/AbAB/1zVXP9s2mz/bNFs/2rC 135 | av/I1Mj/6+vr/7TRtP8YbiL/AEARFQA7EBUNZxX/AG8A/wB/AP8AjgD/AJ0A/yGyIf/4+Pj//f39//39 136 | /f/19fX/6enp/+Pj4//t7e3/UIlW/wBAERUAOxAVC2QR/wBrAP8AegD/Jpkm/zGqMf8AoAD/I5kj/y+a 137 | L/8vli//OZM5/9Dc0P/j4+P/eZt5/w1jEv8AQBEVADsQFQliDf8AZgD/NY41/+Ho4f/O4M7/FZwV/xah 138 | Fv8VoRX/DZkN/7Hbsf/v7+//e597/wFlAf8KYQz/AEARFQA9EhMgciP/ZJ9k/9zh3P/d393/aaNp/0qo 139 | Sv9Kq0r/SqtK/06qTv+fup//kqyS/0OPQ/8vgS//DWQO/wBCExMAQhYRRYlH/9/j3//h4eH/3eLd/9Dg 140 | 0P/T49P/1ebV/83jzf9jq2P/WaJZ/1mdWf9Zmln/WZpZ/0+NT/8ARxcRAEUaD0aHSP/b3Nv/4uLi/9XW 141 | 1f+/wb//wsTC/8TFxP+8wrz/cadx/2mkaf9ppGn/aaRp/2mkaf9Ojk7/AEocDwBHHQ08iT7/hqmG/9na 142 | 2f/c39z/kLmQ/3iteP94rXj/ea15/3mtef95rXn/ea15/3mtef95rXn/UpNS/wBMHw0ARSELRJBG/4i3 143 | iP+Qr5D/2NjY/9LZ0v+It4j/iLeI/4i3iP+It4j/iLeI/4i3iP+It4j/iLeI/1eXV/8ASiMLAEgnCVad 144 | WP+YwJj/mMCY/5Wylf+WsZb/mMCY/5jAmP+YwJj/mMCY/5jAmP+YwJj/mMCY/5jAmP9lomX/AE4qCQVG 145 | KgNwrISxYKdm/1imY/9YqWn/WKxu/1ivcv9YsXX/WLF1/1ivcv9Yq23/WKho/1ikYv9fpWX/bqqCsQdN 146 | LgP///8B////AQFOLAcATysHAFAtBwBRLgcAUi8HAFIwBwBSMAcAUi8HAFEuBwBQLQcATysHAE0rB/// 147 | /wH///8BAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA 148 | //8AAP//AAD//w== 149 | 150 | 151 | 152 | 285, 17 153 | 154 | 155 | 156 | AAABAAEAEBAAAAAAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAA 157 | AAD///8BADcPBQA8EBMAOxAVADsQFQA7EBUAOxAVADsQFQA7EBUAOxAVADsQFQA7EBUAOxAVADwQEwA4 158 | DwX///8BADgPBSNxOb0Wdy//EXgq/xF8Kv8RgCr/EYMq/xGEKf8RhCn/EYIp/xF+Kf8Rein/EXUp/xNy 159 | K/8XaC29ADwQBQA8EBMWcSn/AGsA/wB5AP8AhwD/AJQA/wCfAP8ApgD/AKYA/wCfAP+w1rD/rtOu/wh+ 160 | CP8AawD/FG4j/wBBERMAOxAVEGse/wBvAP8AfgD/AI4A/wCdAP8AqgD/ALUA/wC1AP8AqgD/dbB1/+jo 161 | 6P+y07L/CHQI/xBqHf8AQBEVADsQFQ9pGf8AcAD/AIAA/wCQAP8AoAD/AbAB/1zVXP9s2mz/bNFs/2rC 162 | av/I1Mj/6+vr/7TRtP8YbiL/AEARFQA7EBUNZxX/AG8A/wB/AP8AjgD/AJ0A/yGyIf/4+Pj//f39//39 163 | /f/19fX/6enp/+Pj4//t7e3/UIlW/wBAERUAOxAVC2QR/wBrAP8AegD/Jpkm/zGqMf8AoAD/I5kj/y+a 164 | L/8vli//OZM5/9Dc0P/j4+P/eZt5/w1jEv8AQBEVADsQFQliDf8AZgD/NY41/+Ho4f/O4M7/FZwV/xah 165 | Fv8VoRX/DZkN/7Hbsf/v7+//e597/wFlAf8KYQz/AEARFQA9EhMgciP/ZJ9k/9zh3P/d393/aaNp/0qo 166 | Sv9Kq0r/SqtK/06qTv+fup//kqyS/0OPQ/8vgS//DWQO/wBCExMAQhYRRYlH/9/j3//h4eH/3eLd/9Dg 167 | 0P/T49P/1ebV/83jzf9jq2P/WaJZ/1mdWf9Zmln/WZpZ/0+NT/8ARxcRAEUaD0aHSP/b3Nv/4uLi/9XW 168 | 1f+/wb//wsTC/8TFxP+8wrz/cadx/2mkaf9ppGn/aaRp/2mkaf9Ojk7/AEocDwBHHQ08iT7/hqmG/9na 169 | 2f/c39z/kLmQ/3iteP94rXj/ea15/3mtef95rXn/ea15/3mtef95rXn/UpNS/wBMHw0ARSELRJBG/4i3 170 | iP+Qr5D/2NjY/9LZ0v+It4j/iLeI/4i3iP+It4j/iLeI/4i3iP+It4j/iLeI/1eXV/8ASiMLAEgnCVad 171 | WP+YwJj/mMCY/5Wylf+WsZb/mMCY/5jAmP+YwJj/mMCY/5jAmP+YwJj/mMCY/5jAmP9lomX/AE4qCQVG 172 | KgNwrISxYKdm/1imY/9YqWn/WKxu/1ivcv9YsXX/WLF1/1ivcv9Yq23/WKho/1ikYv9fpWX/bqqCsQdN 173 | LgP///8B////AQFOLAcATysHAFAtBwBRLgcAUi8HAFIwBwBSMAcAUi8HAFEuBwBQLQcATysHAE0rB/// 174 | /wH///8BAAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA 175 | //8AAP//AAD//w== 176 | 177 | 178 | -------------------------------------------------------------------------------- /OPC2Modbus/OPC2Modbus.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {A716887F-4119-4031-9294-296B979F051B} 8 | WinExe 9 | Properties 10 | OPC2Modbus 11 | OPC2Modbus 12 | v4.5 13 | 512 14 | 15 | 16 | AnyCPU 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | AnyCPU 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | False 37 | lib\EasyModbus.dll 38 | 39 | 40 | False 41 | True 42 | lib\Interop.OPCAutomation.dll 43 | 44 | 45 | ..\packages\log4net.2.0.3\lib\net40-full\log4net.dll 46 | True 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | Form 63 | 64 | 65 | FormPrincipal.cs 66 | 67 | 68 | 69 | 70 | FormPrincipal.cs 71 | 72 | 73 | PublicResXFileCodeGenerator 74 | Resources.Designer.cs 75 | Designer 76 | 77 | 78 | True 79 | Resources.resx 80 | True 81 | 82 | 83 | 84 | 85 | 86 | SettingsSingleFileGenerator 87 | Settings.Designer.cs 88 | 89 | 90 | True 91 | Settings.settings 92 | True 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 115 | -------------------------------------------------------------------------------- /OPC2Modbus/OPCItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace OPC2Modbus 4 | { 5 | public class OPCItem 6 | { 7 | public string ItemID { get; set; } 8 | public string Compressor { get; set; } 9 | public string Description { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /OPC2Modbus/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Windows.Forms; 4 | using log4net; 5 | using log4net.Config; 6 | 7 | namespace OPC2Modbus 8 | { 9 | static class Program 10 | { 11 | public static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 12 | 13 | /// 14 | /// Punto de entrada principal para la aplicación. 15 | /// 16 | [STAThread] 17 | static void Main() 18 | { 19 | XmlConfigurator.Configure(); 20 | 21 | Log.Info("Aplicación iniciada"); 22 | Application.EnableVisualStyles(); 23 | Application.SetCompatibleTextRenderingDefault(false); 24 | Application.Run(new Opc2Modbus()); 25 | Log.Info("Aplicación finalizada"); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /OPC2Modbus/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // La información general sobre un ensamblado se controla mediante el siguiente 6 | // conjunto de atributos. Cambie estos atributos para modificar la información 7 | // asociada con un ensamblado. 8 | [assembly: AssemblyTitle("OPC2Modbus")] 9 | [assembly: AssemblyDescription("OPC to Modbus TCP gateway")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Hackor Team")] 12 | [assembly: AssemblyProduct("OPC2Modbus")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("Hackor")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Si establece ComVisible como false, los tipos de este ensamblado no estarán visibles 18 | // para los componentes COM. Si necesita obtener acceso a un tipo de este ensamblado desde 19 | // COM, establezca el atributo ComVisible como true en este tipo. 20 | [assembly: ComVisible(false)] 21 | 22 | // El siguiente GUID sirve como identificador de typelib si este proyecto se expone a COM 23 | [assembly: Guid("24431657-a82f-420e-bbe5-3abc8b25401a")] 24 | 25 | // La información de versión de un ensamblado consta de los cuatro valores siguientes: 26 | // 27 | // Versión principal 28 | // Versión secundaria 29 | // Número de compilación 30 | // Revisión 31 | // 32 | // Puede especificar todos los valores o establecer como predeterminados los números de compilación y de revisión 33 | // mediante el carácter '*', como se muestra a continuación: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /OPC2Modbus/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Este código fue generado por una herramienta. 4 | // Versión de runtime:4.0.30319.34209 5 | // 6 | // Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si 7 | // se vuelve a generar el código. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace OPC2Modbus.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// Clase de recurso fuertemente tipado, para buscar cadenas traducidas, etc. 17 | /// 18 | // StronglyTypedResourceBuilder generó automáticamente esta clase 19 | // a través de una herramienta como ResGen o Visual Studio. 20 | // Para agregar o quitar un miembro, edite el archivo .ResX y, a continuación, vuelva a ejecutar ResGen 21 | // con la opción /str o recompile su proyecto de VS. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | public class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Devuelve la instancia de ResourceManager almacenada en caché utilizada por esta clase. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | public static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OPC2Modbus.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Reemplaza la propiedad CurrentUICulture del subproceso actual para todas las 51 | /// búsquedas de recursos mediante esta clase de recurso fuertemente tipado. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | public static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Busca un recurso adaptado de tipo System.Drawing.Icon similar a (Icono). 65 | /// 66 | public static System.Drawing.Icon OPC2Modbus { 67 | get { 68 | object obj = ResourceManager.GetObject("OPC2Modbus", resourceCulture); 69 | return ((System.Drawing.Icon)(obj)); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /OPC2Modbus/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\img\OPC2Modbus.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | -------------------------------------------------------------------------------- /OPC2Modbus/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.34209 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace OPC2Modbus.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /OPC2Modbus/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OPC2Modbus/docs/RS2LAN Refrigeration Installation Manual 1.4.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackor85/OPC2Modbus/0be4448281b8e397df0a3fd3edd3297aaaac7710/OPC2Modbus/docs/RS2LAN Refrigeration Installation Manual 1.4.pdf -------------------------------------------------------------------------------- /OPC2Modbus/etc/OPC2Modbus.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackor85/OPC2Modbus/0be4448281b8e397df0a3fd3edd3297aaaac7710/OPC2Modbus/etc/OPC2Modbus.csv -------------------------------------------------------------------------------- /OPC2Modbus/img/OPC2Modbus.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackor85/OPC2Modbus/0be4448281b8e397df0a3fd3edd3297aaaac7710/OPC2Modbus/img/OPC2Modbus.ico -------------------------------------------------------------------------------- /OPC2Modbus/lib/EasyModbus.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackor85/OPC2Modbus/0be4448281b8e397df0a3fd3edd3297aaaac7710/OPC2Modbus/lib/EasyModbus.dll -------------------------------------------------------------------------------- /OPC2Modbus/lib/Interop.OPCAutomation.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hackor85/OPC2Modbus/0be4448281b8e397df0a3fd3edd3297aaaac7710/OPC2Modbus/lib/Interop.OPCAutomation.dll -------------------------------------------------------------------------------- /OPC2Modbus/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /OPC2Modbus/scripts/CreateLog4NetTable.sql: -------------------------------------------------------------------------------- 1 | USE [CIMPLICITY] 2 | GO 3 | 4 | /****** Object: Table [dbo].[Logs] Script Date: 7/14/2015 11:07:00 AM ******/ 5 | SET ANSI_NULLS ON 6 | GO 7 | 8 | SET QUOTED_IDENTIFIER ON 9 | GO 10 | 11 | SET ANSI_PADDING ON 12 | GO 13 | 14 | CREATE TABLE [dbo].[Logs]( 15 | [Id] [int] IDENTITY(1,1) NOT NULL, 16 | [Date] [datetime] NOT NULL, 17 | [Thread] [varchar](255) NOT NULL, 18 | [Level] [varchar](50) NOT NULL, 19 | [Logger] [varchar](255) NOT NULL, 20 | [Message] [nvarchar](max) NOT NULL, 21 | [Exception] [nvarchar](max) NULL, 22 | [Source] [varchar](100) NULL, 23 | [HostName] [nvarchar](255) NULL, 24 | CONSTRAINT [PK_Logs] PRIMARY KEY CLUSTERED 25 | ( 26 | [Id] ASC 27 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] 28 | ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] 29 | 30 | GO 31 | 32 | SET ANSI_PADDING OFF 33 | GO 34 | 35 | 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OPC2Modbus 2 | Protocol converter or gateway for OPC to Modbus TCP 3 | 4 | Read to an OPC server, and export to Modbus TCP. 5 | --------------------------------------------------------------------------------