Mega and Scada?

You can actually do "everything" via Scada....weather station, RC vehicles, home automation etc...etc....

Actually, Scada looks more like a proof of concept right now. The PC side looks pretty good, but the Arduino side is lacking.

Do you think that you, with your knowledge of Arduino, and programming could help us a bit?

Us? I'll think about it.

There is plenty of Scada applications, that have more "in dept" demo`s.
FreeScada fex have a home automation that looks pretty cool ! (controlling lights, door locks, music, temp etc...)

I really hope that somebody that knows Arduino well, can help us to make this work ! 8)

here is plenty of Scada applications, that have more "in dept" demo`s.

Post 3 or 4 more links, and I'll look at them. I understand the Arduino, but barely have a clue about Scada, though it looks quite capable and interesting.

Scada is VERY capable, for anything....it is just how to interface it to Arduino that stops me....
Have been using Scada (as an operator) for quite a while, but I have never been on the programming side of it...

Link 1: Winlog Lite: free SCADA software | SCADA free download (might be this one that had the home auto demo I mentioned)

Link 2: http://www.integraxor.com/
Link 3: Free SCADA download | SourceForge.net
Link 4: freescada.com - This website is for sale! - freescada Resources and Information.

I went back and looked at the original Scada site you liked to, and found that I had overlooked the tabs at the top of the page. I found the user manual for the Monitoriza application. That will make it easier to create applications that communicate with the Arduino.

As I see it, the limitation right now is that the Arduino sketch that the Scada application interacts with is pretty limited.

I would think that, at a minimum, the Scada application should be able to get/set the state of all digital pins (except 0 and 1) and should be able to get the values of all analog pins.

What else do you see that Scada should be able to do with the Arduino? Get millis() values? Start and stop timers?

Hi Paul,

I just found that PDF file too (under all programs\monitoriza) and it is explainet quite well there how to do stuff.
Just had a breif look, but there is step by step instructions...

If it is possible to have Scada use an Arduino as a slave, where you can do everything you normally can do with any Arduino PCB`s, I think that I am very close to my goal...
However, I need to find a "Scada Helpline...." :roll_eyes:

I was cruising around last night looking for similar software, and found that some Scada app`s are using Python, and some C+ etc...
Does this have any practical consequence?
What would be the best/easiest to use with Arduino?

What I need from my Mega is 3 axis Gyro reading, pressure reading, temp, and maybe a LIM reading... (load insulation meter).

From my laptop to the Mega, there will be a joystick controlling DC motors, LED lights, get the Gyro readings etc...

So it is not something very complicated at the moment, but I guess that there will be more later $)

Would it be complicated to re-program the sketch to Arduino?

Would it be complicated to re-program the sketch to Arduino?

Maybe, maybe not. That's why I was asking what your requirements are. Reading and writing all digital pins and reading all analog pins would enable you to do what you describe.

It looks like Scada can make the necessary requests. Whether the Arduino sketch can be modified to satisfy all the requests, or not, is the issue.

I'll look into it.

I will try to make a "whishlist"....

Ethernet connection
6 PWM outputs (controlled from joystick)
4 outputs that can dim a cluster of maybe 4 to 6 LED`s (will be driven via a LED driver board, but need the signal)
3 axis Gyro signal going to Scada (analog or digital???)
Temp sensor (analog or digital???)
Pressure sensor (analog or digital???)
And a LIM, if possible.

This is what I really want, however, the more the better :slight_smile:

PS: Is it possible to have one or two signals going to Scada telling me the voltage delivered, and amps used?

I really appreciate your effort int this matter ! ! ! 8)

Is it possible to have one or two signals going to Scada telling me the voltage delivered, and amps used?

The voltage delivered by what to what? The amps used by what?

If you have appropriate sensors for these values, connected to analog pins, then, yes, it should be possible to alter the Arduino sketch so that Scada can collect the analog values.

If I have fex 220v delivered to the area where I have this fitted, I want to see that I have 215 or 221 volts delivered(real time), and maybe, if possible see how many amps used on the same line (total usage)...

What will I need to do this?

What will I need to do this?

I can't think of any software that would help. Seems more like a hardware problem. I'm a software guy.

Ok :slight_smile:

It is not something i need, but it would be nice to have...

Post your question in Project Guidance, or one of the hardware forums, then. Once the Arduino is measuring the voltage and current, getting Scada to access the data will be easy (hopefully).

Ok, will do that later today ! !

How is it going with the other stuff ? :blush:

The Modbus sketches for Arduino really aren't adequate for a full-on SCADA implementation. Mostly what's needed is the "coils" and "discretes" functions (single bit values for controlling digital pins), as well as a distinction between "inputs" (read-only values -- things like analog inputs) and "holding registers" (read/write values, such as PWM for digital pins).

The Arduino Modbus sketches are limited to holding registers. The sketch you referenced only implements function 3, 6 and 16 (various read and write holding registers), plus 43 (Read Modbus Encapsulated Information) function for identifying the device as an Arduino. There's no support for changing the unit number and saving that to EEPROM, which means you'd have to change the sketch for each device you wanted on the bus.

I forget what functions we provide with our Modbus-enabled Arduino UNO products, but it's most of the applicable functions, including support for coils and discretes, as well as Modbus/TCP support. We'll have a Arduino Mini daughter board (the Mini doesn't support shields ...) that will support full control over an Arduino Mini with RS-232 (both TTL level and normal RS-232 bipolar level) and RS-485 (open collector, multi-drop bus). Depending on the rest of our product development schedule, we should have support for the Arduino Mega -- mostly it's a question of figuring out how many pins we want to expose to our customers.

For your application, my suggestion would be to ditch Modbus and go with a private protocol. If you're able to use the "Modbus-ish" sketch you referenced, you'd do much better rolling your own protocol and using that. Modbus has a fair bit of overhead you don't need and can't use, and you'll still need to modify that sketch to support however many pins you've decided to support.

PaulS:

What will I need to do this?

I can't think of any software that would help. Seems more like a hardware problem. I'm a software guy.

It's pretty simple -- rectify the line voltage (make sure the diode has the correct voltage limit), then use a voltage divider (pair of resistors). Sample that output with an analog pin, find the maximum value per cycle, and report that. You'll need to divide the peak voltage by 1.414 (square root of two) to get the RMS voltage. As a hack, multiply the (int) voltage value by 46348L and shift right by 16 -- that'll give you the same value (more or less) without the floating point multiplication.

The divider should "target" the maximum AC voltage as 0 to 5 volts. For 240 volt systems, that's about 360 volts. Remember Ohm's and Kirchoff's Laws. Also remember that you want to keep the amount of power dissipated to a reasonable level -- the smaller valued resistor is going to have a 355 volt drop for a 240 volt system. Calculating resistor values is left to the reader as an exercise :slight_smile: (Hint: A large valued, multi-turn potentiometer is probably the best solution.)

Just remember you're working with potentially lethal voltages :slight_smile:

I think the GPL Modbus slave sketch is in the 15 to 20 thousand loops per second range, which is more than adequate for sampling line voltages. Europeans mains power is 20 milliseconds per cycle -- 100 samples per cycle is 200uS. North American mains power is 16.7 mS per cycle -- 100 samples per cycle is 167 uS. As you can see, not a lot of time to get processing in for real time processing, but so long as you don't poll too often you should have accurate data.

Puuh..... This was a bit over my head.... :blush:

Anyway, what you say in your reply`s make some sense to me...
However, I am not a software guy, and like to use things that "looks easy" to work with...
To program a private solution would be far better than using Scada, but it is VERY limited what I know about programming...
If I get the Scada app to do a few things (like operating DC motors, LED lights on/off, and gyro feedback) I am a very happy guy 8)
And, I would like it to look nice :drooling_face:

What you say about reading the volt and amps used sounds like the solution Im after, but, I believe that I have read somewhere that you can use Arduino boards as a "multimeter" on some pins, with the right sketch....
Wouldnt this be something familiar to what you are saying?

You have to condition the signal -- you can't just put 240 volts AC (real 240 VAC, not the fake stuff we have here in the States) onto an analog pin and expect the chip to survive.

There are some 3.5 digit DVM chips on the market -- if you wanted to make a multimeter, I'd find a way to interface one of them to the Arduino and use it for the heavy lifting.

My comment about writing your own protocol is based on the poor quality of the existing Modbus sketches. For example, if you need multiple Arduinos for all your control functions, you have to find a way to change the Modbus unit number of the Arduino you have -- the existing sketch uses a hard-coded value of "1" for the unit number. And while you could read and write multiple registers to handle switch or contact sensor, etc. values, the read and write coils and/or discretes functions are more commonly used for "on" / "off" type actions. They are also 16 times "denser" on the bus -- you can pack 8 coils / discretes in a byte, but it takes 2 bytes for a single Modbus register. You could pack your coils / discretes into a single register, but then you've got read / modify / write happening on the Modbus master, or else you need function 22 -- Mask Write Register, yet another function the Modbus sketch lacks.

I put together a demo project for visualizing and controlling your arduino via the free and open source vytronics SCADA system. Runs on any computer with nodejs installed. Check it out and have fun with it.

It has pins 12 and 13 set for output but you can change via the project/project.yml file.