Open satowine1 opened 5 years ago
The plugin cannot determine the status and name of the current NC program. I think it is possible to get the desired information via the LSV2 protocol, but I have no experience with it.
Yes, it is possible to get the desired informaiton via de LSV2 protocol If you have programming experience, I can give you the code sequence to do it. But an easier way is to download the TNCRemo program from the Heidenhain site. The software package includes a command-line program named TNCmd. With this program, you can interrogate the controller. In this case, you would be running the RUNINFO command to inquire the running parameters, including the name of the currently running program and the call stack. If you don't have a lot of programming experience, it might be easier to just invoke this program to make your queries.
Hi guys, i've solved this problem with a lot of try.
If you login in the machine with the correct username and read the correct memory area, you can everything. So: -Login with INSPECT (pwd empty) -> If you send to PLC the command _0 + 0 + 0 + (char)0x2 + "RRI" + (char) 0x00 + (char) 0x15 you can read the X,Y,Z Axis. -Login with DNC (pwd empty) -> If you send to PLC the command _0 + 0 + 0 + (char)0x2 + "RRI" + (char) 0x00 + (char) 0x18 you can read the name of the current program in execution. -> if you send to PLC the command _0 + 0 + 0 + (char) 0x2 + "RRI" + CHAR0 + (char) 0x1A you can read the current program status. The states of program can be: 0 "Started"; 1 "Stopped"; 2 "Finished"; 3"Cancelled"; 4"Interrupted"; 5"Errore"; 6"Error_Cleared"; 7"Idle"; 8 "Undefined"
So, i've wrote some functions that send to PLC these commands and return to me all info that i needed!
That's the same approach I am using. I haven't written the programs yet, but I have been sending the codes manually via a binary communications utility. I have managed to create a list of all LSV2 commands that correspond to the RUNINFO command that is part of TNCmd, by Heidenhain. These include the commands that you just listed.
Do you have a list of commands for TNCmd? I've tried to use RUNINFO I and i've got back the values of Axis, so it is the same of my _0 + 0 + 0 + (char)0x2 + "RRI" + (char) 0x00 + (char) 0x15. But i don't understand how this work (i've found this solution by "brutal" cycle for the last two char), so there is a list of these type of commands, such as R_RI, C_CC and the parameters of thre string data sucj as (char) 0x15?
Thanks!
The list of commands for TNCmd can be obtained by TNCmd --help What I did, for each different command, was to use Wireshark to record the packets being sent from my computer to the controller. Thus, I was able to create a table of all the possible values of R_RI for each particular RUNINFO command. What I noticed is that the final byte determines the variant of RUNINFO that you run, from 0x14 all the way up to 0x30. e.g. the one to obtain the name of the running program and the instruction currently being run is 0x18.
Ok thanks! For everyone that try to do this, there is the list of values:
RUNINFO I = (char) 20 RUNINFO A = (char) 21 RUNINFO L = (char) 22 RUNINFO E = (char) 23 RUNINFO P = (char) 24 (if you send this on TNC 640, it return the stack of program's names) RUNINFO O = (char) 25 RUNINFO S = (char) 26
Hi guys, I have tried to access 4 real controllers (5 axis milling machines) TNC640 340590 09 SP1 TNC640 340590 08 8P4 TNC620 340561 03 SP2 TNC620 340561 04 SP2 and neither of them sent program name and program status throught pyLSV2 library... Login into DNC area was denied. I called to Heidenhain support and they told me that DNC option 18 must be opened to login DNC area. Is it true? Does anyone have any experiance with this problem in the real controller. (It works with virtual TNC640/620 without problem...)
I tried to access data from TNCmd RUNINFO and sent me error E80070005 - General access denied error
Thanks!
Can I start or stop a specify program by send PLC some command?
Hi guys, i've solved this problem with a lot of try.
If you login in the machine with the correct username and read the correct memory area, you can everything. So: -Login with INSPECT (pwd empty) -> If you send to PLC the command _0 + 0 + 0 + (char)0x2 + "RRI" + (char) 0x00 + (char) 0x15 you can read the X,Y,Z Axis. -Login with DNC (pwd empty) -> If you send to PLC the command _0 + 0 + 0 + (char)0x2 + "RRI" + (char) 0x00 + (char) 0x18 you can read the name of the current program in execution. -> if you send to PLC the command _0 + 0 + 0 + (char) 0x2 + "RRI" + CHAR0 + (char) 0x1A you can read the current program status. The states of program can be: 0 "Started"; 1 "Stopped"; 2 "Finished"; 3"Cancelled"; 4"Interrupted"; 5"Errore"; 6"Error_Cleared"; 7"Idle"; 8 "Undefined"
So, i've wrote some functions that send to PLC these commands and return to me all info that i needed!
Can I start or stop a specify program by send PLC some command?
Hi guys, i've solved this problem with a lot of try. If you login in the machine with the correct username and read the correct memory area, you can everything. So: -Login with INSPECT (pwd empty) -> If you send to PLC the command _0 + 0 + 0 + (char)0x2 + "RRI" + (char) 0x00 + (char) 0x15 you can read the X,Y,Z Axis. -Login with DNC (pwd empty) -> If you send to PLC the command _0 + 0 + 0 + (char)0x2 + "RRI" + (char) 0x00 + (char) 0x18 you can read the name of the current program in execution. -> if you send to PLC the command _0 + 0 + 0 + (char) 0x2 + "RRI" + CHAR0 + (char) 0x1A you can read the current program status. The states of program can be: 0 "Started"; 1 "Stopped"; 2 "Finished"; 3"Cancelled"; 4"Interrupted"; 5"Errore"; 6"Error_Cleared"; 7"Idle"; 8 "Undefined" So, i've wrote some functions that send to PLC these commands and return to me all info that i needed!
Mmm, i don't now... I've investigated only on reading commands, i'm sorry ^^"
Yes, it is possible to get the desired informaiton via de LSV2 protocol If you have programming experience, I can give you the code sequence to do it. But an easier way is to download the TNCRemo program from the Heidenhain site. The software package includes a command-line program named TNCmd. With this program, you can interrogate the controller. In this case, you would be running the RUNINFO command to inquire the running parameters, including the name of the currently running program and the call stack. If you don't have a lot of programming experience, it might be easier to just invoke this program to make your queries.
Hi do you have an example, im trying to read the DWORD 7800 but returns a 0 and the correct value its 29000000
Hi, i see that your plugin can send and receive file from Heidenhain. i'm trying to understand about reading program status on my machine (es. program_name.IDLE or program_name.RUNNING). Can your plugin read this information? Or can you provide me some information about that?
Thanks!