Communication between JADE agents AND siemens S7 1200 PLC - agents-jade

i would like to learn how I can make my agents communicate with a PLC(siemens S7 1200). Basically the agents are created in JADE and make a decision kind of a true and false decision which they are to send the PLC. If its true the PLC is activated or otherwise. I have heard of the concept of using simple object access protocol, but not familiar with it (if anyone knows how to use that they can help me with a sample program or means of linking my programs). To complete this by 08 April 2013

I think you're talking about OPC.
OPC is an 'open' standard guarded and maintained by the OPC Foundation.
Every manufacturer of PLCs has an OPC server that communicates over their own protocol to their PLCs. The OPC clients can be donwloaded, purchased or created.
In short [S7-1200] cable S7 over ethernet cable [PC OPC Server intern OPC Protocol intern OPC Client]
In your case, you need an OPC Server from Siemens for the S7-1200. And the OPC client will be your agent. JADE needs to have a OPC library in order to communicate over OPC. See the website of www.opcfoundation.org for the possibilities.
Now you can read and write directly into the PLC.
But, you're using an S7-1200. The new micro automation PLC from Siemens. This has a new memory lay-out and OPC need some tricks to make it work. (Has to do with direct addressing in the older S7 PLCs and the named values in the S7-1200). The following FAQ from Siemens will help you further
How do you connect a PC station to an S7-1200 with OPC?
http://support.automation.siemens.com/WW/view/en/39960679
Or you could try sending the values via TCP/IP. This requires a reprogramming of the PLC.
CPU CPU Communication
http://support.automation.siemens.com/WW/view/en/20982954

I know this is a bit late but libnodave is a package for communication with Siemens PLC's. It works in Java too which is a great plus. I don't think it is suitable for industrial applications though. I do remember Siemens having their own version of the library. Just google it.

Related

Windows machine as USB-488/USBTMC device

I would like to use a windows machine as a USB488/USBTMC device. USB488/USBTMC is a reimplementation of the good old GPIB/IEEE-488 on USB rails. But most articles on the topic refer to a Windows machine as a host/controller. The Windows USB stack is not well suited for USB device/USB OTG modes. However, if you look at some of the high-end gear like oscilloscopes and spectrum/network analyzers, it is well known that they are often Windows machines inside with some additional hardware. So, how it is done?
To some background: it is a project to retrofit a very old SEM microscope with new hardware. The current one is a 68k custom system with a CRT that uses a GPIB interface for comm with a PC. Things like sample spectroscopy are done as a BASIC program running on a pc and communicating through that gpib port. The plan is to replace that 68k junk with a modern day windows pc with an FPGA on a PCIe bus. For compatibility reasons, it would be nice to have a usb488 port in the new PC. Though I have no idea of how to do it properly. The only solution I have so far is to have some cheap USB-capable micro hanging on the SPI bus on the FPGA facing side and a USBTDM class on the USB side. But maybe Im missing something and there is a specific thing or chip that exists that can do it that Im not aware of.
I can only speculate how high-end oscilloscopes achieve it. The most likely option is that they use a dedicated chip like a MAX3420E. It is connected via SPI. Part of the USB protocol is implemented by the chip, part of it will be implemented by the oscilloscope software.
Most USB controllers chips found in PCs can operate as the host only. And even if they could do a role swap, Windows (for Desktop) has not supported device/peripheral mode until recently. It now does. See USB Dual Role Driver Stack Architecture. But I don't fully understand it to tell you what hardware you would need to purchase where this feature is enabled.
Role swapping is very common on smartphones. It is also implemented in Linux (search for "Linux USB gadget"). Many Apple Macs can run in Target Disk Mode, which is a USB device/peripheral mode as well.

Is LoRaWan only accessible with an internet connection?

I'm planning to build an IoT project for an oil palm plantation through the use of an Arduino and an Android Mobile application for my final year project in University. As plantations have low to no communication signals which includes wifi, it is possible to implement LoRaWAN without access to the internet/use/ of a web-based application?
The LoRaWAN node does not need any other communications channel aside from LoRaWAN, of course. Would not make any sense otherwise. ;-)
The gateway however does need a connection to the server application that is to be used as a central instance for your use case. Usually this is an existing LoRaWAN cloud service such as The Things Network (TTN) with your application connected behind, but in theory you could connect the gateway to your very own central, making your whole network independent. This is possible because LoRa uses frequency bands free for use (ISM bands) so anyone can become a „network operator“. The TTN software is available as Open Source, for example.
Connection from the gateway to the central is usually done via existing Ethernet/WiFi infrastructures or mobile internet (3G/4G), whatever suits best.
Besides, the LoRa modules available for Arduinos can be used for a low-level, point-to-point LoRa (not LoRaWAN) connection between two such modules. No gateway here. Maybe that is an option, too, for your use case.
The LoraWAN is using the Gateway connected to some kind of cloud, for example the TTN network which is community based. If you live in a bigger city you have good chances to have a TTN Gateway in your area.
You can however connect two Lora nodes together to get a point to point connection. You can send data from Node1, which is connected to some kind of sensor and batterypowered, to Node2, which is stationary and stores all the data to a flashdrive for example. From this flashdrive you can import the data to a website or you could use an application like Node-Red to display the data on a Dashboard.
Here you will find instructions on how to send Data from one Lora-Node to another.
Here you will find instuctions on how to use Node-Red to display your Lora-Data. You will have to change the input from the TTN-Cloud to a textfile on your Raspberry, or whatever gateway you use. (Optional)

Can I used Step7 as PLC simulator?

I have PLC program written in Step7.
Also i have SCADA with OPC Server.
I want to simulate PLC with programm from Step7 and connect it to OPC Server, because i want SCADA testing.
Can I used Ste7 as PLC simulator, how can i do that ?
I founded some blog where what tutorial how to config Step7 and simulator, but doesn't work, this was very old tutorial.
As an alternative solution to the fine one from tonteria2424
You could try to load the program into a virtual S7-1500 and activate OPC-UA ..
Follow this 7 virtual steps (step7)
Download trial versions of simatic tia portal from
https://support.industry.siemens.com/
Google "S7-PLCSIM Advanced trial"
and "tia portal trial"
You need "STEP 7 Professional V14" SP1 + updates
and "SIMATIC S7-PLCSIM Advanced V1.0 SP1"
Then you can load your program into a virtual plc, connected to a virtúal network adapter and use the opc server(in the virtual plc) as a datasource for your scada and test it for 21 days.
PLCSim Advance can do networking, so testing can be close to "real life".
I have tested this setup many times.
if your scada cannot do opc ua... that was covered by the first answer ;)
(I did not know that NetToPlcSim was opc da capable)
//PerD
Please go the support Site of Siemens and narrow down your question. It is far too open.
But I guess that this might be your answer.
PLC SIM (for 300, 400 and 1200 and 1500) does not support externel connections. Only internal to their HMI/Scada on the same host.
I did what you want using PLCSIM + a free software called NetToPlcSim simulating S7 300.
I used Simatic step 7 v5.5 I don't know if it still works with newer versions

Secure Arduino over internet

I am trying to create a system for controlling my home appliances using arduino over internet.
Arduino Uno will act as a web server and recieve the commands from remote browser.
In doing to I am not sure as how to protect arduino from unauthorized requests from web.
Is there a way to do this, or is there any library available for this. Please suggest.
What i suggest you is to do what a lot of people does, so: use a raspberry (or a beaglebone or another linux embedded board) for the web interface and the arduino for the sensors/actuators.
This way you can install a real webserver, with a lot more functionalities than the bare arduino. You can then interface the webpages to the serial port to send the arduino the commands

How to use Visual Basic, Mindstorms NXT and USB communication Altogether?

I have been researching for a couple of days, and i have not found anything I understand about sending direct commands to the NXT via USB. All of the tutorials I have found are based on Bluetooth communication, and the information I have found about USB is always like "Better change to bluetooth", or "Think about it as a COM port"
I had previously sent those commands via Bluetooth, but the connection fails too often to be useful, and is slower than USB.
USB connection is not detected as a COM port, but I know it is posible to control motors and get sensor input with a USB connection, because the LEGO software does so. It has that remote control feature that allows user to activate motors from the PC, and can read sensor input as well.
So, my question is, How can I send and recieve those direct commands via USB? and, Is there any way to do so in Visual Basic 2008?
You can use the MonoBrick Communication Library to do this. See http://www.monobrick.dk/software/monobrick/.
Alternately, you could use the Fantom driver from the official LEGO Software developer kit. http://www.lego.com/en-us/mindstorms/downloads/software/nxt-sdk/