宏代码如下。
macro_command main()
short nMin,nMax,nResult
GetData(nMin, "Local HMI", LW, 0, 1)
GetData(nMax, "Local HMI", LW, 1, 1)
//
short nRand=0
RAND(nRand)
nResult = nRand%(nMax-nMin)+nMin
SetData(nResult, "Local HMI", LW, 2, 1)
end macro_command
在我个人博客也有相关回答
https://www.gkbc8.com/thread-15786-1-1.html |