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

"DATE" data type #505

Open
TheGEZ opened this issue Aug 22, 2023 · 1 comment
Open

"DATE" data type #505

TheGEZ opened this issue Aug 22, 2023 · 1 comment

Comments

@TheGEZ
Copy link

TheGEZ commented Aug 22, 2023

Hi All !

Tis is my first post so first of all I want to thank everyone is supporting the awesome project, thank you very much !

As I said I'm new to S7Net+ and I have a question, may be stupid but ...
I'm developing a datalogging application that collects some data from an S7-300 PLC using the "ReadMultipleVars" function that has the amazing feature to automatically converts values in the corriponding C# data type, and I've noticed that seems that the "old" type DATE (16Bit IEC 61131-3 "number of days from 1-1-1990") is not directly supported, i I request the data using the "VarType.DateTime" type I get an error.
To be clear, this is not a big deal sice the data ca be read by using the "VarType.Word" type en then convert it to the C# DateTime using C# DateTime methods, but i think that would be very handy if the fuction could hande the type by itself.
So the question is, is the "DATE" type effectively unsupported or I missed something ?

Thank you again !

@bonk-dev
Copy link
Contributor

If the PR gets merged, you can clone this repo, build the solution, add the reference to your
project (while you wait for the official release) and use the new VarType.Date like that:
var dataItems = new List<DataItem>() { new DataItem() { VarType = VarType.Date, Count = 1, DataType = DataType.DataBlock, DB = 1 } }; var result = await plc.ReadMultipleVarsAsync(dataItems);

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