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

Get CPU ordernumber (MLFB) from CPUFolders. #152

Merged
merged 2 commits into from
Apr 30, 2020

Conversation

fleibede
Copy link
Contributor

Attempt at reading out the MLFB from *.s7h files in the "s7hstatx" folder.

The byte sequence that define the position of the MLFB string in the file
appear to be different among PLC types, thus the different seqeuences
are all tested against. However, there may be more sequences that should
be added, but it must be tested with more Step7 projects. Currently tested
with 7 different CPU types.

Probably there is another way to identify the location of the MLFB string
that is more deterministic than this pragmatic method. Hopefully someone
will find that way.

Another weakness with this method is that for one out of 35 projects tested,
the s7h file did not exist. Only after a HWConfig recompile was it created.
Maybe it was last compiled by on old Step7 version, or there have been
an error of some kind.

Attempt at reading out the MLFB from *.s7h files in the "s7hstatx" folder.

The byte sequence that define the position of the MLFB string in the file
appear to be different among PLC types, thus the different seqeuences
are all tested against. However, there may be more sequences that should
be added, but it must be tested with more Step7 projects. Currently tested
with 7 different CPU types.

Probably there is another way to identify the location of the MLFB string
that is more deterministic than this pragmatic method. Hopefully someone
will find that way.

Another weakness with this method is that for one out of 35 projects tested,
the s7h file did not exist. Only after a HWConfig recompile was it created.
Maybe it was last compiled by on old Step7 version, or there have been
an error of some kind.
@jogibear9988
Copy link
Member

would it be possible to wrap this in a try/catch? if somthing goes wrong, it would be good if we don't break existing code

@fleibede
Copy link
Contributor Author

Sure, comitted it now.

@jogibear9988
Copy link
Member

thanks

@jogibear9988 jogibear9988 merged commit 0622b5a into dotnetprojects:master Apr 30, 2020
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

Successfully merging this pull request may close these issues.

2 participants