How to inject a payload using a PLC

Hello,

I would like to inject a payload to put it on the queue DL of my Conduit Multitech using my PLC (that PLC is working with TCP)

Now I am injecting those payloads using timestamps in NodeRed or using external platforms via MQTT but I would like to use my PLC to do that.

Could you give me some clue about how to do that?

Thank you very much in advance.

Best Regards

Can the PLC initiate Comms in some way? If so what can it do?

Hi Colin,

Yes, can be extended with communication interfaces (PROFIBUS slave, PROFINET device)

Small control systems with I/O modules which can be connected in series and integrated master interfaces for Ethecat and canopen

I am not exactly sure what exactly you are asking. What did you mean when you said "that PLC is working with TCP".

Are you able to communicate with the PLC from node-red?
You mentioned MQTT, is the PLC able to publish to an MQTT server?

Hi Colin,

Sorry if I didn't explain myself well.

I am using a Conduit Multitech to create a LoRa net and control some devices.

The Conduit has internally the NodeRed and I am using it in order to send payloads to the Conduit and those payloads are saved in the downlink queue.

Now I am sending that payloads in two different ways:

  • Injecting timestamps from the NodeRed interface (just pressing the timestamp button) and, as a consequence, activating the function I want.
  • Through an external interface connected to the NodeRed via MQTT which also activate those functions.

What I want to do is to send that payloads (just to activate the function I am activating now through the timestampt button or the external interface) but using my PLC instead.

Then my question is what blocks/commands I should use in order to recognize from NodeRed that I'm sending that payloads from the PLC (it has the protocols I told you in the previous message)

Thank you very much for your responses,

Best Regards

So to summarise, is your question how can I communicate with my PLC from node-red?

Yes, that is my question.

You said it can do profibus, ethecat and canopen. I don't know much about any of those and can't see any relevant nodes on flows.nodered.org.

Do you currently have any communication between the device running node-red and the PLC?

Do you have to pass data between node-red and the PLC or just trigger an action? If just a trigger then presumably you could use an output on the PLC connected to a digital input that node-red can read.

I was not able to do any communication between the lora concentrator running node-red and the plc.

I could do both but I would prefer do just a trigger.

The device running the nodered has not any digital input.
Do you mean connecting something between the PLC and the concentrator?

The device has an E-net port. I tried to communicate with the Nodered from that port but I couldn't set the correct IP's

I meant any way that node-red can see a digital input that could be triggered by the PLC. If the node-red device can see digital inputs on the concentrator then you could do it that way.

I presume by E-net you mean ethernet, What protocols or services does it support on that interface?
Why could you not set the correct IP?

Yes, Ethernet. It supports RS-232 and RS-485. I was trying differents configurations that NodeRed allows me with TCP and UDP and I couldn't make it work.

Hi @AlxOndahidr, what is the manufacturer and model of your PLC device ?

PLC: http://www.lenze.com/en-es/products/controls/controller-c300/
Touchscreen used as an interface: https://www.weintek.com/Download/MT8000iE/eng/Datasheet/MT8071iE1_DataSheet_ENG.pdf

But if you are experienced with this and you've used another equipment we are open to try another options

Thank you very much

Best Regards

In the Software Manual (pdf) look at point 5.5.2 setting the IP Address.

Screenshot%20at%202018-08-09%2017-52-56

@AlxOndahidr, do you have an OPC server in place ? There is a set of Node-RED nodes specifically for communicating with OPC UA server. See this article as a reference : http://developers.sensetecnic.com/article/tutorial-using-opc-ua-with-fred/

Thank you for your responses. @ghayne @Andrei

I saw some tutorials about people using sensors connected to a PLC (simmilar than the one I have) to send payloads through NodeRed, but they are using Modbus Blocks in NodeRed, as I am running the NodeRed from the concentrator and I cannot download it because is a bit limited.

About the OPC server, I don't have it... but isn't needed a computer for that?
The think is that I am not going to use any computer in the aplication, just the Interface->PLC->LoRa concentrator with NodeRed.

I am a bit lost with this... another solution I am going to try is to use an Arduino with two modules: one with an RS-232 connection to send the data from my PLC to the Arduino and a LoRa module to send that data directly to the concentrator... otherwise I have no idea how to do it.

Does node red have access to any digital inputs via the LoRa network?

Nope, that is why I am thinking to use an Arduino with a LoRawan module

Why can't you connect to the PLC using ethernet?

I connected the PLC to the concentrator via Ethernet and I tried using the TCP/UDP blocks that NodeRed has internally but I couldn't communicate between them.