tnunnink / L5Sharp

A library for intuitively interacting with Rockwell's L5X import/export files.
MIT License
55 stars 6 forks source link

Problem Creating Array Tags #17

Closed Ryushi5 closed 8 months ago

Ryushi5 commented 8 months ago

I'm running into an issue with generating an array tag. For this example, I'm making a BOOL[100] tag.

For the Tag creation, I am setting the Value to the following: Value = ArrayType.New<BOOL>(100)

It could be that there is a better way to do this, but it seems to work except for one thing. The resulting L5X tag that's exported shows its DataType as: ... DataType="BOOL[100]" Radix="Decimal" Dimensions="100">

This does not import into Studio 5000, but works just fine if the DataType is "BOOL" with the Dimensions set at "100".

tnunnink commented 8 months ago

Thanks for reporting this. I forget why I added the index to the data type name for array types. I think I wanted a way to distinguish non-array types from array types, but it has been a while, so I'm not sure. I need to go back and review this and some other things and do some more testing when I find time.

In the interim I have fixed the issue and published a new version 0.19.7 which should write the correct name to the DataType attribute for array tags.

Ryushi5 commented 8 months ago

Thanks again for your help!

Sorry to be blowing you up, but I finally have some time to work on a project I've been looking forward to. Having your library has made it so much easier.

tnunnink commented 8 months ago

No problem! Glad someone is finding this library useful.