威纶通官方论坛

以前正常执行,没做任何修改,现在下载到屏中无法执行

[复制链接]
发表于 2016-5-3 18:38:34 | 显示全部楼层 |阅读模式
short C=0
unsigned short SJS[2],MIMA[7]={0,0,0,0X11,0X26},A[4],B[4],Bb,d=0
unsigned int NY[2],JiXing,cJiXing,plc=0

sub lw10000()
//*****确定优先plc*******
for c=0 to 5 step 1
  if JiXing_bit[c] then
  SetData(C, "Local HMI", LW, 10000, 1)
  end if
  DELAY(1)
next
return
end sub

sub a50015(bool o1,bool o2 )
//*****控制plc*******
for C = 0 to 31 step 1
    //while CH[0]==0
    if JiXing_bit[c]then
    SetData(C, "Local HMI", LW, 10000, 1)
    SetDataEx(o1, "OMRON CJ/CS/CP", W_Bit, var0#015, 1)
    DELAY(0)
    SetDataEx(o2, "OMRON CJ/CS/CP", A_Bit, var0#50015, 1)
    DELAY(0)
    SetDataEx(ON, "OMRON CJ/CS/CP", CIO_Bit, var0#10215, 1)
    DELAY(0)
    //GetData(CH[1], "OMRON CJ/CS/CP", W_Bit, 0#015, 1)
    //GetData(CH[2], "OMRON CJ/CS/CP", A_Bit, 0#50015, 1)
    //GetData(CH[3],"OMRON CJ/CS/CP", CIO_Bit, 0#10215, 1)
    //CH[4]=1-CH[2]
    //CH[0]= CH[1] & ~CH[3] & CH[3](~按位取反运算符)
    //wend
    end if
    next
   
    SetDataEx(o1, "OMRON CJ/CS/CP (Ethernet - FINS/TCP)焊锡", W_Bit, 015, 1)
    SetDataEx(o2, "OMRON CJ/CS/CP (Ethernet - FINS/TCP)焊锡", A_Bit, 50015, 1)
    SetDataEx(ON, "OMRON CJ/CS/CP (Ethernet - FINS/TCP)焊锡", CIO_Bit, 10215,

1)
    SetDataEx(o1, "OMRON CJ/CS/CP (Ethernet - FINS/TCP)焊锡", W_Bit, 015, 1)
    SetDataEx(o2, "OMRON CJ/CS/CP (Ethernet - FINS/TCP)焊锡", A_Bit, 50015, 1)
    SetDataEx(ON, "OMRON CJ/CS/CP (Ethernet - FINS/TCP)焊锡", CIO_Bit, 10215,

1)
   
    SetDataEx(o1, "OMRON CJ/CS/CP (Ethernet - FINS/TCP)插针", W_Bit, 015, 1)
    SetDataEx(o2, "OMRON CJ/CS/CP (Ethernet - FINS/TCP)插针", A_Bit, 50015, 1)
    SetDataEx(ON, "OMRON CJ/CS/CP (Ethernet - FINS/TCP)插针", CIO_Bit, 10215,

1)
    SetDataEx(o1, "OMRON CJ/CS/CP (Ethernet - FINS/TCP)插针", W_Bit, 015, 1)
    SetDataEx(o2, "OMRON CJ/CS/CP (Ethernet - FINS/TCP)插针", A_Bit, 50015, 1)
    SetDataEx(ON, "OMRON CJ/CS/CP (Ethernet - FINS/TCP)插针", CIO_Bit, 10215,

1)
    return
end sub

sub rq()
SetData(B[Bb], "Local HMI", RW, 19+Bb, 1)//
SetData(ON, "Local HMI", LB, 9029, 1)//配方数据强制保存
end sub



macro_command main()
SYNC_TRIG_MACRO(4)//跳到触摸屏弹出plc未连接等

GetDataEx(LB7, "OMRON CJ/CS/CP (Ethernet - FINS/TCP)焊锡", CIO_Bit, 0, 1)


//****开机控制plc****
if(LB7==0)then      //锁住
  RAND(SJS[0])//随机数据
  RAND(SJS[1])//随机数据
  SetData(SJS[0], "Local HMI", LW, 60, 2)
  SetData(MIMA[3], "Local HMI", LW, 62, 2)
  SetData(ON, "Local HMI", LB, 7, 1)
  SetData(ON, "Local HMI", LB, 8, 1)
  a50015(Off,ON)

else if(LB7==1)then     //没锁
    SetData(ON, "Local HMI", LB, 6, 1)
    a50015(ON,OFF)
    SetData(OFF, "Local HMI", LB, 8, 1)
    SetData(ON, "Local HMI", LB, 29, 1)
    SetData(OFF, "Local HMI", LB, 7, 1)
   end if
//end if
//*********

lw10000()
//******plc没有选择******
//GetData(JIXING, "Local HMI", "机型字", 1)
if JiXing==0 then
SetData(ON, "Local HMI", LB, 5, 1)
JiXing=1//
SetData(JiXing, "Local HMI", "机型字", 1)//
end if
//*********
SetData(ON, "Local HMI", LB, 4, 1)
end macro_command
发表于 2016-7-14 10:21:29 | 显示全部楼层
检查屏的型号跟工程是否对应,重新下载屏的“韧体”重试
您需要登录后才可以发帖 登录 | 注册

本版积分规则

回复帖子

Archiver|小黑屋|威纶通官网 ( 粤ICP备06054553号 )

GMT+8, 2024-12-4 17:05

Powered by Discuz! X3.4

© 2001-2023 Comsenz Inc.

快速回复 返回顶部 返回列表