AMSMARTINS

Reading an Array of data using EC_CoESDORead function

5 posts in this topic

Hi all.

I'm trying to read and write some data from a ultrasonic generator via Ethercat.

Reading single variables it works , but if I try to read an array with 22 elements (show all the values in this array) it doesn't work .

Please see the image attached.

The idea was to read all the values in the ARRAY[0..21] OF UINT at the same time, is that possible or I have to do 1 by one ?

Speaking with technical support of the welding generators they can do this with TIA Portal.

I added to attached files an exemple from backhoff as well.

Reading the manual for the Weld Generator from Telsonic the index, and Subindex should be

Read_Struc.Index:=UINT#16#2013;
Read_Struc.Subindex:=UsINT#16#16;
Read_Struc.IsCompleteAccess:=FALSE;

Buts as I said above I can only read the first element of the array or Read_data[0]

Thanks

 

 

Read_Function.PNG

Beckhoff.PNG

Read_Function.PNG

Share this post


Link to post
Share on other sites

Have you tried Subindex 0 and IsCompleteAccess = TRUE?

Share this post


Link to post
Share on other sites

Hi.

Thanks for your reply

Yes, I tried that but no success so far.

I tried as well with the sub index Read_Struc.Subindex:=USINT#16#16;

"For ADOs which consist of several values (array), where only one individual value is accessed,
the subindex “0” is the size of the array (read-only).
The subindexes 1...N correspond to the values 0...N-1 of the corresponding ADO"

Any Ideas ?

Thanks again

Read_Function.PNG

Share this post


Link to post
Share on other sites

You are close.

Your error code - 1803 - indicates reception buffer overflow. Your ReadDat variable needs to be N+1 so resize it to [23] and try the same method.

You should always give yourself a few extra bytes with the comm instructions, I would go [30] to start.

Share this post


Link to post
Share on other sites

Thanks for your replay.

With subindex=0 and  IsCompleteAccess = TRUE  and with some extra bytes it works.

Thanks for your help .

 

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