Comments (9)
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.
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.
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.
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.
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.
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.
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.
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.
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)
- Consumed Tag Attributes HOT 2
- Converting ACD files to L5X? HOT 1
- Updating rungs for routines HOT 2
- Creating Safety Programs HOT 3
- Proposal to Extend L5Sharp Support to .NET Standard 2.0 HOT 2
- Tag Data Type Modification HOT 2
- RLL Routine Rung Comment Generation HOT 5
- New FBD Routine Example HOT 3
- Problem Creating Array Tags HOT 3
- Working with SafetyInfo HOT 9
- Issue with DateTime Format in AOIs HOT 2
- Bit Descriptions HOT 2
- Can't Derive from Sealed Type HOT 1
- Creating AOIs Efficiently HOT 5
- Controller Module HOT 2
- Parsing to a DataType HOT 2
- Inconsistent use of bool and BOOL data type HOT 8
- Adding rung to routine with no rungs HOT 2
- Feature Request: AOI Rung Instruction HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from l5sharp.