jean-jean
Hi everyone!

I've just fond thit project, for those who want industrial protection :

https://www.kickstarter.com/projects/279405789/megaio-ind-industrial-and-building-automation-for
Reply 0 0
thiagoralves
Wow, this is nice! I could do it. Is your driver based on Python or C?
Reply 0 0
mbeffa
We have command line drivers, written in C, and Python as well. 
Let me know if I should send 2 cards, We would really love to get going with the OpenPLC.
Reply 0 0
epgodoy
The Sequent Microsystems boards are great! We are using here.
Having drivers for the Industrial model in the OpenPLC would be awesome. Much better than using the UniPi.
Tks
Reply 0 0
thiagoralves
Perfect! @mbeffa I will send you my address over PM. Thanks.
Reply 0 0
epgodoy
Hello guys,
Any news about that?
Tks
Reply 0 0
mbeffa
We sent Thiago sample cards long time ago and did not hear from him.
Hey, Thiago, any news about this?
Reply 0 0
NWT.Stuff
mbeffa,

Not sure I can help out with OpenPLC drivers but willing to test and assess your hardware.

As Thiago previously states it's more a question of going through the functionality and looking up what can be remapped or what may require something else !!

I'm always using relay outputs so plug in card interesting for me.

Kevin

P.S. I would describe myself as an enthusiast with no commercial interest 🙂 
Reply 0 0
mbeffa
Honestly, so far we gave away 4 or 6 cards, and nobody followed up with any software.
Our cards have been tested by thousands of users. We had some issues, we still have some, it's work in progress.
If you would test the cards and post the result on youtube, it would be a different story.
Reply 0 0
NWT.Stuff

Yes I can certainly evaluate and post a video.

Also I will be installing addressable LED’s as a light feature in my house soon. I was going to use an Arduino but could use your board instead.  

Kevin


 

Reply 0 0
mbeffa
Do you have a channel on YouTube?
Reply 0 0
NWT.Stuff
Actually Yes 🙂

However no content or followers etc. 🙁

The intention is to post my projects & Home Automation videos. However not found the time to do this yet.

If you are interested in my style check out my other you tube channel   https://www.youtube.com/channel/UChOZtwNDYsNnTOP0LZP0d6g

There is some content on my facebook page https://www.facebook.com/NWT.Stuff
Reply 0 0
mbeffa
Let's take this discussion outside this forum. It does not have much to do with the content here.
Please email me directly to mbeffa@gmail.com.
Reply 2 0
thiagoralves
Hi guys, sorry for taking so long with this. I'm not working full time on OpenPLC anymore, so my updates come slowly as I have free time to work on it (which unfortunately is not much). But this weekend I pushed a huge update to the project that enables not only MegaIO boards but virtually any hardware device that has a Python library to easily integrate with OpenPLC. I'll make a fancy write up for that later, but I wanted to share the news here with you guys first since you're waiting a long time for this.

The new addition is called Python SubModule or just simply PSM. If you update your OpenPLC Runtime (on Windows go to Start Menu -> OpenPLC -> Rebase | on Linux you have to git clone and install again) you will see that the Hardware tab has a new driver (hardware layer) called PSM. There is one for Windows and one for Linux. If you enable PSM, you will see a code area that shows right below the driver selection. That area is pure Python 3. You can write your code in there and it goes directly to OpenPLC core. Just to illustrate how easily it integrates with OpenPLC, this is a sample code that should read MegaIO-IND analog input channel 1 on board stack level 0 and place it in OpenPLC location %IW0:
def update_inputs():
    voltage_input = int(megaind.get0_10In(0, 1) * 100)
    psm.set_var("IW0", voltage_input)

That's it!!!! Cool, isn't? I'm particularly very proud of this because it takes OpenPLC to another level. All those Raspberry Pi digital sensors (i2c, spi, etc) that can be interfaced using Python are now easily integrated on OpenPLC.

PSM comes with a ready to use skeleton code that you can modify on the fly. Here is how this simple megaind code would look like on the complete code:
#import all your libraries here
import psm
import time
import megaind

def hardware_init():
    #Insert your hardware initialization code in here
    psm.start()
def update_inputs():
    #place here your code to update inputs
    voltage_input = int(megaind.get0_10In(0, 1) * 100)
    psm.set_var("IW0", voltage_input)
    
def update_outputs():
    #place here your code to work on outputs
    voltage_output = psm.get_var("QW0") / 100.0
    megaind.set0_10Out(0, 1, voltage_output)
if __name__ == "__main__":
    hardware_init()
    while (not psm.should_quit()):
        update_inputs()
        update_outputs()
        time.sleep(0.1) #You can adjust the psm cycle time here
    psm.stop()


@mbeffa could you make sure this code works correctly? Also, can you help me improve this to make use of all MegaIO-IND inputs and outputs? 
Reply 4 0
NWT.Stuff
Nice one Thiago.

Not sure I have got my head around it yet.

Is it a kind of flexible mapping and configuration approach or more complicated than that ?

Will,try to understand and feedback.  Kevin
Reply 0 0
thiagoralves
This is more on the hardware support side of things. Take for example one of the adafruit sensors for the Raspberry Pi. I just got this one randomly from Google:  https://www.adafruit.com/product/4026 . This is a very low cost soil sensor that seems perfect for a home automation project with a PLC. However, this sensor is quite hard to interface unless you have a library you can use. And, not to my surprise, this sensor (and pretty much any other out there) only has libraries available for Python! OpenPLC core was written in C (for speed and flexibility). Writing an interface to a sensor like this in C is a complete pain! It would take hours of testing and development, and hundreds of lines of code. On the other hand, writing a Python code to interface with this sensor takes only a few lines:
from board import SCL, SDA
import busio
from adafruit_seesaw.seesaw import Seesaw
i2c_bus = busio.I2C(SCL, SDA)
ss = Seesaw(i2c_bus, addr=0x36)
# read moisture level through capacitive touch pad
moisture = ss.moisture_read()
# read temperature from the temperature sensor
temp = ss.get_temp()
print("temp: " + str(temp) + "  moisture: " + str(touch))

Quite easy right? So, what PSM does is basically to bring Python's power and ease of use to an OpenPLC driver. You can use PSM write an OpenPLC driver and make those sensor readings available right in your PLC program. Just like that:
moisture = ss.moisture_read()
temp = ss.get_temp()
psm.set_var("IW0",moisture)
psm.set_var("IW1",temp)

This takes the moisture reading from the sensor and stores it on %IW0, and takes temperature reading from the sensor and stores it on %IW1. Then, when you're writing your PLC program as you normally do, every time you reference a variable to %IW0 you're actually getting the moisture readings from the sensor, automagically! You write the PSM driver once, and every PLC program you run afterwards benefit from it. And since this is Python, the sky is the limit for your creativity.
Reply 6 0
Reply