Skip to content

Commit

Permalink
0.5.3-20200117
Browse files Browse the repository at this point in the history
  • Loading branch information
brickpool committed Jan 17, 2021
1 parent 75f32e8 commit 8640c33
Show file tree
Hide file tree
Showing 17 changed files with 1,897 additions and 967 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ Thumbs.db

# Ignore some sketches
/src/src.ino
/src/main.cpp

# Komodo files
*.komodoproject
/.komodotools/

# PlatformIO
.pio
.vscode
*.code-workspace
26 changes: 22 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,28 @@ This CHANGELOG file should help that the library becomes a standardized open sou
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased] - 2020-12-23
## [Unreleased] - 2021-01-17

## [0.5.3] - 2021-01-17
### Added
- Example SerialPlotter.ino added to the project folder
- Updated examples for compatibility with Arduino MKR boards
- Block oriented function LogoClient::GetDBSize
- Block oriented function LogoClient::DBGet
- DebugUtils in LogoPG.h and LogoPG.cpp

### Changed
- Using fixed-width integer types regardless of which Arduino is being targeted

### Removed
- ArduinoLog in LogoPG.h and LogoPG.cpp

### Fixed
- Example ProtocolTester.ino maximum indexing for receivedChars

## [0.5.2] - 2020-12-23
### Added
- Low Level funtion LogoClient::ReadBlock
- Low Level function LogoClient::ReadBlock
- Security function LogoClient::SetSessionPassword
- Security function LogoClient::ClearSessionPassword
- Logging (library ArduinoLog)
Expand All @@ -17,7 +34,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Protection Level in GetProtection
- Update Library Reference Manual (RefManual.md) to Rev. Ai
- DTE Interface Images
- Update Examples for Arduino MEGA: CyclicReading, FetchDataDemo, ProtocolTester
- Update Examples for compatibility with Arduino Mega boards

### Fixed
- GetOrderCode: Support of 0BA6.ES10
Expand Down Expand Up @@ -149,7 +166,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- LICENCE.md added to the project
- README.md added to the project

[Unreleased]: https://github.com/brickpool/logo/compare/v0.5.2...HEAD
[Unreleased]: https://github.com/brickpool/logo/compare/v0.5.3...HEAD
[0.5.3]: https://github.com/brickpool/logo/compare/v0.5.2...v0.5.3
[0.5.2]: https://github.com/brickpool/logo/compare/v0.5.1...v0.5.2
[0.5.1]: https://github.com/brickpool/logo/compare/v0.5.0...v0.5.1
[0.5.0]: https://github.com/brickpool/logo/compare/v0.4.3...v0.5.0
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Information about the API is described in the document [LOGO! Library Reference
All information about the protocols and details to the _LOGO!_ PLC are described in the associated [Wiki](http://github.com/brickpool/logo/wiki).

## Releases
The current library version is [0.5.2](https://github.com/brickpool/logo/releases). This version is not the final version, it is a release candidate and has implemented only the PG protocol.
The current library version is [0.5.3](https://github.com/brickpool/logo/releases). This version is not the final version, it is a release candidate and has implemented only the PG protocol.

## Examples
This directory contains the library and some examples that illustrate how the library can be used. The examples were tested with an Arduino Mega (Arduino >= 1.8.5) and Arduino UNO (only Arduino 1.8.5 is supported). Other hardware has not been tried.
Expand All @@ -19,6 +19,7 @@ This directory contains the library and some examples that illustrate how the li
- [ReadClockDemo.ino](/examples/ReadClockDemo/ReadClockDemo.ino) The example reads the date and time from the _LOGO!_ controller.
- [WriteClockDemo.ino](/examples/WriteClockDemo/WriteClockDemo.ino) The example writes a date and time to the _LOGO!_ controller.
- [PlcInfoDemo.ino](/examples/PlcInfoDemo/PlcInfoDemo.ino) The example reads the Ident Number, Firmware version and Protection level from the PLC.
- [SerialPlotter.ino](/examples/SerialPlotter/SerialPlotter.ino) This example allowing you to natively graph data from your _LOGO!_ controller by using the Arduino Serial Plotter function.

## Dependencies
- _LOGO!_ controller version __0BA4__, __0BA5__ or __0BA6__, e.g. part number `6ED1052-1MD00-0BA6`
Expand Down
24 changes: 7 additions & 17 deletions examples/CyclicReading/CyclicReading.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,12 @@ const unsigned long cycleDelay = 500; // min > 200ms
#define txPin 3
CustomSoftwareSerial LogoSerial(rxPin, txPin);
#else
// Serial1:
// rxPin 18
// txPin 19
// Mega board Serial1:
// rxPin 19
// txPin 18
// MKR board Serial1:
// rxPin 13
// txPin 14
#define LogoSerial Serial1
#endif

Expand All @@ -36,12 +39,10 @@ void setup() {
; // wait for serial port to connect. Needed for native USB port only
}

// Start the SoftwareSerial Library
// Start the LOGO Serial interface
LogoSerial.begin(9600, SERIAL_8E1);
// Setup Time, 1s.
delay(1000);
Serial.println("");
Serial.println("Cable connected");
#ifdef CustomSoftwareSerial_h
if (LogoSerial.isListening())
#else
Expand All @@ -50,11 +51,6 @@ void setup() {
Serial.println("LogoSerial is ready.");

cycleTime = millis();
// LOG_LEVEL_SILENT, LOG_LEVEL_FATAL, LOG_LEVEL_ERROR, LOG_LEVEL_WARNING, LOG_LEVEL_NOTICE, LOG_LEVEL_TRACE, LOG_LEVEL_VERBOSE
// Note: if you want to fully remove all logging code, uncomment #define DISABLE_LOGGING in Logging.h
// this will significantly reduce your project size
Log.begin(LOG_LEVEL_VERBOSE, &Serial);
Log.setPrefix(printTimestamp);
}

void loop()
Expand Down Expand Up @@ -141,9 +137,3 @@ void printBinaryByte(byte value)
Serial.print((mask & value) ? '1' : '0');
}
}

void printTimestamp(Print* _logOutput) {
char c[12];
int m = sprintf(c, "%10lu ", millis());
_logOutput->print(c);
}
22 changes: 11 additions & 11 deletions examples/FetchDataDemo/FetchDataDemo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ byte buf[2];
#define txPin 3
CustomSoftwareSerial LogoSerial(rxPin, txPin);
#else
// Serial1:
// rxPin 18
// txPin 19
// Mega board Serial1:
// rxPin 19
// txPin 18
// MKR board Serial1:
// rxPin 13
// txPin 14
#define LogoSerial Serial1
#endif

Expand All @@ -35,23 +38,20 @@ void setup() {
; // wait for serial port to connect. Needed for native USB port only
}

// Start the SoftwareSerial Library
// LOG_LEVEL_SILENT, LOG_LEVEL_FATAL, LOG_LEVEL_ERROR, LOG_LEVEL_WARNING, LOG_LEVEL_NOTICE, LOG_LEVEL_TRACE, LOG_LEVEL_VERBOSE
// Note: set to LOG_LEVEL_SILENT if you want to use the serial plotter. This will stop the serial logging
Log.begin(LOG_LEVEL_SILENT, &Serial);

// Start the LOGO Serial interface
LogoSerial.begin(9600, SERIAL_8E1);
// Setup Time, 1s.
delay(1000);
Serial.println("");
Serial.println("Cable connected");
#ifdef CustomSoftwareSerial_h
if (LogoSerial.isListening())
#else
if (LogoSerial)
#endif
Serial.println("LogoSerial is ready.");

// LOG_LEVEL_SILENT, LOG_LEVEL_FATAL, LOG_LEVEL_ERROR, LOG_LEVEL_WARNING, LOG_LEVEL_NOTICE, LOG_LEVEL_TRACE, LOG_LEVEL_VERBOSE
// Note: if you want to fully remove all logging code, uncomment #define DISABLE_LOGGING in Logging.h
// this will significantly reduce your project size
Log.begin(LOG_LEVEL_ERROR, &Serial);
}

void loop()
Expand Down
43 changes: 31 additions & 12 deletions examples/PlcInfoDemo/PlcInfoDemo.ino
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
#include <CustomSoftwareSerial.h>
#ifdef ARDUINO_AVR_UNO
#include <CustomSoftwareSerial.h>
#endif
#include "LogoPG.h"

const byte rxPin = 2;
const byte txPin = 3;
// set up the LogoSerial object
#ifdef CustomSoftwareSerial_h
#if defined(SERIAL_8E1)
#undef SERIAL_8E1
#endif
#define SERIAL_8E1 CSERIAL_8E1
#define rxPin 2
#define txPin 3
CustomSoftwareSerial LogoSerial(rxPin, txPin);
#else
// Mega board Serial1:
// rxPin 19
// txPin 18
// MKR board Serial1:
// rxPin 13
// txPin 14
#define LogoSerial Serial1
#endif

// set up the SoftwareSerial object
CustomSoftwareSerial LogoSerial(rxPin, txPin);
// set up the LogoClient object
LogoClient LOGO(&LogoSerial);

Expand All @@ -16,16 +32,20 @@ void setup() {

// Init Monitor interface
Serial.begin(9600);
while (!Serial) ; // Needed for Leonardo only
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}

// Start the SoftwareSerial Library
LogoSerial.begin(9600, CSERIAL_8E1);
// Start the LOGO Serial interface
LogoSerial.begin(9600, SERIAL_8E1);
// Setup Time, 1s.
delay(1000);
Serial.println("");
Serial.println("Cable connected");
#ifdef CustomSoftwareSerial_h
if (LogoSerial.isListening())
Serial.println("Softserial is listening !");
#else
if (LogoSerial)
#endif
Serial.println("LogoSerial is ready.");
}

void loop()
Expand Down Expand Up @@ -120,4 +140,3 @@ void CheckError(int ErrNo)
LOGO.Disconnect();
}
}

17 changes: 9 additions & 8 deletions examples/ProtocolTester/ProtocolTester.ino
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ byte message[BUFFER_SIZE]; // an array to store the message data
#define txPin 3
CustomSoftwareSerial LogoSerial(rxPin, txPin);
#else
// Serial1:
// rxPin 18
// txPin 19
// Mega board Serial1:
// rxPin 19
// txPin 18
// MKR board Serial1:
// rxPin 13
// txPin 14
#define LogoSerial Serial1
#endif

Expand All @@ -39,7 +42,7 @@ void setup() {
}
Serial.println("Monitor is ready.");

// Init LogoSerial
// Start the LOGO Serial interface
LogoSerial.begin(9600, SERIAL_8E1);
// Setup Time, 1s.
delay(1000);
Expand Down Expand Up @@ -69,8 +72,8 @@ void loop()
{
receivedChars[ndx] = rc;
ndx++;
if (ndx >= BUFFER_SIZE) {
ndx = BUFFER_SIZE - 1;
if (ndx >= sizeof(receivedChars)) {
ndx = sizeof(receivedChars) - 1;
}
}
else
Expand Down Expand Up @@ -136,5 +139,3 @@ void printHex(byte *data, size_t length) // prints 8-bit data in hex with leadin
Serial.print(tmp); Serial.print(" ");
}
}


38 changes: 28 additions & 10 deletions examples/ReadClockDemo/ReadClockDemo.ino
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
#include <CustomSoftwareSerial.h>
#ifdef ARDUINO_AVR_UNO
#include <CustomSoftwareSerial.h>
#endif
#include <TimeLib.h>
#include "LogoPG.h"

const byte rxPin = 2;
const byte txPin = 3;
// set up the LogoSerial object
#ifdef CustomSoftwareSerial_h
#if defined(SERIAL_8E1)
#undef SERIAL_8E1
#endif
#define SERIAL_8E1 CSERIAL_8E1
#define rxPin 2
#define txPin 3
CustomSoftwareSerial LogoSerial(rxPin, txPin);
#else
// Mega board Serial1:
// rxPin 19
// txPin 18
// MKR board Serial1:
// rxPin 13
// txPin 14
#define LogoSerial Serial1
#endif

// set up the SoftwareSerial object
CustomSoftwareSerial LogoSerial(rxPin, txPin);
// set up the LogoClient object
LogoClient LOGO(&LogoSerial);

Expand All @@ -21,14 +37,16 @@ void setup() {
; // wait for serial port to connect. Needed for native USB port only
}

// Start the SoftwareSerial Library
LogoSerial.begin(9600, CSERIAL_8E1);
// Start the LOGO Serial interface
LogoSerial.begin(9600, SERIAL_8E1);
// Setup Time, 1s.
delay(1000);
Serial.println("");
Serial.println("Cable connected");
#ifdef CustomSoftwareSerial_h
if (LogoSerial.isListening())
Serial.println("Softserial is listening !");
#else
if (LogoSerial)
#endif
Serial.println("LogoSerial is ready.");
}

void loop()
Expand Down
Loading

0 comments on commit 8640c33

Please sign in to comment.