[[Template core/front/global/updateWarning is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]
//scan bit
for fIndex:= 0 to 6 do
if testbit.[fIndex] then
testResult := testResult + 1;
end_if;
end_for;
//set-reset result and restart
if fIndex > 5 then
if testResult > 1 then
testbit.10 := 1;
else
testbit.10 := 0;
end_if;
fIndex := 0;
testResult:= 0;
end_if;
How to program this logic in Logix5000
in Allen Bradley / Rockwell Automation
Posted
think this is a good one
//scan bit
for fIndex:= 0 to 6 do
if testbit.[fIndex] then
testResult := testResult + 1;
end_if;
end_for;
//set-reset result and restart
if fIndex > 5 then
if testResult > 1 then
testbit.10 := 1;
else
testbit.10 := 0;
end_if;
fIndex := 0;
testResult:= 0;
end_if;