PLCHome / node-red-contrib-ads

Beckhoff TwinCat ADS support for Node-Red.
MIT License
15 stars 11 forks source link

connecting error #28

Closed HEALproject closed 4 years ago

HEALproject commented 4 years ago

Dear PLCHome,

I'm having some problems when using node red to connect to my PLC with contib ads. I hope you can help me.

The goal of the system is to read a %MX memory bit with the raspberry. I am using a BEckhoff PLC and twincat 2. When trying to connect node red to the plc with the "ADS sytem" node, I encounter the following error: "Error on connect: check target NetId or routing"

This is my setup:

setup4

(version info below)

These are the steps I have made so far:

  1. created a new file in TwinCAT System Manager --> choose target --> selected my PLC --> changed netid to 192.168.3.37.1.1

  2. created a simple program in TwinCAT PLC control, with two %MX global variables and downloaded it to the PLC program

  3. added the I/O devices. I have no Input and Output cards, just the processor. --> see image IO devices

  4. appended the PLC project to the PLC configuration

  5. under I/O devices I set the route and ADS settings. Since there are 3 devices and I didn't know which one is the right one, I turned them all on. ads server enable route

  6. on the raspberry I created a node-red flow node-red nodes

settings ADS connection ads connection

So somehow I am not able to connect to the PLC. I followed your instructions and I also used the Beckhoff manual, but I can't get it done. hope you can help me and if you need more information or if it is not clear, please let me know.

Thank you very much in advance!

Kind regards, Stijn

Version info

node-red-contrib-ads version: 1.1.22 nodered version: v1.0.3 on which operating system is the Node-RED running: Raspian 10 (buster) on which hardware system is the Nodered running: Raspberry PLC type: Beckhoff PLC CX9001-0001 Twincat version of the PLC: v2.10 (build 1342) Twincat version of the development environment: v2.11 (build 2305)

PLCHome commented 4 years ago

That's an issue! Nice thank you!

grafik But sorry, this is the wrong place to enter the Netid. At this point you can link the process images.

Node-ads needs an ads route. Please try to undo this. And try to create the link here: pic1 pic2 pic3 pic4

PLCHome commented 4 years ago

Please close the ticket if it works. Or feel free to ask further.

HEALproject commented 4 years ago

Thank you very much for your quick response, now it works. The ADS System node is working.

Now I am trying to read data from the PLC using the ADS in node, but I do not know how to call the variables. I added some globals variabels which I am trying to read. vars

PLCHome commented 4 years ago

TwinCat refuses to write or read on some variables via ads. Global variables must start with a "."
.led1 .led2 .led3

Maybe you start with a new variable. .Test

Experiments with an out and a notification. However, a program must run on the PLC. You can also easily access a program variable.

Program.Test

I can also recommend the UI from readme.md

Tiltix7 commented 4 years ago

Hey PLCHome,

I'm also having some trouble connecting to node red.

My configuration is as follows: PLC: I'm using twincat 3 (version 3.1 4024.4) and a beckhoff CX5120. Node-red: latest version running in docker for windows on a PC. Ip-address = 192.168.10.20

I'm unable to create a static route from the PLC to node-red.

this is my configuration in Node-red image

When I want to create a static route I need to enter a username and password. What do I enter here? image

Do I need to install twincat on the PC where node-red is running in a docker so I can make a route or am I missing something?

thank you very much in advance.

PLCHome commented 4 years ago

It is the Windows administration user and his password on the CX. When shipped from the factory, if you have not changed it, it is:

Default User : Administrator Default Passwort : 1

Any other administrator is also possible, the rights are important, main users do not work.

It makes no difference whether node red runs in Docker or directly on the computer. If there is still a Twincat installation on the PC, there will be connection problems.

Tiltix7 commented 4 years ago

Thank you for the quick response.

I updated the runtime on my PLC and the error dissapeared. Was running twincat 3 (version 3.1 4024.4).