kdobsontn

NJ501 with Keyence IV2 Ethernet/IP Union

9 posts in this topic

Hey all,

I am having some issues with a Keyence IV2 camera which has Ethernet/IP functionality. 

To summarize briefly, it has been configured and reading the data into my PLC (NJ501) into a structure data type.  The issue I'm having is that I cannot control this on a bit level for triggering the camera, etc.  I was reading that a Union type is the way to go, but unfortunately, I stopped getting data into the PLC when setting it up that way.  According to the configuration guide for Rockwell and setting it up in the Network Configurator, I needed to go with the SINT type.  When registering the device, the 8-bit option was necessary since the Input/Output sizes needed to match.  This was predetermined by the EDS file for the IV2.

I am stumped as to how to get the data to read into the Union Type, and any suggestions would be greatly appreciated.

Thanks,

-K

 

DataType.png

UnionType.png

EthernetConfig.png

NetworkConfig.png

Share this post


Link to post
Share on other sites

I am trying to help, but Keyence's website won't let me download the IV2 Field Network Manual.  I would suggest using a Structure.  You can build a structure that is the exact size you need and you can define some of the data as bits and others as Reals, UINTs, etc.  If I could get a look at their manual, I could build a structure for you in a library for you to use.  

1 person likes this

Share this post


Link to post
Share on other sites

Structure is definitely the way to go. Attached is a copy/paste from a working program we have.

Keyence IV Stuctures.csv

Edited by IO_Rack
2 people like this

Share this post


Link to post
Share on other sites

Thank you @IO_Rack!  This is very helpful. 

Looking at the .csv, specifically the byte/bit offsets for END_BYTE, what determines that value (I'm guessing that's documented somewhere with Keyence)?  My end goal would be to look at a specific tool in the program rather than the overall judgement to give us more capability in recipe-based production.

 

Thanks,

-K

Share this post


Link to post
Share on other sites

Here is the complete assembly in library form.

Keyence IV2.slr

To use this file, go to the Project pull down menu, choose Library -> Show References.

Then press the + button.  Choose the attached library file.  The Data Types would then be added to your program. 

Then you can create variables as shown below:

KeyenceVars.thumb.jpg.7c7a2eb2208c12944c

 

I have also attached the library source file so that you can see / modify it as you would like:

Keyence IV2.smc2

If you modify the library, you will need to go to Project pull down, then Library, then Create Library after you have made the changes.  You can then use the newly created .slr library file in your project.  

1 person likes this

Share this post


Link to post
Share on other sites

@Michael Walsh Fantastic...thank you very much.  This is a side of Omron I have not looked into yet.

I recently updated my Sysmac Studio so I'm not sure if yours is different.  I ended up copying and pasting the Data Types into my program from the library reference popup (clicking OK didn't add them automatically).  I definitely need to look into how to create a library file because we have quite a bit of hardware coming in that this will be useful for.

 

Thanks all for your help,

-K

Share this post


Link to post
Share on other sites

K, 

It may appear that the data types did not show up when you add the library.  You need to create global variables and type the data type in like this keyence\UDTKeyenceInputAssembly (it will autofill when you start typing Keyence and again after you enter the \) just as I showed in the picture a couple of posts up.  I created a Namespace called Keyence and that is why this method of entry is necessary.

After you add the library, you should be able to see that the two structures were added in the Keyence Namespace (Project -> Library -> Show References and then expanding the Data option):

5e43175e5c54e_LibraryRef.thumb.jpg.f1135

Then when you add a new variable, you should see the type ahead work like this:

5e43175d8e65a_LibraryVar.jpg.a2d9ae68dc7

Share this post


Link to post
Share on other sites

Copying and pasting the data types into your project is completely acceptable and will not cause you any issues, I just was trying to fill in the blanks about how to use UDTs when loaded from a library file.

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