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

Add S7 options to get DB 'actual values' and expand arrays #196

Merged
merged 7 commits into from
Nov 11, 2023

Conversation

ryan2445
Copy link
Contributor

  • adds options to get DB actual values and expand arrays for DBs
  • assigns StartValue to expanded array items
  • handling for getting actual values from more S7 data types

@ryan2445 ryan2445 marked this pull request as ready for review November 10, 2023 01:47
@@ -423,14 +423,14 @@ private TmpBlock GetBlockBytes(string blkName)
return GetBlockBytes(blkInfo);
}

public S7DataRow GetInterface(string blkName)
public S7DataRow GetInterface(string blkName, S7ConvertingOptions myConvOpt)
Copy link
Member

Choose a reason for hiding this comment

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

could you a here a overload without the Converting Options? So it is a non breaking change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep!

public S7DataRow GetInterface(string blkName)
{
var myConvOpt = new S7ConvertingOptions(Project.ProjectLanguage);
return GetInterface(blkName, myConvOpt);
}
public S7DataRow GetInterface(string blkName, S7ConvertingOptions myConvOpt)
{
var blkInfo = GetProjectBlockInfoFromBlockName(blkName);
if (blkInfo == null)
return null;
TmpBlock myTmpBlk = GetBlockBytes(blkInfo);
List<string> tmpPar = new List<string>();
return Parameter.GetInterfaceOrDBFromStep7ProjectString(myTmpBlk.blkinterface, ref tmpPar, blkInfo.BlockType, false, this, null, myConvOpt);
}

@@ -945,7 +945,7 @@ public static string GetFCPointer(byte b1, byte b2, byte b3, byte b4)
switch (b1)
{
case 0x80:
anf = "P#PE ";
anf = "P#P ";
Copy link
Member

Choose a reason for hiding this comment

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

Is this correct? (I don't know what PE was... and what is P for...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think so, at least that's how it looks in my software:
image

@jogibear9988 jogibear9988 merged commit bc98f21 into dotnetprojects:master Nov 11, 2023
1 check passed
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