News:

  • July 04, 2026, 01:54:39 AM

Login with username, password and session length

Author Topic: Modbus/TCP to Cognex Insight  (Read 102460 times)

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Modbus/TCP to Cognex Insight
« Reply #45 on: September 08, 2015, 09:41:26 PM »
so I can smear 6 ladder views across my 3 x 22" desktop.

Only 22"?  You're slipping behind the curve Bobo. Earlier this year, I was at a customer site for a few weeks and the only desk available was in the finance department. Some of those people had twin monitors and they had to have been at least 30+ and with sharp detail.  Ah man, they could really fly across those spread sheets! :o  No wonder the poor guy in maintenance can't get a decent laptop.

Yeah...cause anything bigger doesn't fit 3-wide on my desk.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3833
    • Host Engineering
Re: Modbus/TCP to Cognex Insight
« Reply #46 on: September 08, 2015, 09:43:34 PM »
Including drag-n-drop?
Not within existing instructions, but with the new Instruction Toolbox.  Drag-n-drop new instructions from the toolbox onto any of your Ladder Views, anywhere you want the contact/coil/box.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3619
  • Darth Ladder
Re: Modbus/TCP to Cognex Insight
« Reply #47 on: September 08, 2015, 10:50:08 PM »
Ah OK, thanks.  Don't really need it with the toolbox, was thinking of dragging already-addressed contacts, coils and so on.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3619
  • Darth Ladder
Re: Modbus/TCP to Cognex Insight
« Reply #48 on: September 09, 2015, 12:58:09 PM »
Alright, so back on the original topic:

Do-More(s):        check!
Mirroring Switch:  check!
Wireshark:         check!
Cognex camera:     local rep promised a loaner, should be here today

While I have those same items all hooked up, I'll see if I can get E/IP working with the camera, since as ATU notes, they are better-behaved on that protocol.  I'll post the results, if interesting or informative.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Modbus/TCP to Cognex Insight
« Reply #49 on: September 09, 2015, 04:19:35 PM »
I'll see if I can get E/IP working with the camera, since as ATU notes, they are better-behaved on that protocol.  I'll post the results, if interesting or informative.

That would be great, then you can tell me how well it does or does not work with the DoMore if I need to do it someday!  Buddy ;)
« Last Edit: September 09, 2015, 04:41:24 PM by ATU »

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3619
  • Darth Ladder
Re: Modbus/TCP to Cognex Insight
« Reply #50 on: September 09, 2015, 05:49:35 PM »
There's no magic to Modbus. I'm guessing there is some address confusion somewhere. A Wireshark trace will easily resolve it, and we are happy to help if you can send us a trace where it is working.

You nailed it, Kemosabe!

Do-More operates in [4]xxxx mode, so if you enter a "1", the frame gets 0x0000.  Cognex reads have to start from register 30010 (frame: 0x753a), so you have to put 30011 in the MRX.  The Cognex was returning "invalid address", but for some reason I didn't see it in the register I was using for exception responses.  Maybe getting overwritten by something else.  Likewise with the writes.  They say "50000" meaning [4]50000, so you have to enter 50001 in the MWX.

Easy-peasy once you're looking at a Wireshark trace, just like you predicted.  Another interesting factoid:   The newer cameras that are dual processor (5470's and 8450's IIRC) have some issue with Modbus, so it's not supported at the moment.  Hopefully they'll get it ironed out, but you guys may have added EIP just in the nick of time, Cognex-wise.

Now onto seeing if I can get E/IP to work!
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Modbus/TCP to Cognex Insight
« Reply #51 on: September 09, 2015, 05:57:37 PM »
There's no magic to Modbus. I'm guessing there is some address confusion somewhere. A Wireshark trace will easily resolve it, and we are happy to help if you can send us a trace where it is working.

You nailed it, Kemosabe!

Do-More operates in [4]xxxx mode, so if you enter a "1", the frame gets 0x0000.  Cognex reads have to start from register 30010 (frame: 0x753a), so you have to put 30011 in the MRX.  The Cognex was returning "invalid address", but for some reason I didn't see it in the register I was using for exception responses.  Maybe getting overwritten by something else.  Likewise with the writes.  They say "50000" meaning [4]50000, so you have to enter 50001 in the MWX.

Easy-peasy once you're looking at a Wireshark trace, just like you predicted.  Another interesting factoid:   The newer cameras that are dual processor (5470's and 8450's IIRC) have some issue with Modbus, so it's not supported at the moment.  Hopefully they'll get it ironed out, but you guys may have added EIP just in the nick of time, Cognex-wise.

Now onto seeing if I can get E/IP to work!


Most common Modbus/TCP issue. Everybody has a slightly different way of describing the same thing. Once you understand how a particular device wants to see it, it is always easy.

Not sure about the exception response. We also stuff the exception response into $LastProtoError (DST38) on the rising edge of the error result. If you think there might be an issue, please let me know. We are days from 1.4.2...
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3619
  • Darth Ladder
Re: Modbus/TCP to Cognex Insight
« Reply #52 on: September 09, 2015, 06:06:36 PM »
Most common Modbus/TCP issue. Everybody has a slightly different way of describing the same thing. Once you understand how a particular device wants to see it, it is always easy.

Yup!   :)

Quote
Not sure about the exception response. We also stuff the exception response into $LastProtoError (DST38) on the rising edge of the error result. If you think there might be an issue, please let me know. We are days from 1.4.2..

No reason to believe there's an issue.  I was using a PLC that had a program in it that I didn't want to delete, and too lazy to upload/clear/test/redownload, so I just slammed an MWX and an MRX in at the beginning of the program.  Prolly something somewhere else in the program using it.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3619
  • Darth Ladder
Re: Modbus/TCP to Cognex Insight
« Reply #53 on: September 10, 2015, 06:55:26 PM »
Works good in E/IP too!  See attached DM program, Cognex job file (for an IS7402), and the help file for the E/IP Object Model.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Modbus/TCP to Cognex Insight
« Reply #54 on: September 10, 2015, 07:29:42 PM »
Glad to hear. We've heard precisely zero about Do-more's EIP prior to this. How was the experience?
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3619
  • Darth Ladder
Re: Modbus/TCP to Cognex Insight
« Reply #55 on: September 10, 2015, 07:45:37 PM »
Not bad at all.  I found Cognex's Object Model docs a little ambiguous, like for example, 0x78/1/16 looks like "InspectionResults / STRUCT of" is on the same hierarchical level as the items below it, but I think it's actually an overall description of 78/1/16, because the user values begin at the third register.  Should probably indent InspectionID, Reserved, and InspectionResults, so you can see they're subelements.

That was about the worst of it, though, just simple dumb stuff like that.  The Do-More end was cake!   :)  Thanks!
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3833
    • Host Engineering
Re: Modbus/TCP to Cognex Insight
« Reply #56 on: September 10, 2015, 08:15:35 PM »

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Modbus/TCP to Cognex Insight
« Reply #57 on: September 10, 2015, 09:01:06 PM »
The Do-More end was cake!

And that's the part we like to hear.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO