Jump to content

Samba Memory Long Register Index for MODBUS

Recommended Posts


I've successfully connected a small network of Samba HMI/PLCs, and have had my computer running a program to pull data through MODBUS TCP (computer is master, all Samba units are slaves). I can successfully pull data from any of the 256 MIs as their indexing starts at 0 in regards to function code 3: read holding registers. However, I need to pull data from one of the memory long values. I could copy the data into two MIs (as suggested on another forum post), but I would prefer not to in order to limit register use for future changes to my ladder logic. The help files list the starting pointer value for MLs as 5100 in Standard Vision products, but I could not successfully pull data using this as a starting address in my MODBUS commands. I have tried finding documentation regarding this question, but I may be searching in the wrong place. If anyone knows the starting index for memory long values in Samba units, I would greatly appreciate that information.





Link to comment
Share on other sites

  • MVP 2023

Sambas are Enhanced Visions.

I don't know why they complicate things with hex, but Flex is correct:


Don't forget everything is 32 bits long in this region, but the address pointers are 16 bit.  The variables in your computer program must also be long integers.  Modbus is at its core a 16 bit protocol so reading a long you specify a length of 2 for the Read command for each ML you want.  To read 2 MLs you need to specify a length of 4.

ML 0 is at 28,672.  ML 1 is at 28,674.  And so on.

If you open the built-in Calculator app in Windows the menu in the upper left corner allows you to select "Programmer" mode.  It's a very handy tool for crossing hex values to decimal.

Joe T.

Link to comment
Share on other sites

Thank-you for the replies! I can now read the correct values from the MLs, but only if I query using a start address of 28672. The ML I'm attempting to read from is ML 3, which I would suppose would start at 28678. As a random test value, I set ML 3 = 73333. If I send a MODBUS query for registers starting address 28672 and length 10 (00 03 00 00 00 06 80 03 70 00 00 0a), I receive a response indicating register 28678 = 1e 75, and 28679 = 00 01, meaning that ML 3 = 00 01 1e 75 = 73333. I'm using both WireShark (which recognizes MODBUS commands/replies) and my own C# program to interpret the slave response. This matches what I expected. However, if I send a MODBUS query for registers starting at address 28678 and length 2 (00 03 00 00 00 06 80 03 70 06 00 02), I receive a response indicating registers 28678 and 28679 are zero (ML 3 = 0). I can simply parse the data as necessary, but I wonder why this occurs.


Again, thank-you!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...