Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

We Value Your Feedback!
Could you please spare a few minutes to share your thoughts on Cloud Connected vs On-Premise Services. Your feedback can help us shape the future of services.
Learn more about the survey or Click here to Launch the survey
Schneider Electric Services Innovation Team!

Esp8266 wifi sensor to Citect SCADA

AVEVA Plant SCADA Forum

A support forum for AVEVA Plant SCADA (formerly Citect SCADA). Share new and exciting product information, connect, learn, and collaborate with the ecosystem of Plant SCADA Users. AVEVA Plant SCADA a reliable, flexible and high-performance Supervisory Control and Data Acquisition software solution for industrial process customers. This forum is to connect, share, learn and collaborate new and exciting product information. Feel free to join and share to your Ecosystem of Plant SCADA Users.

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • Industrial Automation
  • AVEVA Plant SCADA Forum
  • Esp8266 wifi sensor to Citect SCADA
Options
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
olivier_vallee
Lt. Commander olivier_vallee
28
Oncom
Commander Oncom
6
BevanWeiss
Spock BevanWeiss
2
RoozeeR
Lt. Commander RoozeeR Lt. Commander
2
View All
Related Products
product field
Schneider Electric
Citect SCADA

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Back to AVEVA Plant SCADA Forum
Anonymous user
Not applicable

Posted: ‎2020-08-09 12:06 AM

0 Likes
6
4135
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2020-08-09 12:06 AM

Esp8266 wifi sensor to Citect SCADA

Hi 

Do you know  if its possible to get data from esp8266 by wifi to citect scada?

if yes how to?

Labels
  • Labels:
  • Connected Products
  • Tags:
  • english
Reply

Link copied. Please paste this link to share this article on your social media post.

  • All forum topics
  • Previous Topic
  • Next Topic
Replies 6
BevanWeiss
Spock BevanWeiss
Spock

Posted: ‎2020-08-09 04:40 PM

0 Likes
0
4110
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2020-08-09 04:40 PM

I don't believe Citect has a native driver for this, so you will likely need to involve an external application also.

 

I'd recommend investigating node-red, here's google result 1 for 'node-red esp8266 tutorial'

https://randomnerdtutorials.com/esp8266-and-node-red-with-mqtt/

 

Once you get the data into node-red, then you should be able to use OPC (server), or even perhaps ModbusTCP (server) or another such interface to present your data for consumption by Citect.

Citect itself would then be an OPC client / ModbusTCP client etc.


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
  • Tags:
  • english
Reply

Link copied. Please paste this link to share this article on your social media post.

Eric_Coudurier
Lt. Commander Eric_Coudurier Lt. Commander
Lt. Commander

Posted: ‎2020-08-12 04:44 AM

1 Like
4
4088
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2020-08-12 04:44 AM

Hello,

 

The ESP8266 can be programmed using the Arduino framework (https://www.arduino.cc/en/Main/Software), so you can find Modbus library for this module:
https://www.arduino.cc/en/ArduinoModbus/ArduinoModbus

Then use the standard Modnet driver or OFS driver from Citect SCADA to connect to the ESP8266.

 

  • Tags:
  • english
Reply

Link copied. Please paste this link to share this article on your social media post.

Anonymous user
Not applicable

Posted: ‎2020-08-17 12:42 AM

In response to Eric_Coudurier
0 Likes
3
4054
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2020-08-17 12:42 AM

Thanks

I have managed to make the connection with citect with modbus code on my esp sending temperature data .

 

if someone wants I will post the code for esp here.

  • Tags:
  • english
Reply

Link copied. Please paste this link to share this article on your social media post.

Eric_Coudurier
Lt. Commander Eric_Coudurier Lt. Commander
Lt. Commander

Posted: ‎2020-08-17 01:42 AM

In response to Anonymous user
0 Likes
0
4049
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2020-08-17 01:42 AM

Hello,

 

Yes I am interested, if you can publish the code, that will be cool.

  • Tags:
  • english
Reply

Link copied. Please paste this link to share this article on your social media post.

Anonymous user
Not applicable

Posted: ‎2021-05-04 11:43 PM

In response to Anonymous user
0 Likes
1
3133
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-05-04 11:43 PM

Please send me the codes if possible, thanks

  • Tags:
  • english
Reply

Link copied. Please paste this link to share this article on your social media post.

Anonymous user
Not applicable

Posted: ‎2021-05-13 12:19 AM

In response to Anonymous user
0 Likes
0
3075
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2021-05-13 12:19 AM

this is the code for sending temperature with esp8266 by Wifi to Citect

you need to define the port in citect with the same ip as your esp to get the connection with modbus protocol.

 

 

//ESP8266 reads Ds18b20 temperature probe connected to D4 pin(=2) and sends the data via modbus to Citect
//in Citect : need to define new port with ESPs IP (P502)
#include <ESP8266WiFi.h>


#include <OneWire.h>
#include <DallasTemperature.h>

// GPIO where the DS18B20 is connected to
const int oneWireBus = 2;
// Setup a oneWire instance to communicate with any OneWire devices
OneWire oneWire(oneWireBus);
// Pass our oneWire reference to Dallas Temperature sensor
DallasTemperature sensors(&oneWire);


//Static IP address configuration
IPAddress staticIP(10, 10, 93, 50); //ESP static ip
IPAddress gateway(10, 10, 93, 1); //IP Address of your WiFi Router (Gateway)
IPAddress subnet(255, 255, 255, 0); //Subnet mask
IPAddress dns(8, 8, 8, 8); //DNS

const char* ssid = "YOUR SSID";
const char* password = "PASSWORD";

int scansl=0;
int scans2=0;
int ModbusTCP_port = 502;

//////// Required for Modbus TCP / IP /// Requerido para Modbus TCP/IP /////////
#define maxInputRegister 20
#define maxHoldingRegister 20

#define MB_FC_NONE 0
#define MB_FC_READ_REGISTERS 3 //implemented
#define MB_FC_WRITE_REGISTER 6 //implemented
#define MB_FC_WRITE_MULTIPLE_REGISTERS 16 //implemented
//
// MODBUS Error Codes
//
#define MB_EC_NONE 0
#define MB_EC_ILLEGAL_FUNCTION 1
#define MB_EC_ILLEGAL_DATA_ADDRESS 2
#define MB_EC_ILLEGAL_DATA_VALUE 3
#define MB_EC_SLAVE_DEVICE_FAILURE 4
//
// MODBUS MBAP offsets
//
#define MB_TCP_TID 0
#define MB_TCP_PID 2
#define MB_TCP_LEN 4
#define MB_TCP_UID 6
#define MB_TCP_FUNC 7
#define MB_TCP_REGISTER_START 8
#define MB_TCP_REGISTER_NUMBER 10

byte ByteArray[260];
unsigned int MBHoldingRegister[maxHoldingRegister];

//////////////////////////////////////////////////////////////////////////

WiFiServer MBServer(ModbusTCP_port);


void setup() {
Serial.begin(115200);
sensors.begin();

delay(100) ;
WiFi.mode(WIFI_STA);
WiFi.config(staticIP, subnet, gateway, dns);
WiFi.begin(ssid, password);
int scans=0;
delay(100) ;
Serial.println(".");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
scans++;
if (scans==100) {
ESP.restart();
}
}
MBServer.begin();
Serial.println("Connected ");
Serial.print("ESP8266 Slave Modbus TCP/IP ");
Serial.print(WiFi.localIP());
Serial.print(":");
Serial.println(String(ModbusTCP_port));
Serial.println("Modbus TCP/IP Online");

}


void loop() {

Serial.println("1");
// Check if a client has connected // Modbus TCP/IP
WiFiClient client = MBServer.available();
Serial.println("2");
if (!client) {
Serial.println("3");
return;
}

Serial.println("4");
boolean flagClientConnected = 0;
byte byteFN = MB_FC_NONE;
int Start;
int WordDataLength;
int ByteDataLength;
int MessageLength;

// Modbus TCP/IP
while (client.connected()) {
Serial.println("5");
if(client.available())
{
Serial.println("6");
flagClientConnected = 1;
int i = 0;
while(client.available())
{
Serial.println("7");
ByteArray[i] = client.read();
i++;
}
Serial.println("8");
client.flush();

 

///// code here --- codigo aqui

///////// Holding Register [0] A [9] = 10 Holding Registers Escritura
///////// Holding Register [0] A [9] = 10 Holding Registers Writing 40001-40010


MBHoldingRegister[0] = readDSTemperatureC();
// MBHoldingRegister[0] = 20;
Serial.println("9");
// MBHoldingRegister[1] = 1;
// MBHoldingRegister[2] = 2;
// MBHoldingRegister[3] = 4;
// MBHoldingRegister[4] = 5;
// MBHoldingRegister[5] = 6;
// MBHoldingRegister[6] = 7;
// MBHoldingRegister[7] = 8;
// MBHoldingRegister[8] = 9;
// MBHoldingRegister[9] = 10;

 


///////// Holding Register [10] A [19] = 10 Holding Registers Lectura
///// Holding Register [10] A [19] = 10 Holding Registers Reading

int Temporal[10];

Temporal[0] = MBHoldingRegister[10];
Temporal[1] = MBHoldingRegister[11];
Temporal[2] = MBHoldingRegister[12];
Temporal[3] = MBHoldingRegister[13];
Temporal[4] = MBHoldingRegister[14];
Temporal[5] = MBHoldingRegister[15];
Temporal[6] = MBHoldingRegister[16];
Temporal[7] = MBHoldingRegister[17];
Temporal[8] = MBHoldingRegister[18];
Temporal[9] = MBHoldingRegister[19];

/// Enable Output 14
digitalWrite(14, MBHoldingRegister[14] );


//// debug

for (int i = 0; i < 10; i++) {

Serial.print("[");
Serial.print(i);
Serial.print("] ");
Serial.print(Temporal[i]);
Serial.println("10");
}
Serial.println("");

Serial.println("11");


//// end code - fin

//// rutine Modbus TCP
byteFN = ByteArray[MB_TCP_FUNC];
Start = word(ByteArray[MB_TCP_REGISTER_START],ByteArray[MB_TCP_REGISTER_START+1]);
WordDataLength = word(ByteArray[MB_TCP_REGISTER_NUMBER],ByteArray[MB_TCP_REGISTER_NUMBER+1]);
}

// Handle request

switch(byteFN) {
case MB_FC_NONE:
break;

case MB_FC_READ_REGISTERS: // 03 Read Holding Registers
ByteDataLength = WordDataLength * 2;
ByteArray[5] = ByteDataLength + 3; //Number of bytes after this one.
ByteArray[8] = ByteDataLength; //Number of bytes after this one (or number of bytes of data).
for(int i = 0; i < WordDataLength; i++)
{
ByteArray[ 9 + i * 2] = highByte(MBHoldingRegister[Start + i]);
ByteArray[10 + i * 2] = lowByte(MBHoldingRegister[Start + i]);
}
MessageLength = ByteDataLength + 9;
client.write((const uint8_t *)ByteArray,MessageLength);

byteFN = MB_FC_NONE;

break;


case MB_FC_WRITE_REGISTER: // 06 Write Holding Register
MBHoldingRegister[Start] = word(ByteArray[MB_TCP_REGISTER_NUMBER],ByteArray[MB_TCP_REGISTER_NUMBER+1]);
ByteArray[5] = 6; //Number of bytes after this one.
MessageLength = 12;
client.write((const uint8_t *)ByteArray,MessageLength);
byteFN = MB_FC_NONE;
break;

case MB_FC_WRITE_MULTIPLE_REGISTERS: //16 Write Holding Registers
ByteDataLength = WordDataLength * 2;
ByteArray[5] = ByteDataLength + 3; //Number of bytes after this one.
for(int i = 0; i < WordDataLength; i++)
{
MBHoldingRegister[Start + i] = word(ByteArray[ 13 + i * 2],ByteArray[14 + i * 2]);
}
MessageLength = 12;
client.write((const uint8_t *)ByteArray,MessageLength);
byteFN = MB_FC_NONE;

break;
}
// scansl++;
// Serial.println(scansl);
// if (scansl==100000) {
// ESP.restart();
//}
Serial.println("12");
}
Serial.println("13");

if (WiFi.status() != WL_CONNECTED) {
ESP.restart();
}
scans2++;
Serial.println(scans2);
if ((client.connected()==0)&&(scans2>50000)) {
ESP.restart();
}

Serial.println("14");
}

 

int readDSTemperatureC() {
// Call sensors.requestTemperatures() to issue a global temperature and Requests to all devices on the bus
sensors.requestTemperatures();
float tempC = sensors.getTempCByIndex(0);

if(tempC == -127.00){
Serial.println("Failed to read from DS18B20 sensor");
// return "--";
} else {
Serial.print("Temperature Celsius: ");
Serial.println(tempC);
}
return tempC*10;
}

  • Tags:
  • "esp"
  • "wifi"
  • english
Reply

Link copied. Please paste this link to share this article on your social media post.

Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of