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

Fix getting block dependencies for function blocks using DBs #194

Merged
merged 2 commits into from
Oct 23, 2023

Conversation

ryan2445
Copy link
Contributor

@ryan2445 ryan2445 commented Oct 21, 2023

  • Makes sure the block name and DB# get added to the dependencies list for function blocks that use a DB
  • I wanted to use GetBlockBytes to get some of the block data without parsing everything upfront (some large blocks take a little while) so I made GetBlockBytes a public function. Hopefully that's ok :)
  • Fixes an index out of range error while getting step7 v5 project description

Comment on lines +649 to +654
if (paras.Length > 0)
{
var byteAdr = int.Parse(paras[1].Replace("DBX", "").Replace("DBB", "").Replace("DBW", "").Replace("DBD", ""));
// var byteAdr = int.Parse(paras[1].Replace("DBX", "").Replace("DBB", "").Replace("DBW", "").Replace("DBD", ""));

var bitAdr = 0;
if (paras.Length > 2) bitAdr = int.Parse(paras[2]);
// var bitAdr = 0;
// if (paras.Length > 2) bitAdr = int.Parse(paras[2]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this code wasn't being used and was causing an error on a few data blocks so just commenting it for now

also checking .Length > 0 since we're only accessing index 0 in paras

@jogibear9988 jogibear9988 merged commit 874b210 into dotnetprojects:master Oct 23, 2023
@jogibear9988
Copy link
Member

looks good to me. thx.

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