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.
Revision 2:bf16a2ba8662, committed 2016-02-23
- Comitter:
- Davidroid
- Date:
- Tue Feb 23 10:40:49 2016 +0000
- Parent:
- 1:331915faf16e
- Child:
- 3:2f05ee4920d0
- Commit message:
- Re-design to keep coherence with other expansion boards.
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 Fri Feb 19 14:46:29 2016 +0000 +++ b/X_NUCLEO_PLC01A1.lib Tue Feb 23 10:40:49 2016 +0000 @@ -1,1 +1,1 @@ -https://developer.mbed.org/teams/ST/code/X_NUCLEO_PLC01A1/#88626b7666ff +https://developer.mbed.org/teams/ST/code/X_NUCLEO_PLC01A1/#1ec0dea195f8
--- a/main.cpp Fri Feb 19 14:46:29 2016 +0000 +++ b/main.cpp Tue Feb 23 10:40:49 2016 +0000 @@ -2,8 +2,8 @@ ****************************************************************************** * @file main.cpp * @author AST/CLs - * @version V1.0.0 - * @date Feb 5th, 2016 + * @version V1.1.0 + * @date February 23rd, 2016 * @brief mbed test application for the STMicroelectronics X-NUCLEO-PLC01A1 * PLC Expansion Board. ****************************************************************************** @@ -39,13 +39,12 @@ /* Includes ------------------------------------------------------------------*/ -/* Component specific header files. */ -#include "PLC_class.h" -#include "CLT01_38S_class.h" -#include "VNI8200XP_class.h" +/* expansion board specific header files. */ +#include "x_nucleo_plc01a1_class.h" /* Definitions ---------------------------------------------------------------*/ + #define SPI_MOSI D11 #define SPI_MISO D12 #define SPI_SCLK D13 @@ -60,6 +59,7 @@ /* Uncomment this for OUTPUT_CYCLING ENABLE */ #define OUTPUT_CYCLING + /* Variables -----------------------------------------------------------------*/ /* Array for input data from Digital Input Termination Device */ @@ -118,6 +118,7 @@ spi.frequency(frequency_hz); } + /* Main ----------------------------------------------------------------------*/ int main() @@ -148,4 +149,3 @@ wait_ms(10); } } -