In our Ltouch43 Android HMI there are 4 Relays and all the relays are in exchange contact. They have 24Vdc coil and max 5A contact current. All RELAY outputs are high quality relay and protected by varistors, all connectors are removable.
BMTouchGP12 – Relay R2
BMTouchGP13 – Relay R4
BMTouchGP14 – Relay R1
BMTouchGP15 – Relay R3
Before using them we must in the onCreate method :
instantiate the library BMtouch::
- tmp = BMTouch.LIBsetup(BMTouch.EN12 + BMTouch.EN13 + BMTouch.EN14 + BMTouch.EN15);
Set PIN (GP–) as output, sets the pin (pin) indicated as output and sets its logical level as value::
-
- val[0]= 0;
-
- BMTouch.GPIOSetupOut(BMTouch.GP12, val[0]);
- BMTouch.GPIOSetupOut(BMTouch.GP13, val[0]);
- BMTouch.GPIOSetupOut(BMTouch.GP14, val[0]);
- BMTouch.GPIOSetupOut(BMTouch.GP15, val[0]);
To switch the output by activating it or not, use this command::
-
- tmp=BMTouch.GPIOWrite(BMTouch.GP13, val[0]);
where val [0] corresponds to:
- 0 relay OFF
- 1 relay ON