自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(1)
  • 资源 (1)
  • 收藏
  • 关注

原创 关于倍福PLC与Genius蝶阀的通讯研究

1.本例中倍福PLC用CX9020,为了实现与蝶阀的通讯,要用到EL6022通讯模块,该模块有两个通讯口,我们将2口的2、3脚短接,与蝶阀J2口的1脚相连,7、8脚短接,与蝶阀J2口的25脚相连。8000:06和8000:07结合起来用于设置通讯方式,其中8000:06设置为TRUE,8000:07设置为FALSE,则为485通讯。8000:15设置数据格式,本次案例中数据长度是8位,停止位是1位,无校验。需要说明的时,对蝶阀的各种读写操作,是通过PLC的Case语句来实现的。6.从蝶阀读取实际压力值。

2023-10-14 08:41:08 774

很实用的串口通讯实例

Base Class Library for RS232 Communications. -------------------------------------------- Ref: "Serial Comm: Use P/Invoke to Develop a .NET Base Class Library for Serial Device Communications" John Hind, MSDN Magazine, Oct 2002. V1.3 February 2004. LIBRARY CommBase.dll The library redistributable assembly - .NET managed code. Contains namespace JH.CommBase. Requires Unmanaged Code Permission. CommBase.xml Intellisense comments for the library. Copy this to the same directory as CommBase.dll when referencing the library in the development environment. CommBaseSource\CommBase.cs CommBaseSource\CommPingPong.cs CommbaseSource\AssemblyInfo.cs Source code for CommBase.dll assembly. Build in a Visual Studio C# Class Library project. Set the XML Documentation File option in configuration properties to rebuild the Intellisense comments. EXAMPLES LineTerm.vb Source code for LineTerm example. Build in a Visual Studio VB Console Application project. Requires a reference to CommBase.dll. BaseTerm.exe Compiled example. Requires CommBase.dll in same directory to run. BaseTermSource\BaseTerm.cs BaseTermSource\TermForm.cs BaseTermSource\SettingsForm.cs BaseTermSource\InfoForm.cs BaseTermSource\AssemblyInfo.cs Source code for BaseTerm example. Build in a Visual Studio C# Windows Application project. Requires a reference to CommBase.dll. REVISION HISTORY V1.0 - Initial Release, Sept 2002. V1.1 - Minor Revision, December 2002. - Removed dependancy on NT/2000/XP. Should now run on W98, ME etc. - Eliminated use of CancelIO which was causing occasional data loss. - Use static version of Encoding.ASCII in CommLine for efficiency. - Added new CommPingPong class for single byte packetisation. V1.2 - Minor Revision, December 2002. - Fixed bug with received break condition handling. - Interlocked rx thread startup with ManualResetEvent for robustness. - Added defaulting mechanism for handshake thresholds to avoid errors due to fixed defaults conflicting with driver queue size defaults. - Changed default for sendTimeoutMultiplier for not NT-based platform to a high value as W98 etc. do not seem to interpret 0 as infinite. V1.3 - Minor Revision, February 2004. - Automatically try \\.\COMn form of port name if COMn or COMn: fails i.e. when n > 9 on some systems. - Added CommBase.IsCongested to test for buffer growth when sending data with CheckAllSends = false. - Added CommBase.IsPortAvailable to test existance / availability of a named port. - BaseTerm sample settings dialog now enumerates available ports in the port dropdown using the CommBase.IsPortAvailable function. - BaseTerm sample queue status dialog made non-modal and auto-refreshing. - Other minor presentational improvements to BaseTerm sample. - Corrected bugs which caused occasional crashes on port closure. - Corrected bugs which caused unnecessary exceptions when sending data at low baud rates with CheckAllSends = false. - Fixed bug in setting RTS state. - Deleted virtual function CommBase.OnRing which was never getting called: use CommBase.OnStatusChange instead. - Fixed bug preventing setting of fAbortOnError in DCB. - Corrected the BaseTerm sample to use proper marshalling for multi-threaded Windows Forms. - Corrected STH -> STX in ASCII enumeration.

2010-05-07

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除