Skip to content

Commit

Permalink
Merge pull request #90 from 7evenk/feature/datatypesadded
Browse files Browse the repository at this point in the history
Datatypes (sint, usint, ulint, lint, lreal, uint, udint) added.
  • Loading branch information
jogibear9988 authored Nov 27, 2017
2 parents 3b45b49 + 1252c4b commit 9d84025
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
19 changes: 17 additions & 2 deletions DotNetSiemensPLCToolBoxLibrary.TIAV13/Step7ProjectV13Tia.cs
Original file line number Diff line number Diff line change
Expand Up @@ -883,13 +883,13 @@ internal static void parseChildren(TIADataRow parentRow, XElement parentElement,
row.DataType = S7DataRowType.INT;
break;
case "uint":
row.DataType = S7DataRowType.WORD;
row.DataType = S7DataRowType.UINT;
break;
case "dint":
row.DataType = S7DataRowType.DINT;
break;
case "udint":
row.DataType = S7DataRowType.DWORD;
row.DataType = S7DataRowType.UDINT;
break;
case "word":
row.DataType = S7DataRowType.WORD;
Expand Down Expand Up @@ -921,6 +921,21 @@ internal static void parseChildren(TIADataRow parentRow, XElement parentElement,
case "time":
row.DataType = S7DataRowType.TIME;
break;
case "sint":
row.DataType = S7DataRowType.SINT;
break;
case "usint":
row.DataType = S7DataRowType.USINT;
break;
case "ulint":
row.DataType = S7DataRowType.ULINT;
break;
case "lint":
row.DataType = S7DataRowType.LINT;
break;
case "lreal":
row.DataType = S7DataRowType.LREAL;
break;
default:
row.DataType = S7DataRowType.UNKNOWN;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ public enum S7DataRowType
S5_KY = 0xf03,
S5_KC = 0xf04,
S5_C = 0xf0c,

SINT = 0x101,
USINT = 0x102,
LINT = 0x103,
ULINT = 0x104,
LREAL = 0x105,
UINT = 0x106,
UDINT = 0x107,
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ public virtual int ByteLength
return size;
case S7DataRowType.BOOL:
case S7DataRowType.BYTE:
case S7DataRowType.SINT:
case S7DataRowType.USINT:
case S7DataRowType.CHAR:
len = 1;
break;
Expand All @@ -326,12 +328,16 @@ public virtual int ByteLength
case S7DataRowType.DWORD:
case S7DataRowType.TIME:
case S7DataRowType.REAL:
case S7DataRowType.UDINT:
len = 4;
break;
case S7DataRowType.POINTER:
len = 6;
break;
case S7DataRowType.DATE_AND_TIME:
case S7DataRowType.LREAL:
case S7DataRowType.ULINT:
case S7DataRowType.LINT:
len = 8;
break;
case S7DataRowType.S5TIME:
Expand All @@ -344,6 +350,7 @@ public virtual int ByteLength
case S7DataRowType.COUNTER:
case S7DataRowType.TIMER:
case S7DataRowType.DATE:
case S7DataRowType.UINT:
len = 2;
break;
case S7DataRowType.S5_KH:
Expand Down

0 comments on commit 9d84025

Please sign in to comment.