Giter VIP home page Giter VIP logo

Comments (9)

jojoguy10 avatar jojoguy10 commented on July 29, 2024 1

So, I did some more digging. I just found that when you EXPORT an AOI, it shows the rungs as starting at 0, but when I tried to import, it gave an error. I tried adding the Number parameter (like your comment), but it still didn't work. I found that I had to put the Number before the Type attributes.

<Rung Number="3" Type="N">
    <Text><![CDATA[XIC(Output_Data.0)OTE(Device.Pt00.Data);]]></Text>
</Rung>

I ended up just writing my own XElement, but it's very odd how it is different for AOIs vs normal Routines. In normal Routines, I don't have to put the number in the Rung element, like you mentioned.

from l5sharp.

tnunnink avatar tnunnink commented on July 29, 2024 1

I updated the Number initialization on Rung as mentioned here with version 2.1.0. Gonna leave this issue open until I can test v33 import with rung's have number = 0. I'll get back to you on that.

from l5sharp.

tnunnink avatar tnunnink commented on July 29, 2024

That is interesting. I read that it didn't care about Rung numbers for programs and routines. Didn't know it cared for AOIs.

Have you tried setting the Number property for the rungs you add to the AOI? You should be able to get/set that value as needed.

 var rung = new Rung { Number = 1 };

Let me know if that doesn't work or if I'm not understanding the issue.

from l5sharp.

tnunnink avatar tnunnink commented on July 29, 2024

Got it. Well, I suppose we could add an initialization for the Number property on the Rung objects so that it will always add that attribute before the Type property. Maybe that would help prevent the error? I don't think it would hurt to always have it there by default.

from l5sharp.

jojoguy10 avatar jojoguy10 commented on July 29, 2024

I think so. I just don't get why when I try to import the AOI, it complains about the first rung being Number = 0, but when I export it, the first rung is Number = 0. Maybe it's just a bug in v33?

from l5sharp.

tnunnink avatar tnunnink commented on July 29, 2024

That is weird. I just tested exporting and re-importing a test AOI on my sample project which is v32 and that worked fine. I also confirmed that the first Rung number is 0. I'll have to see if we have a v33 installation somewhere I can test on.

from l5sharp.

jojoguy10 avatar jojoguy10 commented on July 29, 2024

OK, here's a weird development. I updated to v2.1.0 and added the rungs in the AOI's Logic routine with the new Rung, and the generated L5X doesn't show the Number initialization, but Studio didn't complain about it either!

from l5sharp.

tnunnink avatar tnunnink commented on July 29, 2024

Do you mind sharing a sample that I can use to reproduce the issue? Hard for me to say what the issue is.

from l5sharp.

tnunnink avatar tnunnink commented on July 29, 2024

I noticed I forgot to include the Number initialization for the Rung constructor taking the text argument. I got that fixed and it will be included in the next version. I assume that is what you were using and why you didn't see the Number attribute populated on the XML.

As for this original issue, I tested v33 and v32 exporting an AOI, deleting all the Number attributes from the Rung elements, and reimporting. Studio didn't have any issue with this, and it assigned the rung numbers in the order in which they appear in the document, same as does for programs.

Here is what the Routines part of my import looked like for reference.

<Routines>
<Routine Name="Logic" Type="RLL">
<RLLContent>
<Rung Type="N">
<Text>
<![CDATA[XIC(Test)OTL(Latch);]]>
</Text>
</Rung>
<Rung Type="N">
<Text>
<![CDATA[XIC(Test)OTL(Latch);]]>
</Text>
</Rung>
<Rung Type="N">
<Text>
<![CDATA[XIC(Test)OTL(Latch);]]>
</Text>
</Rung>
<Rung Type="N">
<Text>
<![CDATA[XIC(Test)OTL(Latch);]]>
</Text>
</Rung>
</RLLContent>
</Routine>
</Routines>

I'm going to close this issue. If you think there is something else missing from this library that would be causing import errors, feel free to submit another issue.

from l5sharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.