drunsinn / pyLSV2

A pure Python3 implementation of the LSV2 protocol
MIT License
60 stars 24 forks source link

How to locate Q parameters values #57

Open LanderUrgoiti opened 10 months ago

LanderUrgoiti commented 10 months ago

Hello everyone:

I am trying to locate a certain memory adress in the PLC of a Heidenhain TNC 640 but I can't. My main problem is that I cannot make sense of the order in wich the read_plc_memory() method sorts the data. For example:

I know I can find the PLC memory that I store in the machine as Q1620 using this line of code:

PN = con.read_plc_memory(first_element=250,mem_type=pyLSV2.lc.MemoryType.INPUT_WORD, number_of_elements=1)

The data I am looking for is stored in the Q107 in the machine. Obviously there are not enough elements in the INPUT_WORD MemoryType to go from Q1620 back to Q107. I guess it is stored in another MemoryType but I have not found it.

Maybe I could list all of the PLC values so i can search for it but I do not know how. Can you please give me any tip?

Thanks in advance

LanderUrgoiti commented 10 months ago

I have realised I may have been wrong with something. The "Q" parameters I am looking for are not written in the PLC and maybe this is why I cant find them.

Is it possible to get the value of these parameters? I am trying with the get_machin_parameters() method but i am not making any progress.

I dont know if any of you know how these "Q" parameters are named.

drunsinn commented 10 months ago

I am not aware of any function to read from the Q parameter memory using lsv2. Depending on what you are trying to do it might also work if you write the q parameter to a table. Those can be copied with lsv2 and the values read directly

LanderUrgoiti commented 10 months ago

Hello @drunsinn First of all, thanks for the response. I thought it would have a simple solution to read the Q parameters since they are very used to handle process variables. I guess I will either write these data in a table or directly to the PLC. If you find a way to read these parameters I would be glad to know! We have a lot of info stored in these parameters!!

Thanks again! Lander imagen