m580对于io口对应到%m和%mw区。
传上原程序及图片自行查看。
FOR A:= 0 TO 31 BY 1 DO
DI_32_0[A]:= PLC0_d0_r0_s6_DDI3202K.DIS_CH_IN[A].VALUE;
DI_32_1[A]:= PLC0_d0_r0_s7_DDI3202K.DIS_CH_IN[A].VALUE;
DI_32_2[A]:= PLC0_d0_r0_s8_DDI3202K.DIS_CH_IN[A].VALUE;
DI_32_3[A]:= PLC0_d0_r0_s9_DDI3202K.DIS_CH_IN[A].VALUE;
DI_32_4[A]:= PLC0_d0_r0_s10_DDI3202K.DIS_CH_IN[A].VALUE;
DI_32_5[A]:= PLC0_d0_r0_s11_DDI3202K.DIS_CH_IN[A].VALUE;
DI_32_6[A]:= EIO2_d1_r0_s1_DDI3202K.DIS_CH_IN[A].VALUE;
END_FOR;
FOR B:= 0 TO 31 BY 1 DO
EIO2_d1_r0_s2_DDO3202K.DIS_CH_OUT[B].VALUE:=DO_0_32[B] ;
EIO2_d1_r0_s3_DDO3202K.DIS_CH_OUT[B].VALUE:=DO_1_32[B] ;
EIO2_d1_r0_s4_DDO3202K.DIS_CH_OUT[B].VALUE:=DO_2_32[B] ;
END_FOR;
FOR C:= 0 TO 7 BY 1 DO
AI_8_0[C]:= EIO2_d1_r0_s5_AMI0800.ANA_CH_IN[C].ANA.TRUE_VALUE;
AI_8_1[C]:= EIO2_d1_r0_s6_AMI0800.ANA_CH_IN[C].ANA.TRUE_VALUE;
AI_8_2[C]:= EIO2_d1_r0_s7_AMI0800.ANA_CH_IN[C].ANA.TRUE_VALUE;
AI_8_3[C]:= EIO2_d1_r0_s8_AMI0800.ANA_CH_IN[C].ANA.TRUE_VALUE;
AI_8_4[C]:= EIO2_d1_r0_s9_AMI0800.ANA_CH_IN[C].ANA.TRUE_VALUE;
END_FOR;
FOR D:= 0 TO 7 BY 1 DO
EIO2_d1_r0_s9_AMO0802.ANA_CH_OUT[D].ANA.VALUE:=AO_0_8[D] ;
EIO2_d1_r0_s10_AMO0802.ANA_CH_OUT[D].ANA.VALUE:=AO_1_8[D] ;
END_FOR;
for循环提取io中的value值到%m区,这样上位机可以访问。不用每个都去对应。程序里还可以直接调用%m区和%mw区
楼主最近还看过