Trio控制器与Proface触摸屏的通信 点击:616 | 回复:1



xerseshall

    
  • 精华:0帖
  • 求助:2帖
  • 帖子:2帖 | 2回
  • 年度积分:0
  • 历史总积分:10
  • 注册:2014年7月20日
发表于:2014-09-19 16:16:39
楼主

控制器选用的是Trio Euro404/408  型控制器,触摸屏型号是Proface GC-4501W。

目前仅仅是希望在触摸屏上编写一个简单的界面,通过选择speed,accel 等参数与trio控制器通讯后实现控制电机的目的。

看资料说要设置好VR变量,但是这一点,我实在不明白。往各位老师和高手们指点一二。

谢谢大家了




示教功能

  • 精华:0帖
  • 求助:0帖
  • 帖子:8帖 | 412回
  • 年度积分:0
  • 历史总积分:876
  • 注册:2004年2月03日
发表于:2016-03-25 18:22:57
1楼

例如你可以利用OMRON的HOSTLINK 协议。例程如下:

'COMMUNICATION SETTING
'Hostlink master protocol in PORT 1 (RS232)

SETCOM(9600,7,2,2,1,5)
'WA(100)

'Variables to Read and write
VR(0)=1
VR(1)=200
VR(2)=300

loop:

    'Write to the PLC VR(0), VR(1) and VR(2) to
    'DM1000, DM1001 and DM1002
    HLM_WRITE(1,0,PLC_DM,1000,3,MC_VR,0)
   WA (1000)

    'Write in terminal screen (channel 5) the written information
    PRINT #5,"Write Status (0=OK) : ";HLM_STATUS PORT(1)
    PRINT #5,"WR DM1000 from VR(0)=";VR(0)
    'PRINT #5,"WR DM1001 from VR(1)=";VR(1)
    'PRINT #5,"WR DM1002 from VR(2)=";VR(2)

    'Read from the PLC the same DM that we wrote, plus DM1003
    'and put the information to VR(5) to VR(8)
    HLM_READ(1,0,PLC_DM,1000,1,MC_VR,5)
    WA (1000)

    'Print the status of the communication and the read registers
    PRINT #5,"Read Status (0=OK) : ";HLM_STATUS PORT(1)
    PRINT #5,"DM1000 to VR(5)=";VR(5)
    'PRINT #5,"DM1001 to VR(6)=";VR(6)
    'PRINT #5,"DM1002 to VR(7)=";VR(7)
    'PRINT #5,"DM1003 to VR(8)=";VR(8)

    'Change VR(2) to check that the system is "alive"
    VR(0)=VR(0)+1

GOTO loop


这些变量 VR,都可以定义成SPEED或ACCEL等参数写入控制器,或从控制器读出。


热门招聘
相关主题

官方公众号

智造工程师