Jump to content

Struct Command only Partially Working


Recommended Posts

Sorry for the delayed response on this. I have been out on leave for the last few months. I have attached my programs. It is a multi-controller set up. Node 10 is the main HMI in our Control room and Node 11 communicates with it and with 12 and 13 all of which are located in a different location and communicate via fiber and TCP/IP back to 10. Our encoders all talk over unican. I am not having issues with 11 and 13, my problem lies with PLC 12. For some reason my commands are not transferring all the information back to nodes 11 and 10. I have attached all four of my programs for your review.

 

I have a program that is sending information from slave to master and vise versa. This program was written for me and I do not completely understand all the communications aspects of it but my problem I believe lies with a struct command on the Master. I have a struct collect command collecting information from mixed data locations to vector. I am collecting data from three locations, ML20- Length 5, MB150-length 16, and ML 160-lenth 6. The struct extract command in the ladder of the slave is extracting the data correctly for everything but the ML 160's. For some reason the ML160 data will not transfer to the slave. Does anyone have any ideas what issue could be and how I can fix this?

Thank you so much for your help on this!

Newest_USACE_10_9v4 3.21.2018 Set Node Lake Levels.vlp

Newest_USACE_11_9v4 3.21.2018 Set Node Lake Levels.vlp

Newest_USACE_13_9v4 3.21.2018 Set Node Lake Levels.vlp

USACE_12_9v4 3.21.2018 Set Node Lake Levels.vlp

Edited by Lacey
more information and attached files
Link to comment
Share on other sites

The extract Struct is set up exactly the same and I'm not sure about the first question. As for communications we are using TCP/IP we have a V1210 Connected with three V130-33-R4's. I'm sorry I am new to this forum, to what code are you referring?

Thank you for helping.

Link to comment
Share on other sites

  • MVP 2023
54 minutes ago, Lacey said:

As for communications we are using TCP/IP

MODBUS TCP/IP?

54 minutes ago, Lacey said:

I am new to this forum, to what code are you referring?

Code is the software you're running in the PLC (screenshots of the relevant ladder logic or best would be posting the .vlp file)

56 minutes ago, Lacey said:

I'm not sure about the first question

There is a vector length associated with the data exchange with the slave. That vector length in your case should be 23 MIs (each MI is 2 bytes).

Link to comment
Share on other sites

  • MVP 2023

Perhaps relevant, perhaps not.  I only use structs under Unican.

I am particularly careful implementing structs as it is very easy to get confused with source and destination addresses.  The method I always use is to take a screenshot of the source struct, and very carefully compare it to the ladderwork at the receive end.  If you have anything at all out of whack it won't work.....the "sequence" must be exactly the same.

Also, Flex, is there a max MI limit using structs under Modbus TCP/IP, like under Unican?  Perhaps this is the issue?

cheers,

Aus

Link to comment
Share on other sites

  • MVP 2023

Thanks Flex, noted.

Lacey...forgot to say that it is also very easy to make the mistake of having your Struct Extract write unintentionally into vectors or single elements that are in use elsewhere in your program.  This then looks like the struct hasn't been extracted properly, but it is just the normal program doing it's thing.  This is also one of the reasons I do the screenshot bit, to ensure that I have sufficient vector lengths that aren't "actively" used elsewhere and are just a "temporary storage area", or that I am definitely writing the vector or single element to a used destination that I know is correct.

cheers,

Aus

Link to comment
Share on other sites

  • MVP 2023
On 3/23/2018 at 7:47 AM, Flex727 said:

I believe you can transmit a maximum 200 registers with a single MODBUS command.

No.  The official Modbus specification is 125 registers per transfer.

Lacey - you still need to upload your .vlp files for us to be more effective in helping- this is a rather complex problem and very hard to describe in the verbose method of a forum post. 

Otherwise we're just guessing at what you've done.

Joe T.

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.

Guest
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...