Sign in to follow this  
Followers 0
OGS

Communication with Cognex Insight camera

21 posts in this topic

Does anyone have experience with connecting a cognex insight 5110 on Ethernet IP to a CJ2 I have the EDS file installed, I can setup the tags, but I only get an error message in the CJ2 d6, comparison error

Share this post


Link to post
Share on other sites

I have helped a few customers through this configuration. On the Cognex side, you need firmware 4.1 or higher on the Insight. There is an eds file specifically for 4.1. In the included ZIP file is an example that an Omron distributor did for a Cognex to Omron CJ2 connection. View the .ppt file as the slide show, as he overlaps window. Eip.zip

Share this post


Link to post
Share on other sites
Hi, I need to establish a communication between a 7000 insight camera and an Omron CJ2. Basically I just have to change the job file in the camera by reading first a product reference into a barcode. Eventually the camera will tell me by a digital output that something is wrong on the product. The provider of the camera told me that I can't do that with protocols like Ethernet/IP or Modbus/TCP just by writing datas into a polled table. He said that I need to use "native commands" by sending ASCII characters to the camera. So we have done some tests with a small Unitronics plc by sending characters with and UDP connection and it works. But it's really fastidious, we have to open a session into the camera with an username, then a login, then stop the camera, then send the name of the job file and at least run the camera, each time by sending characters and testing the answer of the camera. It's a pain in the booty... Is it really the only solution or is there a possibility to do it more easily by using Ethernet/IP protocol ? I watched your sample program but I didn't see what I want to do. I hope my request is clear enough cause it's not so easy to explain it even in my french mother language so I let you imagine in english JC Edited by acpi

Share this post


Link to post
Share on other sites
Are you trying to change a camera job based on a product type?

Share this post


Link to post
Share on other sites
That's it. The product type should be read in a barcode or manually entered by the operators on a panel as a string field. Then from what I understood, I have to add ".job" to this string and then execute a loadfile native command into the camera with this filename. That's what we did previously using ascii send/receive functions on an Ethernet UDP connection with an Unitronics plc. It works but it's really complicated, as always when you have to deal with raw ascii communications. I've seen today that it's possible to do what I want with a Rockwell plc using explicit messages on an EtherNet/IP network. I guess I can do the same (yes I know I can ) with an Omron CJ2M plc but I'm not familiar with this protocol, I'm rather a Modbus/TCP or Profibus guy. With the zip file of PMCR I have more or less understood how to configure my Network with the Omron Network configurator software. Now I have to find how to use the explicit messages in the plc program. Of course if someone had a sample program it will be great help JC

Share this post


Link to post
Share on other sites
Maybe I am not totally understanding your application. You have a CJ2M PLC. Isn't it enough to associate product 1 to camera job 1, product 2 to job camera 2, etc. Then the PLC can change the camera job file using ethernet IP? I don't understand why you have to use explicit messages. The I/O assembly object already has provision for a job change.

Share this post


Link to post
Share on other sites
The problem is we have potentially several hundreds of products. So the guy that provides the camera told me the only solution is to create all the job files into the camera and then to change the current job with a native command. I don't know Cognex products so maybe there's another solution but the fact is I found a technical note on the Cognex website on how to change jobs with a Rockwell plc and they use native command with explicit messages on an EtherNet/IP network. So I guess I have to do the same with my CJ2M. The key is I don't know (yet) how to do it. Here is the link about the communications between Rockwell plc and Cognex insight camera : http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&ved=0CDMQFjAB&url=http%3A%2F%2Fwww.advancedcontrolinc.com%2Fpdf%2FCommunicatingWithControlLogix1.pdf&ei=gChUUs-FKeuc0wWrsYDQBg&usg=AFQjCNFTLIdZy5hroECKDGs2qZEU-Fp95A&bvm=bv.53537100,d.d2k&cad=rja JC Edited by acpi

Share this post


Link to post
Share on other sites
From my experience I have not had good luck using the job change function. I always find the camera slow when changing jobs. On one particular camera I had 5 jobs and it became a nightmare trying to maintain them. One small change (in lighting, tooling, etc.) and I had to apply the change to multiple jobs. Sometimes I would forget to update one or more jobs and then the camera wouldn't work anymore. If you are going to have hundreds of jobs and you are in the same situation then you might have a tough time maintaining all of the jobs. Since then I have decided to use one generic job and enable or disable inspection tools based on a product code from the PLC. You can send this over the 'user data' portion of the output assembly. This way the generic vision tools are always used. Only the product specific features (barcode reading) changes based on the product code. I haven't had to use explicit messaging from the CJ2 PLC to the Cognex camera. I have only used the implicit (I/O) communication and this was enough for what I had to do. You can setup the implicit communication using the Omron network configurator. If you need more help, you can try the Cognex Smart List: Cognex Smart List

Share this post


Link to post
Share on other sites
Morning, Thank you for all this advices, I will talk to the camera man to see what we could do to avoid explicit messages. By the way, do you know where could I find the documentation about the implicit communication I/O ? I have browsed the cognex website for hours (it's a real jungle !) but without success. JC

Share this post


Link to post
Share on other sites
It's actually under the Insight Explorer help section. I had a hard time finding it too.

Share this post


Link to post
Share on other sites
OK I found it into an iso image of the insight explorer installation dvd. Thanks again. JC

Share this post


Link to post
Share on other sites
Morning, I went to my customer's plant on friday to do some communications tests with the Cognex guy. It worked very well and quite quickly. It was the first time I worked with EtherNet/IP network so I'm rather happy of my work The only problem we have had is when we have tried to change the job ID. After many tries we have realized that the documentation I had printed came frome insight explorer 4.8.1 and the output mapping looks like this : Output assemblies.bmp As you can see, it's a little bit different from the picture you posted that probably comes from an earlier version. Guess what ? our camera is 4.7.something, so we don't have the possibility to change the job ID by the ouputs. We have spent two hours on it for nothing Anyway, the Cognex man needs as many jobs as we have products. Don't ask me why, I didn't understand his reasons but as he has a brand new Cognex tee shirt I think he knows what he does So I have to understand how to change the job with an explicit message, I have looked some samples programs about it here and it seems it's not so easy. To be continued... JC Edited by acpi

Share this post


Link to post
Share on other sites
I will dig out some code tomorrow.I recently did this with a Insight by EIP.It was tricky to figure out, but worked well once it was done.

Share this post


Link to post
Share on other sites
Morning, It would be great ! You already helped me a lot with the Omron program with the insight micro camera. In France Omron plcs are most of the time small ones without networks so when we have have to deal with it it's a little bit tough. Especially with EtherNet/IP network wich is not so common here. JC Edited by acpi

Share this post


Link to post
Share on other sites

I have attached 3 files. These files are loaded into the Color Coded FINS Messaging Tool, located here. http://forums.mrplc.com/index.php?app=downloads&showfile=948 These files do 3 things: Take the Cognex system Offline, put it Online, and change the program (by number). Here is how this works. 1. Get the messaging working from your PC using the Color Coded FINS messaging tool. Send the commands to the PLC by Ethernet. Make certain the Unit(BCD) of the Destination IP Address and FINS Routing Information is 16 + the Unit Number of the Ethernet/IP card in the PLC. So, 16 for unit 0, 17 for unit 1, etc. 2. Change the IP Address in the message (highlighted in pink) to match your Cognex system. The one I was working with was 10.102.145.13. You will see that as 30 31 30 2E('.') 31 30 32 2E('.') 31 32 34 2E('.') 30 31 33. 3. Once you have the message working from the tool, click 'Build CS/CJ CMND', and let the tool build the ladder for you. Copy the text, and paste it into a rung in CX Programmer, set to 'Show as Statement List'. Then change the view back to 'Show as Ladder' to display as normal ladder. Cognex SO1 Works.zip

Share this post


Link to post
Share on other sites
Hi, Sorry for the delay to answer but I don"t work full time on this project. Tomorrow I go to my customer's plant to do some tests with the camera. I have a few questions about your files. I can change online/offline mode on the camera with the implicit communication. I just have to change the job with explicit message so I guess "Cognex SJ02 Works.smn" is the file I have to use, right ? I have understood how to change the IP adress to match my hardware but I don't understand where I change the job number ? is it the field highlighted in green in the Color Coded FINS messaging tool ? Thanks for your help. JC

Share this post


Link to post
Share on other sites
Yes, Cognex SJ02 Works.smn is the correct file. The 02 is program 2. Program 255 would be FF in the same byte position. Beyond the single byte (programs 00 - 255) I don't know the correct byte / date layout.

Share this post


Link to post
Share on other sites

could you please upload again the file eip.zip

Share this post


Link to post
Share on other sites
54 minutes ago, jukesys said:

could you please upload again the file eip.zip

Done.

Share this post


Link to post
Share on other sites

Hi, has anyone had any luck setting up ethernet/IP on a CP1L-EL and communicate with a Cognex camera? I cannot seem to get it working, any help would be appreciated.

Share this post


Link to post
Share on other sites

The CP1L processor has built in Ethernet, it does NOT have EtherNet/IP.  It will not work.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0