l1va / gofins

gofins is fins client written by Go to communicate with omron PLC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problems with connection

RoboIlya opened this issue · comments

Hi!
Firstly, thank you very much for your work! It is really helpfull for me! However, I have some difficulties with connection and reading/writing data from/to my PLC.
I am not very experienced with omron PLC and protocols. Only was working via SysMac and now want to connect from PC with help of Go to do process faster and more flexible. My PLC model is NX102-1120 that as I know have a so close configs with NJ-series PLC. I read several manuals about settings up PLC for working via FINS and cannot understand what I do wrong.
Thank you for your time and answer!

Best regards,
Ilya

PLC settings:
MemAr

IpAdressPLC

PC setting:
IpAdressPC

Code:
VSCode_client plc

Hi, Ilya!
i'm not so experienced too and it was two years ago. For me, your code seems ok. I can suggest to check ports in the PLC settings once again.
image

What error do you have or any more specific information?

Thank you for your answer, Mike!

Well, as I understood I am getting problem while calling ReadWords func in main.
In ReadWords function we are calling sendCommand function:
ReadWords

In sendCommand function returning &resp that <-c.resp[header.serviceID]
I checked resp details and found that endCode is 4100... okay:
sendCommand

After that in ReadWords func we are calling checkResponse func where I am getting trouble with endCode of resp (here is r.endCode) because it is not equal 0 (that is EndCodeNormalCompletion):
checkResponse
console

Finally I have this error:
image

Best regards!)

Tried to find differences:
https://www.edata.omron.com.au/eData/NX/W596-E1-01.pdf
https://assets.omron.com/m/7b1f867d19635636/original/Sysmac-NJ-FINS-Technical-Guide.pdf
but not so successfully for now.
Seems that the connection is working, but there are some differences in the protocol (between NJ and NX).

Well, okay than, if I find what problem is than I will write solution here.
Thank you, Mike, for you help and lib for connection!)

Good,
Thank you too)