Skip to main content

Crate l5x

Crate l5x 

Source
Expand description

L5X file parser for PLC programs.

This crate provides functionality for parsing L5X files exported from Rockwell Automation Studio 5000 Logix Designer.

§Parsing Features

  • Fast, type-safe parsing using quick-xml and serde
  • Generated types from the official L5X XSD schema
  • RLL (Relay Ladder Logic) instruction parsing

§Example

use l5x::Project;

// Parse L5X file
let xml = std::fs::read_to_string("project.L5X")?;
let project: Project = l5x::from_str(&xml)?;
println!("Controller: {:?}", project.controller);

// Parse ladder logic rungs
use l5x::rll::parse_rung;
let rung = parse_rung("XIC(Start)OTE(Motor);");
let tags = rung.tag_references();

Re-exports§

pub use security::SecurityLimits;
pub use security::SecurityError;
pub use security::validate_xml;

Modules§

rll
RLL (Relay Ladder Logic) text parser for Rockwell L5X files.
security
Security limits and protections for L5X parsing

Structs§

AAttachment
AAttachmentType element
ABus
ABusType element
AFBD_Block
AFBD_BlockType element
AFBD_Function
AFBD_FunctionType element
AProgram
AProgramType element
ASCIIDriver
ASCIIDriverType element
ASFC_BranchElement
ASFC_BranchElementType element
ASFC_LangElemWire
ASFC_LangElemWireType element
ASFC_LegElement
ASFC_LegElementType element
ASFC_StepElement
ASFC_StepElementType element
ASFC_StopElement
ASFC_StopElementType element
ASFC_TransitionElement
ASFC_TransitionElementType element
AdditionalHelpText
AdditionalHelpTextType element
AlarmAnalog
AlarmAnalogType element
AlarmConfig
AlarmConfigType element
AlarmData
AlarmDataType element
AlarmDefinitionCollectionAdaptor
AlarmDefinitionCollectionAdaptorType element
AlarmDigital
AlarmDigitalType element
AlarmMessage
AlarmMessageType element
AlarmMessageCollection
AlarmMessageCollectionType element
AlarmMessageText
AlarmMessageTextType element
AnyElement
Placeholder for xs:any wildcard elements quick-xml cannot deserialize dynamic element names, so these are skipped Use xmltree-based parsing if you need to preserve xs:any content
AreaAdaptor
AreaAdaptorType element
AreaAdaptorCollection
AreaAdaptorCollectionType element
Axis
AxisType element
AxisData
AxisDataType element
BEO
BEOType element
BEOData
BEODataType element
CST
CSTType element
ChildProgram
ChildProgramType element
ChildProgramCollection
ChildProgramCollectionType element
CommPortCollection
CommPortCollectionType element
CommentAdaptor
CommentAdaptorType element
CommentAdaptorText
CommentAdaptorTextType element
CommentCollection
CommentCollectionType element
CommentWide
CommentWideType element
Communications
CommunicationsType element
ConfigData
ConfigDataType element
ConfigScript
ConfigScriptType element
ConfigTag
ConfigTagType element
ConfiguredAlarmAdaptor
ConfiguredAlarmAdaptorType element
ConfiguredAlarmCollectionAdaptor
ConfiguredAlarmCollectionAdaptorType element
ConsumeTagInfo
ConsumeTagInfoType element
Controller
ControllerType element
CoordinateSystem
CoordinateSystemType element
CoordinateSystemData
CoordinateSystemDataType element
CustomPropertiesAdaptor
CustomPropertiesAdaptorType element
CustomPropertiesCollection
CustomPropertiesCollectionType element
CustomPropertiesText
CustomPropertiesTextType element
DF1Driver
DF1DriverType element
DataArray
DataArray element
DataArrayElement
DataArrayElement element
DataLog
DataLogType element
DataLogCollection
DataLogCollectionType element
DataLogTag
DataLogTagType element
DataLogTagCollection
DataLogTagCollectionType element
DataStructure
DataStructure element
DataType
DataTypeType element
DataTypeCollection
DataTypeCollectionType element
DataTypeDependency
DataTypeDependencyType element
DataTypeDependencyCollection
DataTypeDependencyCollectionType element
DataTypeMember
DataTypeMemberType element
DataValue
DataValue element
DataWide
DataWideType element
DataWideType_Value_Inline
DataWideType_Value_InlineType element
DatatypeAlarmDefinition
DatatypeAlarmDefinitionType element
DecoratedData
DecoratedDataType element
DecoratedDefaultData
DecoratedDefaultDataType element
DefaultDataWide
DefaultDataWideType element
DefaultDataWideType_Value_Inline
DefaultDataWideType_Value_InlineType element
DependenciesWide
DependenciesWideType element
DependencyWide
DependencyWideType element
Description
DescriptionType element
DescriptionText
DescriptionTextType element
DeviceDiagnosticProfile
DeviceDiagnosticProfileType element
DeviceDiagnosticProfileCollection
DeviceDiagnosticProfileCollectionType element
DeviceDiagnosticProfileType_ProfileDefinition_Inline
DeviceDiagnosticProfileType_ProfileDefinition_InlineType element
DeviceLevelRing
DeviceLevelRingType element
DeviceObj
DeviceObjType element
DiagnosticsMessageAdaptor
DiagnosticsMessageAdaptorType element
DiagnosticsMessageCollection
DiagnosticsMessageCollectionType element
DisplayText
DisplayTextType element
EEO
EEOType element
EEOData
EEODataType element
EmbeddedLanguageBlock
EmbeddedLanguageBlockType element
EncodedRoutine
EncodedRoutineType element
EncodedUDIDefinition
EncodedUDIDefinitionType element
EncodedWide
EncodedWideType element
EncryptedContent
EncryptedContentType element
EncryptionInfo
EncryptionInfoType element
EncryptionKey
EncryptionKeyType element
EngineeringUnit
EngineeringUnitType element
EngineeringUnitCollection
EngineeringUnitCollectionType element
EngineeringUnitText
EngineeringUnitTextType element
EthernetLink
EthernetLinkType element
EthernetLinkCollection
EthernetLinkCollectionType element
ExtDeviceObj
ExtDeviceObjType element
ExternalContent
ExternalContentType element
ExternalContentType_DLL_Inline
ExternalContentType_DLL_InlineType element
ExternalContentType_EntryPoint_Inline
ExternalContentType_EntryPoint_InlineType element
FBDContent
FBDContentType element
FBD_FeedbackWire
FBD_FeedbackWireType element
FBD_GsvBlock
FBD_GsvBlockType element
FBD_InputRef
FBD_InputRefType element
FBD_InputWireConnector
FBD_InputWireConnectorType element
FBD_JSR
FBD_JSRType element
FBD_OutputRef
FBD_OutputRefType element
FBD_OutputWireConnector
FBD_OutputWireConnectorType element
FBD_RET
FBD_RETType element
FBD_SBR
FBD_SBRType element
FBD_SpecialArray
FBD_SpecialArrayType element
FBD_SsvBlock
FBD_SsvBlockType element
FBD_UDIArgument
FBD_UDIArgumentType element
FBD_UDIBlock
FBD_UDIBlockType element
FBD_Wire
FBD_WireType element
FaultLog
FaultLogType element
ForceDataWide
ForceDataWideType element
ForceDataWideType_Value_Inline
ForceDataWideType_Value_InlineType element
HMIBC
HMIBCType element
HMIBCData
HMIBCDataType element
HardwareStatus
HardwareStatusType element
HistoryEntry
HistoryEntryType element
InAliasTag
InAliasTagType element
InputData
InputDataType element
InputImageInit
InputImageInitType element
InputTag
InputTagType element
InstructionAdaptor
InstructionAdaptorType element
InstructionAdaptorCollection
InstructionAdaptorCollectionType element
L5KData
L5KDataType element
L5KDefaultData
L5KDefaultDataType element
L5KForceData
L5KForceDataType element
Label
LabelType element
LabelAdaptor
LabelAdaptorType element
LabelAdaptorCollection
LabelAdaptorCollectionType element
LabelCollection
LabelCollectionType element
LabelText
LabelTextType element
LabelWide
LabelWideType element
LabelsWide
LabelsWideType element
LibraryAdaptor
LibraryAdaptorType element
LibraryAdaptorCollection
LibraryAdaptorCollectionType element
LocalizedAdditionalHelpText
LocalizedAdditionalHelpTextType element
LocalizedCommentWide
LocalizedCommentWideType element
MapConnection
MapConnectionType element
MapConnectionCollection
MapConnectionCollectionType element
MapDevice
MapDeviceType element
MapDeviceCollection
MapDeviceCollectionType element
MapDeviceType_ExtendedProperties_Inline
MapDeviceType_ExtendedProperties_InlineType element
MaxLimit
MaxLimitType element
MaxLimitCollection
MaxLimitCollectionType element
MemberAlarmDefinition
MemberAlarmDefinitionType element
MessageData
MessageDataType element
MinLimit
MinLimitType element
MinLimitCollection
MinLimitCollectionType element
ModuleEKey
ModuleEKeyType element
MotionGroup
MotionGroupType element
MotionGroupData
MotionGroupDataType element
Msg
MsgType element
NavigationAdaptor
NavigationAdaptorType element
NavigationCollection
NavigationCollectionType element
OutAliasTag
OutAliasTagType element
OutputData
OutputDataType element
OutputTag
OutputTagType element
ParameterConnection
ParameterConnectionType element
ParameterConnectionCollection
ParameterConnectionCollectionType element
Pen
PenType element
PenCollection
PenCollectionType element
PingMethod
PingMethodType element
Port
PortType element
PortCollection
PortCollectionType element
PrimaryActionSetAdaptor
PrimaryActionSetAdaptorType element
PrimaryActionSetCollection
PrimaryActionSetCollectionType element
PrimaryActionSetText
PrimaryActionSetTextType element
ProduceTagInfo
ProduceTagInfoType element
ProgramCollection
ProgramCollectionType element
Project
ProjectType element
QuickWatchAdaptor
QuickWatchAdaptorType element
QuickWatchCollectionAdaptor
QuickWatchCollectionAdaptorType element
QuickWatchTagAdaptor
QuickWatchTagAdaptorType element
RackConnection
RackConnectionType element
RawData
RawDataType element
RawDefaultData
RawDefaultDataType element
RawForceData
RawForceDataType element
Redundancy
RedundancyType element
RedundancyInfo
RedundancyInfoType element
RevisionNote
RevisionNoteType element
RevisionNoteText
RevisionNoteTextType element
Routine
RoutineType element
RoutineCollection
RoutineCollectionType element
RoutineType_EncryptedSegments_Inline
RoutineType_EncryptedSegments_InlineType element
Rung
RungType element
RungCollection
RungCollectionType element
RungComment
RungCommentType element
RungCommentText
RungCommentTextType element
SEQContent
SEQContentType element
SFCContent
SFCContentType element
SFC_ActionElement
SFC_ActionElementType element
SFC_SBR_RET
SFC_SBR_RETType element
STContent
STContentType element
STLine
STLineType element
SafetyController
SafetyControllerType element
SafetyInfo
SafetyInfoType element
SafetyInfoType_SafetyTagMap_Inline
SafetyInfoType_SafetyTagMap_InlineType element
SafetyScript
SafetyScriptType element
ScheduledProgram
ScheduledProgramType element
ScheduledProgramCollection
ScheduledProgramCollectionType element
SecurityInfo
SecurityInfoType element
SerialPort
SerialPortType element
Sheet
SheetType element
SiblingDependenciesCollection
SiblingDependenciesCollectionType element
SiblingDependencyAdaptor
SiblingDependencyAdaptorType element
SignatureHistory
SignatureHistoryType element
State0
State0Type element
State0Collection
State0CollectionType element
State0Text
State0TextType element
State1
State1Type element
State1Collection
State1CollectionType element
State1Text
State1TextType element
StringData
StringDataType element
StringDefaultData
StringDefaultDataType element
TCPIP
TCPIPType element
Tag
TagType element
TagCollection
TagCollectionType element
TagConfigurationAdaptor
TagConfigurationAdaptorType element
TagConfigurationsAdaptor
TagConfigurationsAdaptorType element
Task
TaskType element
TaskCollection
TaskCollectionType element
TaskEventInfo
TaskEventInfoType element
TextBox
TextBoxType element
TextBoxAdaptor
TextBoxAdaptorType element
TextBoxAdaptorText
TextBoxAdaptorTextType element
TextWide
TextWideType element
TimeSynchronize
TimeSynchronizeType element
TrendGroup
TrendGroupType element
TrendGroupCollection
TrendGroupCollectionType element
TrendGroupType_Template_Inline
TrendGroupType_Template_InlineType element
TypeMemberCollection
TypeMemberCollectionType element
UDIDefinition
UDIDefinitionType element
UDIDefinitionCollection
UDIDefinitionCollectionType element
UDIDefinitionType_EncryptedAOIContent_Inline
UDIDefinitionType_EncryptedAOIContent_InlineType element
UDIDependency
UDIDependencyType element
UDIDependencyCollection
UDIDependencyCollectionType element
UDILocalTag
UDILocalTagType element
UDILocalTagCollection
UDILocalTagCollectionType element
UDIParameter
UDIParameterType element
UDIParameterCollection
UDIParameterCollectionType element
URLAdaptor
URLAdaptorType element
URLAdaptorCollection
URLAdaptorCollectionType element
WallClockTime
WallClockTimeType element

Enums§

DecoratedDataElements
DecoratedDataElements choice group
SecureParseError
Combined error type for secure parsing

Functions§

from_str
Parse L5X XML string into a typed structure.
from_str_secure
Parse L5X XML string with security validation.
to_string
Serialize a structure to an L5X XML string.