You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can confirm that the lib works with iTNC530, 606420 02 SP3 quite nicely!
I am able to retrieve correct sensor values from the PLC memory as indicated by the addresses provided by the inventcom article (e.g. 322 milling head speed in revolutions/minute). Yet, so far I am only able to query Integer values. The machine does provide more sensor data, e.g. the milling head torque in Nm as decimals (at least I can see this from the TNCscope tool).
I do not know the specific PLC memory addresses for these values. So I tried reading all the adresses and interpreting them as float, yet this didn't bring up meaningful values anywhere. Doe you have an idea how I can convert the readouts correctly? So far, I am reading the DWORDs and convert them to floats using
value = con.read_plc_memory(address=x, mem_type=pyLSV2.MemoryType.DWORD,count=1)
flval = struct.unpack('f',value[0:4])
To do so, I had to change read_plc_memory() to directly return the payload, otherwise, I wasn't able to dissect plc_values further so that I could extract the raw byte data.
I hope I haven't overlooked something here. Thanks!
The text was updated successfully, but these errors were encountered:
thanks for the feedback! I will add your software version to my list :-)
I am sorry to say that as far as i know TNCscope is using the DNC library instead of LSV2. I have done quite a bit of searching and analysis with Wireshark but DNC is quite a bit harder to decode than LSV2 which is for the most part just plain text without any encoding.
On the upside it seems that there is indeed a problem in pyLSV2 in reading from the memory address. Currently it is using the telegram R_MB to read values from memory, on a TNC 640 this has worked just fine and i assumed it would also work on an iTNC as i got good values for everything i checked. This seems to not be the case! After checking again with TNCcmd again I found the command GETVALUE which i always ignored as it has some strict limitations: Availability: iTNC 530 as of 34049x 03 and 60642x 01 or TNC 640 as of 34059x 01 (only with TNCcmdPlus)
This command uses the telegram R_DP to read values by using some kind of special path like \PLC\memory\M\100.
I created a new branch to try reading via R_DP and it seems to work at least for one value :-) check it out here: data_path
It adds the new function read_data_path(path) which takes a string like TNCcmd. This is not ready yet as i have not been able to figure out the meaning of all the byte values sent and revived. If i have time i will take a look next weekend on what i can figure out. If you are interested you can take a look yourself, Pull requests are always welcome!
Hi @drunsinn,
I can confirm that the lib works with iTNC530, 606420 02 SP3 quite nicely!
I am able to retrieve correct sensor values from the PLC memory as indicated by the addresses provided by the inventcom article (e.g. 322 milling head speed in revolutions/minute). Yet, so far I am only able to query Integer values. The machine does provide more sensor data, e.g. the milling head torque in Nm as decimals (at least I can see this from the TNCscope tool).
I do not know the specific PLC memory addresses for these values. So I tried reading all the adresses and interpreting them as float, yet this didn't bring up meaningful values anywhere. Doe you have an idea how I can convert the readouts correctly? So far, I am reading the DWORDs and convert them to floats using
To do so, I had to change read_plc_memory() to directly return the payload, otherwise, I wasn't able to dissect plc_values further so that I could extract the raw byte data.
I hope I haven't overlooked something here. Thanks!
The text was updated successfully, but these errors were encountered: