News:

  • June 09, 2026, 07:15:49 AM

Login with username, password and session length

Author Topic: Too Many Choices  (Read 41472 times)

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Too Many Choices
« on: July 08, 2010, 06:27:31 AM »
I have a ECOM100 (DL260) using modbus to a bridge which will convert to EthernetIP. What do I use to communicate from the DL260 to the bridge. I see ECOM100 CONFIG, NETWORK CONFIG, NETRX, NETWX, ETC. Some ask for slave ID, Port Number. I was going to use MRX but that looks like serial, I want tcp/ip. The help file is not that great. Sorry to who wrote that. Can't it be made simple with less choices. One choice for serial and one for tcp/ip?  :)

Greg

  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 702
  • Hmmm...
    • Host Engineering, Inc.
Re: Too Many Choices
« Reply #1 on: July 09, 2010, 04:42:10 PM »
To use:
1. Use NetEdit to make a Peer-to-Peer Configuration for Modbus TCP in the ECOM100. Chose Device number (doesn't matter what number except it will be used in a step below this one).
2. Put ECOM100 IBox at the top of your ladders.
3. Use ECRX to read, ECWX to write.
4. The ECRX/ECWX parameter Slave ID must match the Peer-to-Peer Configuration's Device number you chose above.
5. The Addressing you choose for writing to and reading from Modbus TCP registers must use a mapping designation as shown in this document (http://www.hosteng.com/FAQFiles/ECOM100%20Server%20Client%20Mapping.pdf).
There are two types of people in the world; those that can extrapolate from incomplete data sets.

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: Too Many Choices
« Reply #2 on: July 10, 2010, 06:26:03 AM »
For now I am sticking with the old way. I used the sp136 sp137 with LD K701, LD K20, LDA O40620 WX V0. With that I can actually see if it is working using counters tied to SP136 Sp137. With The Iboxes I can only look at the lights on the port and I do not see any activity when using the iboxes. The succeed fail bits do nothing in the ibox. Sometimes the old ways work better. Using the ladder method has always worked for me. Oh I did set switch 7 but still not work.

Greg

  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 702
  • Hmmm...
    • Host Engineering, Inc.
Re: Too Many Choices
« Reply #3 on: July 12, 2010, 10:59:10 AM »
I won't argue with you, but I will say that the IBox is just a ladder macro. Inside the IBox is the LD, LD, LDA, WX instructions plus some very nice you-can't-get-this-wrong logic to supply you with Success and Error. If these bits are not coming on, then there is something set wrong somewhere because, IMHO, IBoxes make everything MUCH easier.

I assume you are wanting to write C-bits (C400 thru C637) to Holding Register (offset 0) using FC16. I also assume your H2-ECOM100 is in Slot 7 and you have a Peer-to-peer configuration in the H2-ECOM100 to do Modbus TCP for Device ID = 1. With all this in mind, the params for the IBoxes would be something like:

ECOM100 IBox
ECOM100# = K0 (anything you want, just has to match parameter below)
Slot = K7
Status = V400 (anything you want, just no overlapping)
Workspace = V401 (anything you want, just no overlapping)
Msg Buffer (65 WORDs) = V402-V502

ECWX IBox
ECOM100# = K0 (must match the one above)
Workspace = V503 (anything you want, just no overlapping)
Slave ID = K1 (this must match the Device # you configured in the Modbus TCP peer-to-peer Device #)
From Master Element (Src) = VC400 (i.e. V40620)
Number Of Bytes = K20
To Slave Element (Dest) = TA0 (i.e. V0)
Success = C0 (anything you want)
Error = C1 (anything you want)

Now this is equivalent to your ladder logic. And you can count C0s and C1s for successes and errors. If these never come ON, then most likely you have some overlap in the params, or the IBox is not getting executed, or it is in a Stage and left hanging, or it is in the process of timing out.
There are two types of people in the world; those that can extrapolate from incomplete data sets.

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: Too Many Choices
« Reply #4 on: July 12, 2010, 12:25:19 PM »
Greg I wonder if the problem is the slave#. In the peer-to-peer it is Device ID= 0 not 1. Is this wrong? I haven't had a chance to try changing it. The ladder is working fine, but I hate to give up on something that i know should work. It will just bother me.

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: Too Many Choices
« Reply #5 on: July 12, 2010, 01:08:56 PM »
Okay Greg explain this one. I found the problem. I had the counters counting success/errors before the iboxes. Once I moved them after the ibox rungs, all was good. So do ALL iboxes have to be at the beginning? And it did not matter if Device ID was 0 or 1.

Greg

  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 702
  • Hmmm...
    • Host Engineering, Inc.
Re: Too Many Choices
« Reply #6 on: July 12, 2010, 03:36:26 PM »
Greg I wonder if the problem is the slave#. In the peer-to-peer it is Device ID= 0 not 1. Is this wrong? I haven't had a chance to try changing it. The ladder is working fine, but I hate to give up on something that i know should work. It will just bother me.

As I pointed out in my post, the Device # of the peer-to-peer config must match the Slave # of the ECWX IBox; doesn't matter what it is.

Okay Greg explain this one. I found the problem. I had the counters counting success/errors before the iboxes. Once I moved them after the ibox rungs, all was good. So do ALL iboxes have to be at the beginning? And it did not matter if Device ID was 0 or 1.

No, all IBoxes do not have to be at the beginning. The ECOM100 IBox needs to be at the top of the scan, but the ECWX can be anywhere you like. It matters what the Device ID is if it doesn't match the configuration of the peer-to-peer. In order to explain what is happening, I would have to see your program. For instance, sometimes, an experienced user will mix and match the "old" way with the IBoxes, like still use the SP bits to trigger the IBox.
There are two types of people in the world; those that can extrapolate from incomplete data sets.

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: Too Many Choices
« Reply #7 on: July 12, 2010, 05:33:39 PM »
I created a ECOM Stage. The first rung had the succeed bit tied to a counter. The 2nd rung has the error bit tied to another counter. The 3rd rung was the ECOM100 Ibox. The 4th rung was the ECWX Ibox. There was no action on the succeed or error bits. I removed all previous ecom rungs I was previous using. So I first deleted the counter rungs and it started to work. I put them back and nothing worked again. Finally I moved the counters to the end of the stage after the iboxes and everything worked. At first I thought the counters at the beginning were not working because maybe at the end of the scan they were not being read so I went to the RJ45 jack and saw no activity. Also in data view the bits were off. But everything is good with the bits and counters after the Iboxes. Darn now I forgot the other thing I tried, I think I took the counters and put them in another stage that was always on and everything worked. It was only when I put the status bits and counters in the same stage before the iboxes, nothing worked. How clear is all of this? Before you ask, yes I did a search on every counter and bit to make sure they were not used anywhere else.

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Too Many Choices
« Reply #8 on: July 12, 2010, 06:01:13 PM »
Quote
The 3rd rung was the ECOM100 Ibox. The 4th rung was the ECWX Ibox

Did these rungs have any sort of conditioning bits other than SP1 (Always On)?
An output is a PLC's way of getting its inputs to change.

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: Too Many Choices
« Reply #9 on: July 13, 2010, 08:37:46 AM »
I do not have any bits on the ibox rings. I noticed some boxes require sp1 bit to compile and some do not.

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Too Many Choices
« Reply #10 on: July 13, 2010, 10:17:07 AM »
When you had the two counter rungs before the IBox did you use an SP1 in the rung going to the IBox to get it to compile as a seperate rung?
An output is a PLC's way of getting its inputs to change.

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: Too Many Choices
« Reply #11 on: July 13, 2010, 12:24:22 PM »
Nope. So I have the ECOM100 on a rung. It will not allow the sp1 bit on the rung. I put the sp1 bit on the ECWX and on the rung for ECRX. That fixed the problem where the success/error counters could be placed. This seems to relate to greg's original comment about the stage hanging up. By putting the sp1 bit on the rung what does that do to make it work right. If needed, why does it let u compile with no error. The ECOM100 box pops up a reminder window about switch 7 on the ecom card being set. Do other Iboxes need the same type pop up box for reminders or hints?

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Too Many Choices
« Reply #12 on: July 13, 2010, 12:39:35 PM »
I wasn't thinking about the ECOM100 command. But the other ones, if placed after a conditioned rung without a condition of its own compiles into he previous rung. This enforces what actually happens when executing in the DL world. It doesn't know 'end of rung' or 'start of rung'. If you have a previous rung in ladder or an individual stage then this rung inherits the 'truth' which had been determined at the 'end' of the previous rung. It actually runs as if a continuation of the previous rung which is why Directsoft redraws it that way.

So if it had redrawn as a single rung then the ECWX or ECRX would only execute if the conditions were true.

[Corrections - my computer is a terrible speller.]

As a note, as I understand it, the STRx instructions effectively begin a new rung by pushing the previous rungs 'truth state' on to the binary stack ans start with their own 'true' state. Which is why the STR SP1 serves the purpose.
« Last Edit: July 13, 2010, 03:58:43 PM by b_carlton »
An output is a PLC's way of getting its inputs to change.

Greg

  • HostTech
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 702
  • Hmmm...
    • Host Engineering, Inc.
Re: Too Many Choices
« Reply #13 on: July 13, 2010, 03:06:50 PM »
...what b_carlton said...

Plus, normally the ECOM100 IBox should not be in a Stage, unless that stage is never disabled; it needs to execute every scan. Also, if you execute ECRX/ECWX in a Stage, make sure you do not disable the stage without first getting a Success or Error bit.
There are two types of people in the world; those that can extrapolate from incomplete data sets.

PLCGuy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 677
Re: Too Many Choices
« Reply #14 on: July 13, 2010, 10:11:36 PM »
It is in a stage that is always on and never goes off. So in understanding what is being said, I did need the sp1 on the ECRX and ECWX rungs? But why did they compile without error? If there was an error when it tried to compile I would have found the problem much more easily. It sounds like the ECRX ECWX need to have a bit of some sort on their rung. When I try to add a bit on a rung that the Ibox does not need, such as ECOM100,an error pops up saying I can not do that. The reverse should happen, if the bit is needed a message should also pop up.