| 作者 | 主题 |
|---|---|
|
XYZNJ 侠客 经验值:980 发帖数:83 精华帖:0 |
楼主
主题:WinCC 7.4-8.1中用VBS读取一个无符号32位整数中的某一位会失效(超过16位时) |
|
thomas_top 奇侠 经验值:5915 发帖数:1739 精华帖:3 |
5楼
主题:回复:WinCC 7.4-8.1中用VBS读取一个无符号32位整数中的某一位会失效(超过16位时)'位左移 Function SHL(nSource , n ) SHL = nSource * 2 ^ n End Function '位右移 Function SHR(nSource , n ) SHR = nSource / 2 ^ n End Function '获得指定的位 Function GetBits(nSource , n ) GetBits = nSource And 2 ^ n End Function '设置指定的位 Function SetBits(nSource , n ) SetBits = nSource Or 2 ^ n End Function
'清除指定的位 Function ResetBits(nSource , n ) ResetBits = nSource And Not 2 ^ n End Function |