24.04.2013 Views

Conceptos de PLC

Conceptos de PLC

Conceptos de PLC

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

API Mnemónico Operandos Función<br />

190 MBC P<br />

Conteo <strong>de</strong> estado <strong>de</strong> bit<br />

<strong>de</strong> matriz<br />

3. Conjunto <strong>de</strong> instrucciones<br />

Controladores<br />

ES2/EX2 SS2 SA2 SX2<br />

Tipo<br />

OP<br />

S<br />

n<br />

Dispositivos<br />

<strong>de</strong> bit<br />

X Y M S<br />

Dispositivos <strong>de</strong> palabra<br />

K H KnX KnY KnM KnS T C D<br />

* * * * * * *<br />

* * *<br />

E F<br />

Escalones <strong>de</strong><br />

programa<br />

MBC, MBCP:<br />

7 escalones<br />

D * * * * * * * *<br />

PULSE 16 bits 32 bits<br />

ES2/EX2 SS2 SA2 SX2 ES2/EX2 SS2 SA2 SX2 ES2/EX2 SS2 SA2 SX2<br />

Operandos:<br />

S: Dispositivo fuente <strong>de</strong> matriz n: Longitud <strong>de</strong> matriz (K1~K256) D: Resultado <strong>de</strong> operación<br />

Explicaciones:<br />

1. La instrucción MBC cuenta el número <strong>de</strong> bit 1 o bit 0 en la matriz con longitud <strong>de</strong> matriz n y<br />

almacena el número contado en D.<br />

2. Si los operandos S, o D usan formato KnX, KnY, KnM, KnS, solo n = 4 es aplicable.<br />

3. Cuando M1098 = ON, la instrucción MBC cuenta el número <strong>de</strong> bit 1. M1098 = OFF, la<br />

instrucción MBC cuenta el número <strong>de</strong> bit 0. Si el resultado <strong>de</strong> conteo <strong>de</strong> bits es 0, M1099 = ON<br />

4. Ban<strong>de</strong>ras asociadas:<br />

M1098: Conteo <strong>de</strong>l número <strong>de</strong> bits que son “1” o “0”<br />

M1099: ON cuando el resultado <strong>de</strong> conteo <strong>de</strong> bits es “0”..<br />

Ejemplo <strong>de</strong> programa:<br />

Cuando X0 = ON con M1098 = ON, la instrucción MBC cuenta el número <strong>de</strong> bit 1 en D0~D2 y<br />

almacena el número contado en D10. Cuando X0 = ON con M1098 = OFF, la instrucción cuenta<br />

el número <strong>de</strong> bit 0 en D0~D2 y almacena el número contado en D10.<br />

X0<br />

MBC D0 K3 D10<br />

D0<br />

D1<br />

D2<br />

D10<br />

D10<br />

1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1<br />

1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1<br />

1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1<br />

12<br />

M1098=0<br />

36 M1098=1<br />

3-439

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!