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

Feature request: ReadSZL() #196

Closed
NicklasMD opened this issue Sep 25, 2020 · 4 comments
Closed

Feature request: ReadSZL() #196

NicklasMD opened this issue Sep 25, 2020 · 4 comments
Milestone

Comments

@NicklasMD
Copy link

Hi I didn't know where the right place where to ask for this?
The Snap7 has a function to read SZL values or lists of values, I would like that also in the Python-Snap7
Thanks for all your work.

Example from the Snap7 documentation:
Cli_ReadSZL
Description
Reads a partial list of given ID and INDEX.
Declaration
int Cli_ReadSZL( S7Object Client, int ID, int Index,
TS7SZL *pUsrData, int *Size);
function Cli_ReadSZL(Client : S7Object; ID, Index : integer;
pUsrData : PS7SZL; var Size : integer) : integer;
Parameters
Type Dir.
Client Native Integer In
The handle as return value of
Cli_Create(), passed by value.
ID integer 32 In List ID
Index integer 32 In List Index
pUsrData Pointer to struct in Address of the user buffer
size Pointer to integer 32 In Buffer size available
Out Bytes rea

@swamper123
Copy link
Contributor

What is an SZL btw? Never heared of that thing in an SPS context before (or can't remember).

This feature is actually not implemented, but feel free to make a PR.
I would recommened that you check other functions/methods and adapt their "wrapping behaviour".

@NicklasMD
Copy link
Author

The SZL's are used to get diagnostic data out of the PLC
For example status on the fieldbus, diagnostic buffer, status LED's etc. so I think it's a quite useful feature.

I'm not sure I'm competent enough to make the feature myself...

@swamper123
Copy link
Contributor

Found out SZL means "SystemZustandsListe", so like you said a diagnostic datas.

I thought I may never contribute to this repo as well, but after a while I am pretty into it in any kind of way. 😄
If you inspect other client requests of their structure, you'll see that they are pretty similar and you see where self.library.... is used, that this is the actual C command.

Otherwise you may have to wait a longer time until somebody implements it or you have to make PLC workarounds.

@lautarodapin
Copy link
Contributor

I really would love that two, I was looking for something like that for checking if devices where connected
Didn't know that szl was the option
I will check if i can't get to something

@gijzelaerr gijzelaerr added this to the 0.12 milestone Dec 1, 2020
gijzelaerr pushed a commit that referenced this issue Dec 2, 2020
* implement the readszl() function

* add the function
* add types for a partial list and for the header of a partial list
* add tests

* format formatting issues

* Add namedtuples for SSL

* undo changes

* fix tests
@gijzelaerr gijzelaerr modified the milestones: 0.12, 1.0 Jan 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants