谁能跟我说一下力控组态软件的脚本编辑用什么语言编写

谁能跟我说一下力控组态软件的脚本编辑用什么语言编写,第1张

这个脚本是类VC的,其实没什么要求。。。。学过VB的就会了 很简单的,你可以打开demo工程里,看看那里面怎么写的。另外脚本可以写到应用程序中,也可以写到窗口脚本,还可以写到按钮左键动作里等等,区别是执行的条件不一样而已。

举例:

IF IsWeb() == 1 THEN

ELSE

IF COD_start_meas.PV == 0 THEN

sys_time = StrTime($Curtime,1)

COD_run_log = "待机[Ready]"

SQLInsert(ConnectID,"dlhb_sys_log","sys_info")

COD_run_log = ""

ENDIF

IF COD_start_meas.PV == 1 THEN

sys_time = StrTime($Curtime,1)

COD_run_log = "粗虚运就绪[Ground]"

SQLInsert(ConnectID,"dlhb_sys_log","sys_info")

COD_run_log = ""

ENDIF

IF COD_start_meas.PV == 2 THEN

sys_time = StrTime($Curtime,1)

COD_run_log = "清洗[Clean]"

SQLInsert(ConnectID,"dlhb_sys_log","sys_info")

COD_run_log = ""

ENDIF

IF COD_start_meas.PV == 4 THEN

sys_time = StrTime($Curtime,1)

COD_run_log = "校正[Calib.]"

SQLInsert(ConnectID,"dlhb_sys_log","sys_info")

COD_run_log = "誉颤"

IF COD_meas_flag.PV == 1THEN

COD_meas_flag.PV = 0

sys_meas_flag.PV = 0

COD_cal_flag.PV =1

sys_run_log = "COD启动测量后进入校正状态,触发开启..."

SQLInsert(ConnectID,"dlhb_sys_log","sys_info")

sys_run_log = ""

#sys_active_T.Start()//开启触发定时器

ENDIF

ENDIF

IF COD_start_meas.PV == 8 THEN

sys_time = StrTime($Curtime,1)

COD_run_log = "启动岩梁[Start]"

SQLInsert(ConnectID,"dlhb_sys_log","sys_info")

COD_run_log = ""

ENDIF

IF COD_start_meas.PV == 32 THEN

sys_time = StrTime($Curtime,1)

COD_run_log = "测量[meas.]"

SQLInsert(ConnectID,"dlhb_sys_log","sys_info")

COD_run_log = ""

sys_meas_time.DESC = StrTime($Curtime,1)//系统启动测量时间

sys_run_log = "测量时间缓存..."

SQLInsert(ConnectID,"dlhb_sys_log","sys_info")

sys_run_log = ""

ENDIF

IF COD_start_meas.PV == 64 &&COD_meas_flag.PV == 1 THEN

sys_time = StrTime($Curtime,1)

COD_run_log = "排空[Empty]"

SQLInsert(ConnectID,"dlhb_sys_log","sys_info")

COD_run_log = ""

sys_run_log = "COD测量结束, " + IntToStr(PLC_start_sampl.PV,10) + "号取样口数据打包存入报表..."

SQLInsert(ConnectID,"dlhb_sys_log","sys_info")

sys_run_log = ""

IF PLC_start_sampl.PV ==1 THEN

COD1_db.PV = COD_VALUE.PV

sys_meas_time1.DESC = sys_meas_time.DESC

IF ( point2_flag.PV || point3_flag.PV || point4_flag.PV ) == 0 THEN

sys_run_log = "系统循环测量周期定时器开启..."

SQLInsert(ConnectID,"dlhb_sys_log","sys_info")

sys_run_log = ""

#sys_interval_T.Start()//系统循环测量周期定时器开启

ELSE

sys_run_log = "CODmax测量间隔定时器开启..."

SQLInsert(ConnectID,"dlhb_sys_log","sys_info")

sys_run_log = ""

#point_interval_T.Start()//CODmax测量间隔定时器开启

ENDIF

//ELSE

//COD1_db.PV = 0

ENDIF

IF PLC_start_sampl.PV ==2 THEN

COD2_db.PV = COD_VALUE.PV

sys_meas_time2.DESC = sys_meas_time.DESC

IF ( point3_flag.PV || point4_flag.PV ) == 0 THEN

sys_run_log = "系统循环测量周期定时器开启..."

SQLInsert(ConnectID,"dlhb_sys_log","sys_info")

sys_run_log = ""

#sys_interval_T.Start()//系统循环测量周期定时器开启

ELSE

sys_run_log = "CODmax测量间隔定时器开启..."

SQLInsert(ConnectID,"dlhb_sys_log","sys_info")

sys_run_log = ""

#point_interval_T.Start()//CODmax测量间隔定时器开启

ENDIF

//ELSE

//COD2_db.PV = 0

ENDIF

IF PLC_start_sampl.PV ==3 THEN

COD3_db.PV = COD_VALUE.PV

sys_meas_time3.DESC = sys_meas_time.DESC

IF point4_flag.PV == 0 THEN

sys_run_log = "系统循环测量周期定时器开启..."

SQLInsert(ConnectID,"dlhb_sys_log","sys_info")

sys_run_log = ""

#sys_interval_T.Start()//系统循环测量周期定时器开启

ELSE

sys_run_log = "CODmax测量间隔定时器开启..."

SQLInsert(ConnectID,"dlhb_sys_log","sys_info")

sys_run_log = ""

#point_interval_T.Start()//CODmax测量间隔定时器开启

ENDIF

//ELSE

//COD3_db.PV = 0

ENDIF

IF PLC_start_sampl.PV ==4 THEN

COD4_db.PV = COD_VALUE.PV

sys_meas_time4.DESC = sys_meas_time.DESC

sys_run_log = "系统循环测量周期定时器开启..."

SQLInsert(ConnectID,"dlhb_sys_log","sys_info")

sys_run_log = ""

#sys_interval_T.Start()//系统循环测量周期定时器开启

//ELSE

//COD4_db.PV = 0

ENDIF

IF sys_meas_flag.PV == 1 THEN

sys_meas_log.DESC = IntToStr(PLC_start_sampl.PV,10) + "号取样口自动测量"

ENDIF

IF sys_meas_flag.PV == 2 THEN

sys_meas_log.DESC = IntToStr(PLC_start_sampl.PV,10) + "号取样口手动测量"

ENDIF

SQLInsert(ConnectID,"dlhb_meas_group","meas_group")

sys_meas_log.DESC = ""

COD_meas_flag.PV = 0

sys_meas_flag.PV = 0

ENDIF

ENDIF

力控里的仔配虚脚本程序念燃是 类vc的脚本,例如 if endif ; for。。。;swich/.、。。等脚本!

PLC里的不卖迅是脚本,只是梯形图!!!

两个完全不是一回事!

你说的应该是上位机可以通过脚本代替PLC完成监控设备的功能,但是一般都不这样做,因为不够稳定,一旦上位机死机或者崩溃有可能导致设备故障。。。。


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12508571.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-26
下一篇 2023-05-26

发表评论

登录后才能评论

评论列表(0条)

保存