Jump to content

Recommended Posts

Posted

Is it possible to substitute a portion of a tag (with a variable) to be used for indexing? For example:

AnyBus_Input_USINT_1 of type USINT. I have 128 of these tags total. I need to convert them to a Byte Array and the only way I've been able to do this is to convert each one individually. Indexing them would seem to be a more concise method and lend itself to less typos if it were possible. 

I'm using an AnyBus Communicator for Serial to EtherCAT communications. I've tried using a STRUCT and a UNION in the I/O Map but they apparently are not allowed.

Posted

11 hours ago, Crossbow said:

Correct on the I/O map.  Nothing with a period in it is allowed.  Not sure why.

Apparently no variable modifiers are allowed.

SMS_Array_Prohibition.thumb.jpg.aafd99fb

11 hours ago, Crossbow said:

There is no way to index a tag name, why can you not just create an array?

This is what I did but I find it a bit cumbersome. For this project I'll only be using 40 or 50 Bytes but if I were to need hundreds then this would be a huge list of mistakes waiting to happen.

SMS_ByteArray.thumb.jpg.f4a6a14650148146

This will work for me. Am I missing an easier method?

Posted
2 hours ago, IO_Rack said:

Are you saying you can index a non array variable in ST?

OOPS! Sorry for confusion.

My error, failed to see the problem of creating an array that references the PDO mapping variables.

This may be possible but I don't know how.

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...