首页
/
每日頭條
/
科技
/
三菱plcfx1n怎麼求平均值
三菱plcfx1n怎麼求平均值
更新时间:2024-10-21 05:13:20

工業自動化控制中,通常會遇到如何一個數據是奇數還是偶數的情況,一個簡單方法教你學會如何判數據的斷奇偶性;

奇數:不能被2整除的數為奇數;

偶數:能被2整除的數為偶數;

在三菱FX PLC的梯形圖編程中按照如下方法判斷:

三菱plcfx1n怎麼求平均值(PLC中如何判斷數據是奇數or偶數)1

D100為待判斷奇偶的數據,通過MOV指令将其傳給K4M100(M100-M115的16位寄存器);如果D100為奇數,那麼M100這個位寄存器為1,如果D100為偶數,那麼M100為0;

(覺得有用的老鐵不妨點個贊,加個關注,後期分享更多精彩)

,
Comments
Welcome to tft每日頭條 comments! Please keep conversations courteous and on-topic. To fosterproductive and respectful conversations, you may see comments from our Community Managers.
Sign up to post
Sort by
Show More Comments
Copyright 2023-2024 - www.tftnews.com All Rights Reserved