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

UDT Converter #128

Closed
ricky-ge opened this issue Jan 26, 2021 · 1 comment
Closed

UDT Converter #128

ricky-ge opened this issue Jan 26, 2021 · 1 comment

Comments

@ricky-ge
Copy link

I have a list of tag variable in an UDT as shown below. For such case, if I would like to create my own PlcMapper, is the code below correct? As the example used only involved in DINT, not SINT, therefore I would like to confirm if my written code is correct for this situation or not.

image

var DINT0 = tag.GetInt32(0)
var DINT1 = tag.GetInt8(4)
var DINT2 = tag.GetInt8(5)

MoveIndex = DINT0;

BitArray bitArray1 = new BitArray(new int[] { DINT1 });
MoveAbsPB = bitArray1[31];
OS_MoveAbs = bitArray1[30];
...

BitArray bitArray2 = new BitArray(new int[] { DINT2 });
OS_Jog = bitArray2[31];
SV_OnPB = bitArray2[30];
...
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

No branches or pull requests

2 participants