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
Testing on real machine #1
Comments
Hello, thanks for testing! Yes, I am running my code with real machines with a TNC 640 and a TNC 620. The code is requesting information from the control and the response with a message of a certain length. Our machines always had a length of 120 characters so it worked for me. A document I found mentioned a length of 124 for programming stations but everything I tested had always 120 chars. As I can't decode the message without a sample I added the test for a length of 124 with the message you received. The Java-code I found at https://github.com/tfischer73/Eclipse-Plugin-Heidenhain does some padding to always get 124 characters. As I have said, without any test data I can't be sure if the decoded data is correct. It would be really helpful if you could check if the data matches you machines configuration! |
Updated package is available via the python package index / pip now. https://pypi.org/project/pyLSV2/#history |
Thanks for your answer and the updated package ! I did some testing myself and tried the same with decoding the message_length of 124. I got the same results then as I get with your package now. So I think that is the right way to go. Now when using the command When I just use the I don't know if I can set the Maybe you have some idea as to why this is giving the error and/or know a solution ? Thanks for the help anyway ! |
When the machine is not running I can read the selected program with Sometimes that byte can't be decoded by UTF-8 and it returns the following error Do you know why it prints the selected program twice and why with that weird first byte ? p.s. Is it fine with you if I keep posting my findings here or do you prefer an other way of communication ? Thanks in advance! |
Thanks again for the fast feedback! The problem with decoding the file name is probably also a result of my lazy approach to decoding the response message. The difference between TNC 640 an iTNC 530 seem to be greater than I would have expected 😅 I will take a look at solving these problems later today, if you could post a debug log file it would be grate! Feel free to continue posting here, it lets me keep track of the changes I made for certain topics. Regards, |
Ok, it really was a problem with me being lazy while implementing reading the program stack. I did my testing for the function get_selected_program() just after switching on the machine, this lead to me thinking there was only one file name surrounded by 0x00. This was obviously wrong! 😅 I had to change and rename the function to reflect this.
Depending on the state of the control these values might be zero and/or empty. For example, after power on before the first nc start, the current program is empty. |
Hello Max, I had some difficulties getting the log file. I'll work on that so that i can post it. But I did read the block length from the control with
Thanks for the update, I'll go and try that ! Wouter |
Ok, this seems to have nothing to do with setting of the buffer size but enabling the secure file send option. The log message is/was but I changed it to read differently. I also went ahead an added a fallback if enabling the secure file send was successful. There probably is some flag where I could check ahead of time but I am not sure which one. Instead of raising an Exception it now disables the secure file send. This seems to be not that big of a deal as it only affects the very last acknowledgment to the control. The latest release (0.5.4) should at least give better log messages to get an idea what went wrong. To get the log messages just add |
Hello Max, Here you have the log message after running the code
I hope this is a correct way to post the log output |
Max, I added the option to read the execution status in my client, I don't know if you want to put that in the package but here is the code:
Wouter |
Hello Wouter, first, thank you for the new functions, I will add them in a release later today after I have done some testing! From the log you posted confirms my suspicion. I can see that the control reports that it doesn't support the command C_CC with payload of 0x0013. This is the command to enable the secure file sending. Max |
Hey Max, I want to read the PLC-memory to wait until a value changes using a WORD, MARKER or DWORD statement. I sent a command that waits until the program state changes. I've used the TNCcmd to send this statement and inspected it with Wireshark. I've found that it first makes a login with I saw in the .client that the Do you know a way how we can implement this reading of the PLC-memory in the code ? Wouter |
First, I will create a new Issue for reading the PLC values since it is a different topic. I will copy your request and reply there: #3 Second: can you confirm that the reported problem with establishing the connection is fixed? If so, can you close this issue? |
Hello,
I want to read machine data from a iTNC530.
I'm trying to connect to a iTNC530 using pyLSV2 using the code from the Usage section in the README
I changed it so it connects to the correct IP-address, but when running the code I get the error
NotImplementedError: this case for system parameters is unknown, please send log messages to add:
Looking further in this error I can see that it has to do with
message_length == 124: # real machine? not tested!
Have you tested it on a real machine or do you have any advice as to how I could solve this problem ?
Thanks in advance!
The text was updated successfully, but these errors were encountered: