An example of usage of the X-NUCLEO-PLC01A1 Programmable Logic Controller Expansion Board.

Dependencies:   X_NUCLEO_PLC01A1

PLC with the X-NUCLEO-PLC01A1 Expansion Board

This application provides a simple example of usage of the X-NUCLEO-PLC01A1 Programmable Logic Controller Expansion Board.
It shows how to use one PLC connected to the board, driving the status of each output channels according to the status of each input channels.

Files at this revision

API Documentation at this revision

Comitter:
apalmieri
Date:
Wed Feb 24 10:54:02 2016 +0000
Parent:
4:17b45bcd5b40
Child:
6:afd63b2b2d1a
Commit message:
Sync w/ X_NUCLEO_PLC01A1 lib (rev4)

Changed in this revision

X_NUCLEO_PLC01A1.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/X_NUCLEO_PLC01A1.lib	Tue Feb 23 13:00:04 2016 +0000
+++ b/X_NUCLEO_PLC01A1.lib	Wed Feb 24 10:54:02 2016 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/teams/ST/code/X_NUCLEO_PLC01A1/#cce192eb931f
+http://developer.mbed.org/teams/ST/code/X_NUCLEO_PLC01A1/#e97bbb97aa43
--- a/main.cpp	Tue Feb 23 13:00:04 2016 +0000
+++ b/main.cpp	Wed Feb 24 10:54:02 2016 +0000
@@ -67,7 +67,7 @@
   * @param  None
   * @retval None
 */
-void DigitalInputArrayHandler(PLC &plc)
+void DigitalInputArrayHandler(X_NUCLEO_PLC01A1 &plc)
 {
   plc.plcInput().DigInpArray_GetInput(inputArray);
 }
@@ -77,7 +77,7 @@
   * @param None
   * @retval None
 */
-void SsrelayHandler(PLC &plc)
+void SsrelayHandler(X_NUCLEO_PLC01A1 &plc)
 {
   /* Set outputArray as DigInpArray RxBuffer */
   outputArray[1] = plc.signalMirror(inputArray[1]);
@@ -118,8 +118,8 @@
     SPI spi(X_NUCLEO_PLC01A1_PIN_SPI_MOSI, X_NUCLEO_PLC01A1_PIN_SPI_MISO, X_NUCLEO_PLC01A1_PIN_SPI_SCLK);
     setup(spi, X_NUCLEO_PLC01A1_PIN_SPI_BITS);
 
-    /* Initializing PLC IO Channels Component. */
-    PLC plc(X_NUCLEO_PLC01A1_PIN_SPI_CS1, X_NUCLEO_PLC01A1_PIN_SPI_CS2, X_NUCLEO_PLC01A1_PIN_OUT_EN, spi);
+    /* Initializing X_NUCLEO_PLC01A1 IO Channels Component. */
+    X_NUCLEO_PLC01A1 plc(X_NUCLEO_PLC01A1_PIN_SPI_CS1, X_NUCLEO_PLC01A1_PIN_SPI_CS2, X_NUCLEO_PLC01A1_PIN_OUT_EN, spi);
 
     while(1) {
         plc.plcInput().SetReadStatus(1);