sunnykmc
SunnyKMC
級別: 工控俠客
精華主題: 0
發(fā)帖數(shù)量: 287 個(gè)
工控威望: 3745 點(diǎn)
下載積分: 28918 分
在線時(shí)間: 413(小時(shí))
注冊時(shí)間: 2014-04-20
最后登錄: 2024-08-27
查看sunnykmc的 主題 / 回貼
樓主  發(fā)表于: 2019-01-16 15:11
歐姆龍的MLPX在三菱FX2N / 3U / 3G有何指令可數(shù)值轉(zhuǎn)對應(yīng)2進(jìn)位元轉(zhuǎn)移給D寄存器值

歐姆龍PLC CH1E CH1H,指令 MLPX  D0  #1000  D2

D0=0 <=> D2=1
D0=1 <=> D2=2
D0=2 <=> D2=4
D0=3 <=> D2=8
D0=4 <=> D2=16
D0=5 <=> D2=32
D0=6 <=> D2=64
D0=7 <=> D2=128
D0=8 <=> D2=256
D0=9 <=> D2=512
D0=10 <=> D2=1024
:
D0=31 <=> D2=0 ; D3= -32768
:
D0=64 <=> D2~D5=0 ;  D6=1
:
D0=128 <=> D2~D9=0 ;  D10=1
:
D0=255 <=> D2~D16=0 ; D17=  -32768



D0=  0_ 0000 0000 0000 0000 <=>D2=    1_ 0000 0000 0000 0001
D0=  1_ 0000 0000 0000 0001 <=>D2=    2_ 0000 0000 0000 0010
D0=  2_ 0000 0000 0000 0010 <=>D2=    4_ 0000 0000 0000 0100
D0=  3_ 0000 0000 0000 0011 <=>D2 =   8_ 0000 0000 0000 1000
D0=  4_ 0000 0000 0000 0100 <=>D2=  16_ 0000 0000 0001 0000
D0=  5_ 0000 0000 0000 0101 <=>D2=  32_ 0000 0000 0010 0000
D0=  6_ 0000 0000 0000 0110 <=>D2=  64_ 0000 0000 0100 0000
D0=  7_ 0000 0000 0000 0111 <=>D2= 128_ 0000 0000 1000 0000
D0=  8_ 0000 0000 0000 1000 <=>D2= 256_ 0000 0001 0000 0000
D0=  9_ 0000 0000 0000 1001 <=>D2= 512_ 0000 0010 0000 0000
D0=10_ 0000 0000 0000 1010 <=>D2=1024_0000 0100 0000 0000
:
D0=31_0000 0000 0001 1111 <=>D2=           0_0000 0000 0000 0000
                                                      D3=  -32768_ 1000 0000 0000 0000
:
D0=64_0000 0000 0010 0000 <=>D2=     0_ 0000 0000 0000 0000
                                                       D3=     0_ 0000 0000 0000 0000  
                                                       D4=     0_ 0000 0000 0000 0000
                                                       D5=     0_ 0000 0000 0000 0000
                                                       D6=     1_ 0000 0000 0000 0001
:
D0=128_0000 0000 1000 0000<=>D2=    0_0000 0000 0000 0000
                                                        D3=    0_0000 0000 0000 0000  
                                                        D4=    0_0000 0000 0000 0000
                                                        D5=    0_0000 0000 0000 0000
                                                        D6=    0_0000 0000 0000 0000
                                                        D7=    0_0000 0000 0000 0000
                                                        D8=    0_0000 0000 0000 0000
                                                        D9=    0_0000 0000 0000 0000
                                                        D10=  1_0000 0000 0000 0001
:
D0=255_0000 0000 1111 1111 <=>D2=            0_0000 0000 0000 0000
                                                        D3=            0_0000 0000 0000 0000
                                                        D4=            0_0000 0000 0000 0000
                                                        D5=            0_0000 0000 0000 0000
                                                        D6=            0_0000 0000 0000 0000
                                                        D7=            0_0000 0000 0000 0000
                                                        D8=            0_0000 0000 0000 0000
                                                        D9=            0_0000 0000 0000 0000
                                                        D10=          0_0000 0000 0000 0000
                                                        D11=          0_0000 0000 0000 0000
                                                        D12=          0_0000 0000 0000 0000
                                                        D13=          0_0000 0000 0000 0000
                                                        D14=          0_0000 0000 0000 0000
                                                        D15=          0_0000 0000 0000 0000
                                                        D16=          0_0000 0000 0000 0000
                                                      D17=  -32768_ 1000 0000 0000 0000
[ 此帖被sunnykmc在2019-01-16 20:52重新編輯 ]
sunnykmc
SunnyKMC
級別: 工控俠客
精華主題: 0
發(fā)帖數(shù)量: 287 個(gè)
工控威望: 3745 點(diǎn)
下載積分: 28918 分
在線時(shí)間: 413(小時(shí))
注冊時(shí)間: 2014-04-20
最后登錄: 2024-08-27
查看sunnykmc的 主題 / 回貼
1樓  發(fā)表于: 2019-01-17 09:03
引用
引用第1樓tingfenghu于2019-01-16 22:13發(fā)表的  :
D0=0 <=> D2=1
D0=1 <=> D2=2
D0=2 <=> D2=4
D0=3 <=> D2=8
D0=4 <=> D2=16
.......

ROL 或 ROR 的結(jié)果
這不是我要的

下方2進(jìn)制那
麻煩再看看 理解一下

目前需要兩行指令來處理
但需要中間不需要的M來過水
覺得還不是很好

M來過水,一使用最大255個(gè)就最好不能用
若需要再利用就需要很小心
這程式很大時(shí)就浪費(fèi)掉了

直接用DECO  D0  M0  K8
之類來過水(過渡)也同樣浪費(fèi)意思

DECO 使用中
指令下方若有重復(fù)用的OUT M0 M1 M2前面加個(gè)如X0之類的
M0 M1 M2可就無法ON
[ 此帖被sunnykmc在2019-01-17 09:21重新編輯 ]