LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading Instance ID data from Ethernet/IP device

Solved!
Go to solution

Hi all,

 

I'm trying to read the measurement values from a Keyence DL-EP1 unit with IB-xx sensor attached, using the Ethernet/IP driver in LabVIEW. The manual describes it should be possible by reading Instance ID 100 (64H), which is a 84 words (168 byte) data structure with all the values. The measured values are then bytes 48-51.

 

I have, however, not been able to successfully read this data. Attached is the simple VI. I noticed that without the "Add Instance" step defining byte size etc., it always returns the error that the instance ID is unknown. With this step added, it just returns an array of zeroes.

The relevant sections of the manual are also attached.

 

Does anyone have an idea how to read the measurement values? Would be greatly appreciated. Thanks!

Download All
0 Kudos
Message 1 of 10
(5,745 Views)

Hey Paul,

 

I've not got one of those devices which I can test anything with, but what I would suggest is to start by reading out some data which is known to be there, such as a serial number for example. This should let you check that communication is working, and then you can start looking at the specific instance ID that you are interested in.

 

I noticed that when I ran your VI, there was no error message even though there was no device connected, this makes it tricky to confirm that you are even connecting to the device.

 

Hopefully this helps you get started with it.

 

Regards,

Mitch

0 Kudos
Message 2 of 10
(5,684 Views)
Solution
Accepted by topic author irPaul

Hi Mitch,

 

Thanks for the reply. I managed in the end. There are two ways of communication to this unit: cyclic and message communication (explicit).

The Instance ID 100 referred to before is for cyclic messaging. After consulting with Keyence this seems to be only possible with an actual PLC to configure the messaging intervals etc.

 

With the *right* manual, we found that Attribute 804 for Message Communication contains the raw value. Reading Class 103, ID 1 (first sensor), Attribute 806, and doing the proper conversion, then gave us the raw output. See the Snippet below.

(Note for future users: the actual Attribute depends on which sensor type is used.)

 

 


@MitchBrown wrote:

I noticed that when I ran your VI, there was no error message even though there was no device connected, this makes it tricky to confirm that you are even connecting to the device.

I noticed this too. Even if the IP address to connect to is not available, the Ethernet Open VI returns no error. A simple ping would suffice to detect that no device is present on this address. Maybe a suggestion to add a check like this in this VI?

 

 

Keyence_DLEP1_readout.png

Message 3 of 10
(5,667 Views)

Hi Paul,

 

I'm glad to hear you have managed to get it working, I would suggest marking your post as a solution so that other users can quickly find the answer.

 

Regarding the feedback you have about the VI, I will note it down and suggest it as a future addition.

 

Regards,

 

Mitch

0 Kudos
Message 4 of 10
(5,652 Views)

Hi paul

 

Thanks for your great idea.

I'm  a technical support engineer of Keyence China.

And I'm interested in the way you make this problem out.

Actually, I'm trying to connect NU-EP1(the  communication unit of sensor) with computer by Labview.

May I ask  for a help? 

Can you give me some details about this program?

0 Kudos
Message 5 of 10
(5,605 Views)

@Elderzhao wrote:

Hi paul

 

Thanks for your great idea.

I'm  a technical support engineer of Keyence China.

And I'm interested in the way you make this problem out.

Actually, I'm trying to connect NU-EP1(the  communication unit of sensor) with computer by Labview.

May I ask  for a help? 

Can you give me some details about this program?


Sure. What is it you want to know?

The readout is pretty straight-forward; a timed loop that reads an attribute. The code also works for the NU-EP1 that we have. Just change the Class/Instance/Attribute to read.

Refer to the specific manuals for that, also minding the sensor type connected.

0 Kudos
Message 6 of 10
(5,591 Views)

 

 

Thanks for your reply.

Could I use this Snippet to connect Nu-EP1 with computer as long as I change the Class/Instance/Attribute ID number.

Dose it need special snippet any more ? 捕获.PNG

 

0 Kudos
Message 7 of 10
(5,586 Views)

Indeed, it should work like that. Just set the right IP address, and Class/Instance/Attribute IDs.

Also double-check the manual for the output data type. For the NU-EP1 it is 16-bit I believe, for the DL-EP1 usually 32-bit. Change the '0'-value in the snippet to 16- or 32-bit representation for correct conversion.

Same for the division after; the DL-EP1 has two decimals (hence division by 100), the NU-EP1 has no decimal position, so no division necessary. Though this may differ per Mode of the device.

0 Kudos
Message 8 of 10
(5,579 Views)

Thanks for your kindness,your suggestion is helpful.

I will try it myself.And if I success,I will share the snippet here.

Thanks again.

0 Kudos
Message 9 of 10
(5,560 Views)

Untitled.png

 

This is work. Read data from Keyence DL-EP1 is unsigned 32 bit data.

Device 1 @ byte address 48-51,

Device 2 @ byte address 52-55,

.....

.....

Device 15 @ byte address 104-107.

I read data from each byte address of each device then convert binary.

Then combined to 32-bit binary.

finally, convert 32-bit binary to decimal.

 

0 Kudos
Message 10 of 10
(1,633 Views)