我目前在用維倫mt6070hi的想實(shí)現(xiàn)如下功能數(shù)據(jù)自動更新功能, 但計(jì)數(shù)器超過數(shù)值時(shí)自動將菜單更新。
指令如下:
macro_command main( )
short CurrentOrder
short CurrentLength
short CurrentNumber
short AwaitOrder
short AwaitLength
short AwaitNumber
short feipin
short ActualCut
short SetCut
short n=0
short x=9
bool L
int m
GetData(feipin, "Danfoss FC Series", Parameter, 1912, 1)
GetData(SetCut, "Danfoss FC Series", Parameter, 1901, 1)
GetData(ActualCut, "Danfoss FC Series", Parameter, 1905, 1)
GetData(AwaitOrder ,"Local HMI", LW ,8002,1)
GetData(AwaitLength ,"Local HMI", LW ,8000,1)
GetData(AwaitNumber ,"Local HMI", LW ,8001,1)
if ActualCut>=SetCut+ feipin then
CurrentOrder=AwaitOrder
CurrentLength=AwaitLength
CurrentNumber=AwaitNumber
SetData(CurrentOrder, "Danfoss FC Series", Parameter, 1910, 1)
SetData(CurrentLength, "Danfoss FC Series", Parameter, 1900, 1)
SetData(CurrentNumber, "Danfoss FC Series", Parameter, 1901, 1)
end if
end macro_command
但此時(shí)發(fā)現(xiàn)只有在滿足ActualCut>=SetCut+ feipin 時(shí),在使用while........wend 時(shí)發(fā)現(xiàn)不能自動更新數(shù)據(jù), 手動可以觸發(fā)數(shù)據(jù)更新, 但后面有對應(yīng)數(shù)據(jù)輸入,在不滿足ActualCut>=SetCut+ feipin 的條件下自動更新數(shù)據(jù)
跪求各位大俠指點(diǎn)。