12345678910111213141516171819202122232425262728293031323334353637383940 |
- ////////// Definiere Header //////////
- #ifndef MODBUS_H
- #define MODBUS_H
- ////////// Inkludierte Header-Dateien //////////
- #include <Arduino.h>
- #include <SoftwareSerial.h>
- ////////// Definierte Symbole //////////
- #define BAUDRATE 9600
- #define RX_PIN A0
- #define TX_PIN A1
- #define TIMEOUT 1000
- #define TIMEOUT_NACK 3000
- #define TIMEOUT_NACHRICHT 10000
- #define LRCVALUE 0x00 // LRC16 Startvalue
- #define MAX_DATA 250
- #define PAYLOAD 241
- #define BROADCAST_ADRESSE 00
- #define NUM_ADDRESSES 8
- ////////// Definierte Funktionen //////////
- void RS485_write(byte* buffer, byte bufflen);
- void PC_read(byte* buffer, byte* bufflen);
- void PC_write(byte* buffer, byte bufflen);
- short berechneLRC(byte* buffer, byte start, byte end);
- void RS485_read(byte* buffer, byte* bufflen);
- void send_Nachricht(byte address[3],byte message[241]);
- void allgemein_packet(byte address[3],byte function[2]);
- void sendMasterToken(byte newMasterAddress[3]);
- //void CLEAR(char* array,byte BUFFLEN);
- int pruefeLRC(byte* buffer,byte bufflen);
- bool findAddress(const char* address);
- ////////// externe Globale Variablen //////////
- ////////// Header Ende //////////
- #endif
|