Welcome, Guest
Username: Password: Remember me

TOPIC: Modbus TCP problems [solved]

Re:Modbus TCP problems 14 years 3 months ago #583

  • canelon
  • canelon's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 84
  • Karma: 0
Hello,

Thanks for your help, i was able to get the value of the addresses i needed by decreasing by one the memory address i actually wanted to read; this directs me to another question, on my first example the data to read was expressed by the type unit32 following the big endians order; now i need to read another memory block which is of type float32, how do i get to do this conversion?; second, i will also need to read certain memory address which hold values expressed in the order of swapped floats, how do i change the bit ordering on the packet?. Thanks in advance
The administrator has disabled public write access.

Re:Modbus TCP problems 14 years 3 months ago #584

  • robert
  • robert's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 178
  • Karma: 7
Hi Canelon,

I'm sorry for the error with adress-assignment, this is a bug actually and will be fixed. One problem is though that the documentation for different modbus-devices sometimes describes there addresses in a wrong way.

There is currently no handling of floats in the implementation. It reads all 2 byte registers as if they are 16 bit integers with big endian representation (according to the standard). Currently you will have to mainpulate the data yourself to treat registers as a 32 bit float. I guess the easiest way is to receive float-32 values as one ChanIi with UInt32-representation and pass this via a transferfunction to a float-value. One has to make sure what type of float-representation is used.

On some modbus-devices I have seen values can be read as both floats and integers but on different adresses.

I'm sorry this was not so much of a help for you.

/Robert
The administrator has disabled public write access.

Re:Modbus TCP problems 14 years 3 months ago #587

  • canelon
  • canelon's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 84
  • Karma: 0
Hello

Thanks again for your help. i am going to try with a transferfunction; now, i have another question, what is the best way to apply one, through application programming? or is there some kind of function editor within the proview framework?
The administrator has disabled public write access.

Re:Modbus TCP problems 14 years 3 months ago #588

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3180
  • Thank you received: 502
  • Karma: 133
Hi Canelon,

The easiest way is to use a CArithm to call your transfer function. This is described in Designer's Guide, chapter 'Call Functions from the Plc program'.

It is also possible to build a function object, see the ClassEditor chapter.

/Claes
The administrator has disabled public write access.

Re:Modbus TCP problems 14 years 3 months ago #589

  • canelon
  • canelon's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 84
  • Karma: 0
Hello,

Regarding the chapter Call functions from the plc program in the designer's guide; on this chapter you describe the structure of the makefile for compiling my function, this file calls $pwrp_inc , $pwrp_exe and $pwrp_obj , now, my question is, this sample makefile refers to the directories created on the installation of proview or to the directories within my project; if it refers to the directories within my project, where do i get $pwrp_exe/pwrp_rules.mk. I tried to compile a makefile placing it on the directory /usr/pwr46/os_linx/hw_86/exp/src (which is the directory where the env variable $pwrp_src points) but I get an error during compilation that says that there was no rule to construct the target /pwrp/common/inc/ra_plc_user.h
The administrator has disabled public write access.

Re:Modbus TCP problems 14 years 3 months ago #590

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3180
  • Thank you received: 502
  • Karma: 133
Hi Canelon,

You should include the rules file from $pwr_exe, not $pwrp_exe.

/Claes
The administrator has disabled public write access.
Time to create page: 8.336 seconds