Sign in to follow this  
Followers 0
andrei.apopei

IO LINK Colour sensor

5 posts in this topic

Hi,

We have an NJ101-1020 controller with a NX-ECC202 coupler that has a NX-ILM400 IO-Link master unit connected to it.

We want to read the acyclic data from a keyence colour sensor(LR-W500C ).

Basically we want to get the RGB value of what the sensor sees which is shown by index 202 from it`s IO-Link data sheet.

We get the 4801 error from the IOL_ReadObj block so we must be pointing at the wrong address or something.

Could you advise into how to find the right address to read acyclic data from?

5ab613cf6f161_nodeladder.thumb.png.141c5

5ab61401ee055_Internalvariableslist.thum5ab6144c783e9_iolinkblock.thumb.png.0621

Thank you,

Andrei

LR-W_IM_655GB_GB_WW_1067-2.pdf

node+ladder.png

Share this post


Link to post
Share on other sites

In your post you mentioned that you want to get the current value that the sensor sees. This means instead of reading index 202, you should read the Cyclic Process Data, which will be mapped directly on the NX-IO Link master variable.
You can find this easily by looking on the IO-Map table and see which has a varying value based on the current color that the sensor sees.

I've had a look on the Keyence's manual, and it says Index 202 is a parameter to either Get or Set the light source used for the sensor. It's not to get the current RGB value. Basically if you Read this Index, you will just get a value ranging from 0 to 4 which describes what light source is currently in use.
Alternatively you can Write to this Index (using IOL_WriteObj FB) to Set a light source that you want.

That being said, if you really want to Read index 202, you should put USINT#202 on the DeviceObject.Index variable.
Since this parameter does not implement SubIndex, keeping the DeviceObject.Subindex variable to zero is correct.

In your setup, I consider you wire the sensor to Port1 of the IO-Link master, and the NX-ECC Coupler is set to NodeAddress 1.
What you are missing is the DevicePort.NxUnit variable. Fill this with a structure of type _sNXUNIT_ID. You can generate this variable automatically by going to the IO-Map section and right-clicking on the NX-ILM, then clik "Display Node Location port", then Map the variable.

1 person likes this

Share this post


Link to post
Share on other sites

Thank you for replying so quickly.

I`ve mapped the variable like you said and put it in the DevicePort.NxUnit and now we get results back from the sensor! Great stuff!

I thought that reading index 202 will give me the RGB values back but I see now that this isn`t the case as that is only a setting.

Do you think it is possible to get the independent RGB values back from this sensor?

We want to use it for detecting a big colour range within some of our products.

Thank you, 

Andrei

 

 

mapped variable.png

SENSOR OUTPUT.png

Share this post


Link to post
Share on other sites

I don't think itcs possible to get independent R G and B values unless you dynamically change the light source to either R G or B as set in the index 202.

This in turn will increase cycle time.

For such detailed inspection, Vision inspection is your best bet. Photoelectric based sensors just won't do it.

Share this post


Link to post
Share on other sites

This is what I am doing now.

Vision inspection is a bit too expensive and we don`t have to worry about cycle time now, 1-2s is fine.

Thank you for you help, it seems alright now.

We are getting result every ~1s so it`s perfect.

 

 

 

SENSOR OUTPUT.png

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