Welcome, Guest
Username: Password: Remember me

TOPIC: Proview youtube channel for beginners

Proview youtube channel for beginners 6 years 1 month ago #9622

  • brunad
  • brunad's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 247
  • Thank you received: 48
  • Karma: 11
follow this link (because it's in french" :) ) --> www.proview.se/v3/index.php/forum/11-fre...ssage-de-modbus#9621
/Bruno
The administrator has disabled public write access.

Proview youtube channel for beginners 6 years 1 month ago #9623

  • benoit
  • benoit's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 180
  • Thank you received: 1
  • Karma: 0
Hi Claes,
In addition to previous messages, we would need some clarifications about Modbus addressing process.
I have investigate the documentation and the forum, but I still need some additional informations.

1# About "number" attribute for Channel objects.
If I use the function code 03 (referring to 4x table) and if I want to read over 16 contiguous bits...
Must I have set the number attributes like 0, 1, 2,...15, 16, 17,... or 0, 1, 2,...15, 0, 1,... ?
I suppose the ChanDi representation is set to Bit16, isn't it?

I have read in some topic your comment:
"..., a channel with Number 0 indicates that this and the following channels belongs to
the next byte in the message."

See my examples : FC03_1.pdf and FC03_2.pdf ..... what is the correct explanation?

2# If I use FC02...
Now if I use a function code 02, is it the same process for "number" attributes? but in this case, I suppose the representation is set to Bit8, isn't it?

See my examples : FC02_1.pdf and FC02_2.pdf ...... what is the correct explanation?

3# I realized a summary document on the function codes ... I hope I did not make a mistake ... it would be nice if you can check it (see Proview_FC.pdf).

Thanks a lot for yours advices. :)
/Ben
Attachments:
The administrator has disabled public write access.

Proview youtube channel for beginners 6 years 1 month ago #9628

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

It is not the Number attribute that defines the address for each channel under a Modbus module object, it's the order and the representation for the preceding channels. So by setting a representation in a channel you allocate a space in the message and the next channel will be placed after this space.

For digital channels the Number is used to point out the bit number within the allocated space. If you set representation Bit8, there can be 8 channels numbered from 0 to 7. If you set Bit16 there can be 16 channels numbered from 0 to 15. For each channel with number 0, new space is allocated with the size defined by the representation. Number 0 should always be present but for the other channels you only have to create the channels for the bits that you actually use.

So for FC03 the second is correct regarding the digital channels, for the analog the number is not used.
For FC02 the numbering should restart after 7 as you use Bit8, so none is correct.

In Proview_FC.pdf I don't understand what you mean with 0x, 1x, 3x and 4x. There is a limitation of the number of coils/registers in one singel FC request, but there is no limitation in the toltal number of coils/registers or their actual address or address space.

/Claes
The administrator has disabled public write access.
The following user(s) said Thank You: benoit

Proview youtube channel for beginners 6 years 1 month ago #9633

  • benoit
  • benoit's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 180
  • Thank you received: 1
  • Karma: 0
Hi Claes,
Thanks a lot for your quick response, now it's more clear for me.
But you said "...for the analog the number is not used"
In this case, how can I affect each ChanAi objects to the corresponding registers of the data table (e.g. with FC03)?

About 0x, 1x, 3x, 4x...
According to the Modbus standard (typical addressing):
coils: from 0x0001 to 0x9999
discret inputs: from 1x0001 to 1x9999
input registers: from 3x0001 to 3x9999
holding registers: from 4x0001 to 4x9999

0x, 1x, 3x, 4x it's for me a simplification (to identify the data table type) but indeed it's not very clear. I corrected my document with the complete address value ;)

Greetings.
/Ben
The administrator has disabled public write access.

Proview youtube channel for beginners 6 years 1 month ago #9634

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

You specify the address for the first ChanAi in the Modbus module object. The following ChanAi will get the consecutive addresses.

Note that the start address in the Modbus module object is a PDU address that starts counting from 0, while the the register address sometimes, as in you example, starts counting from 1. In this case the start address is the register address - 1. Thus if the Modbus module address is 4400, the address for the first ChanAi is 4401, for the second 4402, for the third 4403 etc.

/Claes
The administrator has disabled public write access.

Proview youtube channel for beginners 6 years 1 month ago #9635

  • benoit
  • benoit's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 180
  • Thank you received: 1
  • Karma: 0
Hi Claes,
Thanks for yours explanations.
But, what's about the 'number' attributes of the ChanAi objects?
If I have understand it's not necessary to set this attributes?

For example I have this $node structure:

Modbus_module (FC03, adresse: 1000)
ChanAi1
ChanAi2
ChanAi3
...etc

So, ChanAi1 is '1001', ChanAi2 is '1002', ChanAi3 is '1003',...

But my question is about the 'numbre' attributes?
Must I have to set this like:
ChanAi1 (number: 0)
ChanAi2 (number: 1)
ChanAi3 (number: 2)
...etc

Other case, if I need only to read ChanAi1 (address 1001) and ChanAi20 (address 1019), I have this structure:
Modbus_module (FC03, address 1000)
ChanAi1 (number: ???)
ChanAi20 (number: ???)

In this case, what is the correct values for 'number' attributes?

I am sorry to ask you a lot for this subject but it's a little bit complex ;)
Thanks.
/Ben
The administrator has disabled public write access.
Time to create page: 8.736 seconds