Paycheck

Data Control - Structures and Arrays

3 posts in this topic

Good morning folks,

I'm not super familiar with the Omron world but I've used "everything else but..." fairly extensively.  My question is a fairly simple one, but allow me to be verbose in my explanation so that it may help others down the road.

Relevant Hardware: Omron NX1P2 PLC, ifm Efector AL1120 IO-Link Master Block on Ethernet/IP

Problem : IO Link device "raw" connections are In - Byte[246] and Out - Byte[174].  However, when I create the various data structures for the device IO table, the size of the tag from the resulting UDT is much bigger than the array sizes that the ethernet device is expecting so communication doesn't work when I put the tag in the Ethernet connection.  In order to get it to work, I created two new tags (byte array in and out) that match the size for the IO link master block and it works fine.  The issue is that an array of bytes isn't very user friendly for understanding IO-Link data and config function.

Question : Is there a way I can map Byte[x] arrays into data structure tags (and vice versa) even though the data structure may be composed of various data types?  In the Siemens world I would use a BLK_MOV and a pointer but I don't know how to do something similar here.

Thanks,

$$$

 

Share this post


Link to post
Share on other sites

Yes, you can use ToAryByte and AryByteTo to simply map bit-for-bit to and from byte arrays to anything else. I don't think it will work though because the structure isn't the right size.

I think the root cause of your problem it the offset type. In the Structures window where you made the structure change the Offset type to User and then you can ensure it is the right size and layout.

3 people like this

Share this post


Link to post
Share on other sites

Ahh...Ok, I'll give the offset thing a try.  If that doesn't work, I'll try those functions you mentioned.

Thanks for the tip! (from a fellow Canuck)

$$$

2 people like this

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