使用C#和INGEAR PLC通信在SQL Server数据库中填充行 [英] Populating rows in SQL server database using C# and INGEAR PLC communication

查看:96
本文介绍了使用C#和INGEAR PLC通信在SQL Server数据库中填充行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道从哪个项目开始。我不认为Windows窗体应用程序是正确的答案。我希望连续运行一个C#程序来传输PLC标签数据并以30秒的间隔在SQL数据库中填充行。



我搜索了其他任何情况有人做了同样的事情并且没有得到任何东西。我对此很陌生。



Visual Studio C#中是否有一个模板只有运行而不是使用Windows图形的编码等等?



谢谢,

Kurt

I am wondering where to start with this project. I do not think a windows forms application is the right answer. I am looking to run a C# program continuously to transfer PLC tag data and populate rows in a SQL database on a 30 second interval.

I have searched for any other situation where someone has done the same thing and have came up with nothing. I am pretty new to this.

Is there a template in visual studio C# that just has coding that would run instead of using windows graphics and so on?

Thanks,
Kurt

推荐答案

是的 - 还有一对。

有一个控制台 - 它基本上是一个命令行界面,可以坐在那里,或者(从你的角度来看可能更好)一个完全没有用户界面的服务。



服务在后台运行(并且不需要用户登录即可运行)并且可以暂停30秒,更新数据库,再次暂停,以及等等。



这应该有所帮助: MSDN:演练:在组件设计器中创建Windows服务应用程序 [ ^ ]
Yes - there are a couple.
There's a Console - which is basically a Command line interface and can just sit there, or (probably better from your point of view) a Service which has no user interface at all.

A service runs in the background (and doesn't require a user to be logged in to run at all) and can just suspend itself for 30 seconds, update the DB, suspend itself again, and so on.

This should help: MSDN: "Walkthrough: Creating a Windows Service Application in the Component Designer"[^]


非常感谢,



这肯定会让我开始正确的方向。随着这个项目的发展,我可能会问更多问题。



谢谢,

Kurt
Thank you very much,

That will definitely get me started in the right direction. I might be asking a lot more questions as this project evolves.

Thanks,
Kurt


这篇关于使用C#和INGEAR PLC通信在SQL Server数据库中填充行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆