CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Thu Sep 20, 2018 11:57 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue May 29, 2018 10:43 pm 
Offline

Joined: Mon May 21, 2018 10:52 am
Posts: 2
Hello everyone.
I encountered a problem reading the modbus TCP registers in Codesys.

Registers are correctly read in eg. ModbusScanner, but in Codesys I can not read any values.

I am trying to read eg. Input Register offset 100.

Due to this difficulty I can not continue the project, I am asking you for help in configuring Codesys. What to do to read anything over Modbus TCP.

I'm attaching a program file in Codesys and Arduino Uno with Ethernet Shield.


Sample of code for Arduino:

//Modbus Registers Offsets (0-9999)
const int SENSOR_IREG = 100;
//Used Pins
const int sensorPin = A0;

I will be grateful for your help, greetings. !!!


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Mon Jun 04, 2018 3:34 pm 
Offline

Joined: Fri May 18, 2018 4:09 pm
Posts: 1
Hello. I made the same like you but with MODBUS RTU using a max485 chip to convert ttl signals to rs485 standard (plug on pins 0, 1 and 2 on arduino pcb)and the usb port from the raspberry pi. It works very well.
Maybe you have a problem with the number of register to read. I think arduino can't stor on its buffer more than 64 words.
As I told you before, my system with four arduino hanging from a raspberry pi serial port works very well, even if I turn off any arduino pcb it continues working.
BR


Top
   
PostPosted: Tue Jun 19, 2018 9:24 pm 
Offline

Joined: Mon May 21, 2018 10:52 am
Posts: 2
hello juan, thanks for yours advice!

for me, the solution was different.
I used the 28j60 ethernet shield model and there was a problem.

I bought a classic shield Ethernet "Arduino Ethernet shield R3 with micro SD connector"
like this:
https://botland.com.pl/produkty-wycofan ... crosd.html

and the connection worked!

Settings:
for input register code 4
for register 100, enter offset 0x0064 in the channel

The whole works perfectly with raspberry pi 3 B + :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited