vb监制画面求助 点击:429 | 回复:4



正弦波1688

    
  • 精华:0帖
  • 求助:6帖
  • 帖子:7帖 | 256回
  • 年度积分:0
  • 历史总积分:2291
  • 注册:2014年5月11日
发表于:2015-05-30 22:42:27
楼主

那位高高手能给我发一个VB监控电机启停和故障报警状态的监控画面,画面还可以远程启停西门子200PLC,要用到MSCOMM的VB程序,万分感谢!




工控小诚

  • 精华:16帖
  • 求助:64帖
  • 帖子:679帖 | 7271回
  • 年度积分:3
  • 历史总积分:32156
  • 注册:2012年9月27日
发表于:2015-05-31 15:14:24
1楼

这个用组态软件很方便就做一个,用VB的话还要装VB软件呢

好久没用VB了。

王者之师-小刀刀

  • 精华:1帖
  • 求助:0帖
  • 帖子:2帖 | 337回
  • 年度积分:0
  • 历史总积分:157
  • 注册:2013年3月01日
发表于:2015-05-31 20:07:58
2楼

他应该是自己搞搞好玩吧,跟西门子通信,用Prodave.dll最方便。

FLARE刀客

  • 精华:0帖
  • 求助:1帖
  • 帖子:7帖 | 74回
  • 年度积分:0
  • 历史总积分:1045
  • 注册:2014年7月24日
发表于:2015-06-01 08:27:01
3楼

用vb写通信其实很简单的,下点资料,自学一个月就会了

Robin28

  • 精华:1帖
  • 求助:0帖
  • 帖子:8帖 | 425回
  • 年度积分:0
  • 历史总积分:874
  • 注册:2005年7月17日
发表于:2015-06-02 15:04:50
4楼

recently to do a project, the use ofS7-200, but not a great amount of data exchange, andWINCCfeel compared to waste, so wanted to be their own monitoring software, on the thought of usingVBprogramming to callw95_s7.dlldynamic-link database. through3-day efforts, and finally the results of small, what is my basic method of test. For your reference!

1.Prodave forpc withs7 series ofplc data link communications between the toolbox. The essence is that the user by calling the "w95_s7.dll"such as library function to solve the PLC withPCbetween the data exchange and data-processing problem. by hardware required for:CPU22x, PC / PPIprogramming cable, withCOMpopulationPC. This is probably the simplest configuration, it is easy to achieve the purpose of the pilot. Here do not need to installProdavesoftware, as long as the"w95_s7.dll"paper copy to your program to the directory can be.2. communication settings: Open "Control Panel" in "SettingsPG / PCinterface" option in the "access point applications "list box, select"S7ONLINE (STEP7) PC / PPI Cable",in its attributes of "overtime" to set up big points, here set to100ms, "baud rate" is set to9.6kbps (because mypc / ppicables made in China, does not support multi-master), "address" for the0.3. Source Code: PLCprocedures:LD I0.0 MOVW 4766, VW0 VBprocedures:

****a statement in the module****:

Public plcadr As plcadrtype

Public gb_PlcConnected As Boolean

Type plcadrtype

adr As Byte 'station address, the default value for2

SEGMENTID As Byte 'paragraph identifier, fixed value of0

SLOTNO As Byte 'slot number, the default value of2

RACKNO As Byte 'rack number,0

End Type

Public Res As Long

Declare Function load_tool Lib "w95_s7.dll" (ByVal nr As Byte, ByVal dev As String, adr As plcadrtype) As Long

....... fixed 'omitted other defined functions.

Declare Function as200_vs_field_read Lib "w95_s7.dll" (ByVal nr As Long, ByVal anz As Long, value As Byte) As Long 'Reading200PLC Vstore data function

****a statement in the form****

Private Sub Form_Load ()

Dim buffer ( 1) As Byte

plcadr.adr = 2

plcadr.SEGMENTID = 0

plcadr.SLOTNO = 2

plcadr.RACKNO = 0

Res = load_tool (1, "S7ONLINE", plcadr)

Res = as200_vs_field_read (0, 2, buffer (0))

If Res <> 0 Then

MsgBox (" PLCconnection error")

gb_PlcConnected = False

Else

gb_PlcConnected = True

MsgBox ( "plcconnected correctly")

Label1.Caption = buffer (0) * 256 buffer (1)

End If

End Sub

through the above-mentioned procedure can be correctly read out thePLCdata. can be extended after the content, the preparation of a monitoring software.


热门招聘
相关主题

官方公众号

智造工程师