日本JAPANESE熟睡人妻_久久99热只有频精品6狠狠_欧美一区内射最近更新_美女露100‰奶头18禁_日韩性生活一级片_国产三级无码内射在线看

羅的密歐
級(jí)別: 論壇先鋒
精華主題: 0
發(fā)帖數(shù)量: 146 個(gè)
工控威望: 1228 點(diǎn)
下載積分: 9226 分
在線時(shí)間: 116(小時(shí))
注冊(cè)時(shí)間: 2022-07-22
最后登錄: 2025-06-25
查看羅的密歐的 主題 / 回貼
樓主  發(fā)表于: 2024-05-21 09:03
有沒(méi)有大佬幫忙的,之前同事弄了iee754,32位單精度16進(jìn)制轉(zhuǎn)換十進(jìn)制浮點(diǎn),但是離職了。下面分享一下他編寫(xiě)的,給大佬們看看
if check == 9 and response[0]==0x02  and response[2]==0x04 then
ma=response[5]
mb=response[6]
ma=ma<<8
ma=ma+mb
output=ma


mc=response[3]
mc=mc>>4
mc=mc+1
if mc-8>0 then
mc=mc-8
bin[16]=1
end if
if mc-4>0 then
mc=mc-4
bin[17]=1
end if
if mc-2>0 then
mc=mc-2
bin[18]=1
end if
if mc-1>0 then
mc=mc-1
bin[19]=1
end if


//IEEE754
output=output+1
if output-32768>0 then
output=output-32768
bin[0]=1
end if
if output-16384>0 then
output=output-16384
bin[1]=1
end if
if output-8192>0 then
output=output-8192
bin[2]=1
end if
if output-4096>0 then
output=output-4096
bin[3]=1
end if
if output-2048>0 then
output=output-2048
bin[4]=1
end if
if output-1024>0 then
output=output-1024
bin[5]=1
end if
if output-512>0 then
output=output-512
bin[6]=1
end if
if output-256>0 then
output=output-256
bin[7]=1
end if
if output-128>0 then
output=output-128
bin[8]=1
end if
if output-64>0 then
output=output-64
bin[9]=1
end if
if output-32>0 then
output=output-32
bin[10]=1
end if
if output-16>0 then
output=output-16
bin[11]=1
end if
if output-8>0 then
output=output-8
bin[12]=1
end if
if output-4>0 then
output=output-4
bin[13]=1
end if
if output-2>0 then
output=output-2
bin[14]=1
end if
if output-1>0 then
output=output-1
bin[15]=1
end if

ieee=bin[1]*128+bin[2]*64+bin[3]*32+bin[4]*16+bin[5]*8+bin[6]*4+bin[7]*2+bin[8]
ieee=ieee-127

select case ieee
case 0
ieee2=1
break
case 1
ieee2=2+bin[9]
break
case 2
ieee2=4+bin[9]*2+bin[10]
break
case 3
ieee2=8+bin[9]*4+bin[10]*2+bin[11]
break
case 4
ieee2=16+bin[9]*8+bin[10]*4+bin[11]*2+bin[12]
break
case 5
ieee2=32+bin[9]*16+bin[10]*8+bin[11]*4+bin[12]*2+bin[13]
break
case 6
ieee2=64+bin[9]*32+bin[10]*16+bin[11]*8+bin[12]*4+bin[13]*2+bin[14]
break
case 7
ieee2=128+bin[9]*64+bin[10]*32+bin[11]*16+bin[12]*8+bin[13]*4+bin[14]*2+bin[15]
break
case 8
ieee2=256+bin[9]*128+bin[10]*64+bin[11]*32+bin[12]*16+bin[13]*8+bin[14]*4+bin[15]*2+bin[16]
break
case 9
ieee2=512+bin[9]*256+bin[10]*128+bin[11]*64+bin[12]*32+bin[13]*16+bin[14]*8+bin[15]*4+bin[16]*2+bin[17]
break
case 10
ieee2=1024+bin[9]*512+bin[10]*256+bin[11]*128+bin[12]*64+bin[13]*32+bin[14]*16+bin[15]*8+bin[16]*4+bin[17]*2+bin[18]
break
case 11
ieee2=2048+bin[9]*1024+bin[10]*512+bin[11]*256+bin[12]*128+bin[13]*64+bin[14]*32+bin[15]*16+bin[16]*8+bin[17]*4+bin[18]*2+bin[19]
break
end select
//ieee754


if bin[0]==0 then//負(fù)數(shù)時(shí)不輸出
//SetData(output, "Local HMI", LW, 50, 1)
//SetData(ma, "Local HMI", LW, 100, 1)
//SetData(ieee2, "Local HMI", LW, 50, 1)
//SetData(ieee2, "Local HMI", LW, 100, 1)
ma=ieee2
end if

end if
天下風(fēng)云出我輩,一入江湖歲月催,皇圖霸業(yè)談笑中,不勝人生一場(chǎng)醉。

提劍跨騎揮鬼雨,白骨如山鳥(niǎo)驚飛。塵事如潮人如水,只嘆江湖幾人回。
ren1823
級(jí)別: 工控俠客
精華主題: 0
發(fā)帖數(shù)量: 353 個(gè)
工控威望: 3026 點(diǎn)
下載積分: 2183 分
在線時(shí)間: 488(小時(shí))
注冊(cè)時(shí)間: 2019-08-01
最后登錄: 2025-06-25
查看ren1823的 主題 / 回貼
1樓  發(fā)表于: 2024-05-21 09:23
浮點(diǎn)數(shù)、10進(jìn)制、16進(jìn)制數(shù)底層都是相同的二進(jìn)制數(shù),只是顯示方式不同而已。上面的程序就是把數(shù)的二進(jìn)制格式的位一個(gè)個(gè)拆出來(lái)然后再按照二進(jìn)制的位組合成10進(jìn)制數(shù)
羅的密歐
級(jí)別: 論壇先鋒
精華主題: 0
發(fā)帖數(shù)量: 146 個(gè)
工控威望: 1228 點(diǎn)
下載積分: 9226 分
在線時(shí)間: 116(小時(shí))
注冊(cè)時(shí)間: 2022-07-22
最后登錄: 2025-06-25
查看羅的密歐的 主題 / 回貼
2樓  發(fā)表于: 2024-05-21 11:13
是的,但是我不是正經(jīng)學(xué)編程的,對(duì)這個(gè)轉(zhuǎn)換不太理解。十進(jìn)制轉(zhuǎn)十六進(jìn)制這種簡(jiǎn)單的就可以
引用
引用第1樓ren1823于2024-05-21 09:23發(fā)表的  :
浮點(diǎn)數(shù)、10進(jìn)制、16進(jìn)制數(shù)底層都是相同的二進(jìn)制數(shù),只是顯示方式不同而已。上面的程序就是把數(shù)的二進(jìn)制格式的位一個(gè)個(gè)拆出來(lái)然后再按照二進(jìn)制的位組合成10進(jìn)制數(shù)
天下風(fēng)云出我輩,一入江湖歲月催,皇圖霸業(yè)談笑中,不勝人生一場(chǎng)醉。

提劍跨騎揮鬼雨,白骨如山鳥(niǎo)驚飛。塵事如潮人如水,只嘆江湖幾人回。
羅的密歐
級(jí)別: 論壇先鋒
精華主題: 0
發(fā)帖數(shù)量: 146 個(gè)
工控威望: 1228 點(diǎn)
下載積分: 9226 分
在線時(shí)間: 116(小時(shí))
注冊(cè)時(shí)間: 2022-07-22
最后登錄: 2025-06-25
查看羅的密歐的 主題 / 回貼
3樓  發(fā)表于: 2024-05-21 16:02
額,解決辦法現(xiàn)在不打算研究這個(gè)困難的辦法,我就弄成輸入16進(jìn)制。數(shù)據(jù)轉(zhuǎn)換的讓人找手機(jī)網(wǎng)頁(yè)轉(zhuǎn)換
天下風(fēng)云出我輩,一入江湖歲月催,皇圖霸業(yè)談笑中,不勝人生一場(chǎng)醉。

提劍跨騎揮鬼雨,白骨如山鳥(niǎo)驚飛。塵事如潮人如水,只嘆江湖幾人回。

主站蜘蛛池模板: 久久人妻AV中文字幕 | 色窝窝无码一区二区三区 | 亚洲国产免费av | 亚洲精品一区中文字幕乱码 | 性久久久久久久久 | 最近高清日本免费 | A级国产乱理伦片 | 永久黄网站免费视频性色 | 69精品久久久久9999不卡片 | 狼友AV永久网站在线观看 | 国产精品美脚玉足脚交欧美 | 欧美成人免费一级 | 中文字幕第二色 | 色视频在线观看网站 | 午夜色大片在线观看 | 奇米影视首页 | 国产美女视频一区 | 成人影片麻豆国产影片免费观看 | av资源在线看| 国产精品一级毛片不收费 | 欧美国产国产综合视频 | 一级特黄免费 | 免费妈妈的朋友 | 天堂8中文在线最新版在线 4438成人大色 | 亚洲日韩精品无码专区 | 丰满熟妇激情喷水 | 操北条麻妃 | 99国产揄拍国产精品人妻 | 国产成人亚洲精品青草天美 | 欧美高大丰满freesex | 青草草97超级碰碰碰 | 黄色片在线播放 | 国产精品麻豆 | 夏目友人帐第七季免费观看 | 国产69精品久久99不卡免费版 | 亚洲第一无码av无码专区 | 日本精品在线视频 | 综合精品影视国产 | 男人免费天堂 | 欧美亚洲精品中文字幕乱码 | 国产乱人偷精品视频免费 |