Closed sazima closed 1 year ago
The error numbers are matched via the translation function in
def get_error_text(error_type, error_code, language=None, locale_path=None): """Parse error type and error code and return the error message.
to a more descriptive text message found in the translation po/mo files. If you supply create a localization file based on these messages in your target language I can include them in the package!
Take a look at gettext
, that is the technology used for the translation.
When I call read_plc_memory
, there is an error in the log. Do you know how to solve this problem, Thank you.
The model of the cnc is iTNC530E
.
res = c.read_plc_memory(764, MemoryType.WORD)
WARNING:root:T_ER or T_BD received, an error occurred during the execution of the last command: LSV2_ERROR_T_ER_NO_LOGIN
ERROR:root:an error occurred during login for login Login.PLCDEBUG
WARNING:root:T_ER or T_BD received, an error occurred during the execution of the last command: LSV2_ERROR_T_ER_NO_PRIV
ERROR:root:failed to read string from address 828
First, it seems that the you haven't installed the library with pip so the installation is missing the translation files. That is the reason you get these nondescript error messages like LSV2ERROR... . If you install the package via pip there are translation files included which I mentioned earlier. If you don't care about installing with pip just copy the *.mo files from the python package into the location you store the library. The package can be downloaded from the Python package index
Regarding the error messages:
LSV2_ERROR_T_ER_NO_LOGIN
translates to "login not possible" and LSV2_ERROR_T_ER_NO_PRIV
translates to "no privilege for execution"
It seems like the you need a password for the login PLCDEBUG
. The function read_plc_memory()
tries to login without a password which works on a programming station.
Maybe your machine is configured differently which is why it dosen't work. In that case you would have to run login(login=Login.PLCDEBUG, password="secret")
before reading the plc memory. Just replace the password with the correct phrase.
To geht the password you might have to ask the manufacturer of your machine or try the usual passwords....
First, it seems that the you haven't installed the library with pip so the installation is missing the translation files. That is the reason you get these nondescript error messages like LSV2ERROR... . If you install the package via pip there are translation files included which I mentioned earlier. If you don't care about installing with pip just copy the *.mo files from the python package into the location you store the library. The package can be downloaded from the Python package index
Regarding the error messages:
LSV2_ERROR_T_ER_NO_LOGIN
translates to "login not possible" andLSV2_ERROR_T_ER_NO_PRIV
translates to "no privilege for execution" It seems like the you need a password for the loginPLCDEBUG
. The functionread_plc_memory()
tries to login without a password which works on a programming station.Maybe your machine is configured differently which is why it dosen't work. In that case you would have to run
login(login=Login.PLCDEBUG, password="secret")
before reading the plc memory. Just replace the password with the correct phrase. To geht the password you might have to ask the manufacturer of your machine or try the usual passwords....
I gave feedback to my customers and hoped they could ask for the password. If there is follow-up, I will update this issue. Thanks for your help!!!
https://github.com/drunsinn/pyLSV2/blob/220f350ca732cfd4ce9ab49c8997e2daf909d8c4/pyLSV2/const.py#L195