OpenLogics / MewtocolNet

⭐ A Mewtocol protocol library to interface with Panasonic PLCs over TCP/Serial written in C#
https://na.industrial.panasonic.com/
GNU General Public License v3.0
26 stars 7 forks source link

PlcInfo TryFromRT and TryExtendFromEXRT RegEx for parsing RT message have station number hardcoded to (%EE) #12

Closed shouidar closed 10 months ago

shouidar commented 10 months ago

Describe the bug

TryRT and TryExtendFromEXRT will fail to parse PlcInfo if a station number other than 0xEE is used.

To Reproduce

In the BasicRegisterReadWrite example program in the ninitialization of the plc instance MewTocol.Ethernet (Or .Serial) use a station number other than the default 238.

The Plc.ConnectAsync call will fail

Expected behavior Plc.ConnectAsync should work with all station numbers (if existing in the Mewnet network.

shouidar commented 10 months ago

I think the TryExtendFromEXRT regEx expression may be erroneous. According the [Doc I have] (https://www.autopack.com/Service/PLC/PLC_soft/Software/FPWIN%20Pro5/Manuals_and_Catalogues/English/Manuals/MEWTOCOL_ACGM0125V10END.pdf). The field order and sizes after nbProg (Number of Programs) are as follow: Version : 4 bytes Program Size : 4 bytes, Header Size : 4 bytes, System Register Size : 4 bytes.

Off course this may have changed with newer versions!!

Sandoun commented 10 months ago

I mean they are just placeholders at the time, i found many different documents and revsions describing the protocol and i had to test around a lot because they all had their own differences. Maybe the prog count come in handy later on!