Hello again
Back in 2013 i needed data tables
and found the tool table just didnt do what i wanted
I come from Heidenhain TNC background
where data files are simple flat db files with number names and number line indexes
So i wrote simple flat db files ( whitespace delimited)
that were named as numbers
( this is a key element to use with Mcodes
eg: M1xx PNNNNNNNN QNNN format)
and wrote a python script (M122)
to read file NNNNNNNN (the P parm)
and parse the data on index line NNN ( the Q parm)
limitations:
the data file name is numeric
the line index is numeric
the data can be non numeric
the number of data entries per index have to be same
remember:
hal pins dont like strings, so hand them numeric data
I include an example etab
and a version of the Mcode that prints data read to the terminal running lcnc
you can exercise it (in MDI) from any config you like
that has in the .ini
[RS274NGC]
...
USER_M_PATH = /your/linuxcnc/maybe/-dev/mcodes
with this i get umpteen values per line in the table
hth
tomp
due to restrictions in file extents here on forum
just remove the .txt from the files
edit 07aug2022
to use sumple txt files fro data storage...
in your python script use
Code:
import sys, subprocess
then build your command string
like
Code:
cmdstr = "halcmd setp testEtab.0.mypin"
and add the value to be set
like
Code:
cmdstr = cmdstr + str(myval)
then have the system exec the cmdstr
like
Code:
subprocess.call(cmdstr, shell=True)
loop that recipe thru all the pins to be set
hth tomp
watch in action