Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bit Descriptions #22

Closed
jojoguy10 opened this issue Apr 19, 2024 · 2 comments
Closed

Bit Descriptions #22

jojoguy10 opened this issue Apr 19, 2024 · 2 comments

Comments

@jojoguy10
Copy link

I have a tag that's an INT and I wanted to know if there was already an implementation where I can add descriptions to the individual bits (in the Comment element)

<Tag Name="DO_03" TagType="Base" DataType="INT" Radix="Decimal" Constant="false" ExternalAccess="Read/Write">
<Comments>
    <Comment Operand=".0"><![CDATA[SAFETY RESET PB ENABLE]]></Comment>
    <Comment Operand=".1"><![CDATA[FRONT GATE LATCH ENABLE]]></Comment>
    <Comment Operand=".2"><![CDATA[LEFT GATE LATCH ENABLE]]></Comment>
    <Comment Operand=".3"><![CDATA[RIGHT GATE LATCH ENABLE]]></Comment>
    <Comment Operand=".4"><![CDATA[OPERATOR WORKLIGHT ENABLE]]></Comment>
    <Comment Operand=".5"><![CDATA[SPARE]]></Comment>
    <Comment Operand=".6"><![CDATA[BOWL FEEDER 1 ENABLE(SMALL RIVETS)]]></Comment>
    <Comment Operand=".7"><![CDATA[BOWL FEEDER 2 ENABLE(LARGE RIVETS)]]></Comment>
    <Comment Operand=".8"><![CDATA[LIGHT CURTAIN ZONE INDICATOR LIGHT GREEN]]></Comment>
    <Comment Operand=".9"><![CDATA[LIGHT CURTAIN ZONE INDICATOR LIGHT RED]]></Comment>
    <Comment Operand=".10"><![CDATA[SPARE]]></Comment>
    <Comment Operand=".11"><![CDATA[SPARE]]></Comment>
    <Comment Operand=".12"><![CDATA[SPARE]]></Comment>
    <Comment Operand=".13"><![CDATA[SPARE]]></Comment>
    <Comment Operand=".14"><![CDATA[SPARE]]></Comment>
    <Comment Operand=".15"><![CDATA[SPARE]]></Comment>
</Comments>
<Data Format="L5K"><![CDATA[0]]></Data>
  <Data Format="Decorated">
    <DataValue DataType="INT" Radix="Decimal" Value="0"/>
  </Data>
</Tag>
@tnunnink
Copy link
Owner

Currently no way to do that, but I'm sure something can be added. I'll look into it when I get time.

@tnunnink
Copy link
Owner

With version 2.2.0 you can access the Comments collection for any Tag. With this you can add/remove/update Comment objects as needed, including bit members.

var tag = new Tag("Test", 100);

tag.Comments = new LogixContainer<Comment>
{
    new(".1", "This is the comment"),
    new(".2", "this is another comment")
};

tag.Comments.Add(new Comment(".3", "This is an added comment"));

Also, setting Description will still update the corresponding comment for nested tag member objects, as it did before. We just don't have access to bit members as nested tag members.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants