Go Down

Topic: Communication with arduino and OPC/SCADA? (Read 8 times) previous topic - next topic

An3s


Hello

I am proud to present the first free OPC Server for Arduino. You can get more information from the Arduino OPC Server project page at:
http://www.ismsolar.com/arduino-opc-server

Now it is in beta stage so help is wanted to debug. The project is going to be Open Source and source will be published as soon as stable version will be released with your help (of course if you need the sources now you can contact with me).

If you use it please, tell me about that to improve it.

There is a forum of the project if you need some open support.

All the best
ilde


Hi ilde

Great work with the OPC Server. Works great.

The only thing I noted is, when using the OPC library with the One Wire Digital Temperature Sensor - DS18B20, the OPC Tag health change to "bad" each time the temperature is read from the DS18B20.

Can you please look into this if you get the same result.

BR
An3s

ilde


Hello!

yes, i can imagine where is the bug in the Arduino OPC Server. Could you send me your sketch or al least the line where you create the OPC Item? AddItem(....

I am creating a new site for the Arduino OPC Server at:

http://www.ArduinoOPC.com/

so you could use the support forum for news, updates and bug fixes

All the best
ilde




An3s

#12
Oct 28, 2013, 11:44 pm Last Edit: Oct 29, 2013, 12:05 am by Coding Badly Reason: 1


Hello!

yes, i can imagine where is the bug in the Arduino OPC Server. Could you send me your sketch or al least the line where you create the OPC Item? AddItem(....

I am creating a new site for the Arduino OPC Server at:

http://www.ArduinoOPC.com/

so you could use the support forum for news, updates and bug fixes

All the best
ilde






Hi ilde

Please see my sketch below. Any suggestions are welcome.

Just to recap: when the piece of code "  if(currentMillis - previousMillis > 2000)" executes every 2 seconds the OPC tag quality changes from good to bad and back to good.

It seems like every time the onewire device is accessed the OPC quality changes.

Looking forward to your response.

Regards
an3s







Code: [Select]
#include <OPC.h>
#include <OneWire.h>
#include <DallasTemperature.h>

#define ONE_WIRE_BUS 10

OneWire oneWire(ONE_WIRE_BUS);                                                             // Setup a oneWire instance to communicate with any OneWire devices
DallasTemperature Sensors(&oneWire);                                                       // Pass our oneWire reference to Dallas Temperature.
DeviceAddress ThermometerAddr = { 0x28, 0x2C, 0x83, 0x04, 0x05, 0x00, 0x00, 0x6B };  // Assign the addresses of your 1-Wire temp sensors.

OPC aOPC;  // Declaring the OPC object

int Analogue;
long previousMillis = 0;

int callback(const char *itemID, const opcOperation opcOP, const int value)  // create a callback function for the OPCItem
{
 return Analogue;
}

void setup() {
 Serial.begin(9600);
 Sensors.begin();                                    // Start up the library
 Sensors.setResolution(ThermometerAddr, 12);   // set the resolution to 12 bit
 Sensors.requestTemperatures();                      // Getting Temperatures
 
 aOPC.setup();                                       // OPC Object initialization

 aOPC.addItem("store",opc_read, opc_int, callback);  // random OPCItem declaration
}

void loop() {
 
 aOPC.processOPCCommands();                      // OPC process commands
   
 unsigned long currentMillis = millis();

 if(currentMillis - previousMillis > 2000)           // Scan This peace of code only every 2 seconds
 {
   previousMillis = currentMillis;    
   Sensors.requestTemperatures();                    // Getting Temperatures
   Analogue = Sensors.getTempC(ThermometerAddr);
 }
 
}



Moderator edit: [code] [/code] tags added.

VisBee

Hi,

congrats to idle, nice work -ArduinoOPC -

I guess we are to late with integrating our Ardiuno script to communicate from VisBee to Arduino on direct way  :~

Anyway, with VisBee Visualisation you naw have to possibilities to communicate with Arduino Hardware.

1) Arduino OPC by ilde
2) Direkt with VisBee Skript (http://www.visbee.de)

However, have fun with your Arduino !

- VisBee
VisBee visualization by christ-elektronik

- http://www.visbee.de -
- sales@visbee.de

- +49 8331 / 83 71-135

vytronics

Here is a link to a sample I put together to talk to Arduino using the open source SCADA project I maintain. It can run on any computer running node JS. No special code such as modbus need to be loaded to the arduino. It uses the built in firmata driver!

https://github.com/vytronics-samples/arduino.scada

Review the readme file for install instructions.

See live demo here with driver in sim mode.

www.vytronics.com - there is a button to view the live demo.


Go Up