- Posts: 76
- Thank you received: 0
Control panel, MUX wiring help
lois wrote: Understood.
I can't get there with my "self knowledge about this programming level. Can you recommend some topics, so i can follow, about this subject?
Here's a nice little tutorial that will explain reading a keyboard matrix:
www.baldengineer.com/arduino-keyboard-matrix-tutorial.html
Focus on the part just after "Elements of a Keyboard Matrix". And keep your diodes...
And Peter's comment of "I was afraid you would ask..." had me cracking up.
Please Log in to join the conversation.
here one example using ladder for RSLogix500 (have many ways to do it using scan logic)
Attachment not found
Mitsubishi offer free simulators just need to become member.
FX-TRN-BEG
FX-TRN-DATA
FX-TRN-POS
The last two just in japanese (shame) the DATA teach how to handlle 7 segment displays, BCD, keyboards, thumbwheel, outdated stuff (win98) but still usefull but now low end HMI is very cheap...
This one is another one nice for learn but isnt free like Mitsubishi
www.thelearningpit.com/lp/dwnloads.asp
www.youtube.com/results?search_query=FX-TRN-BEG
Give a try to Classic Ladder, have many ways to skin this cat.
Please Log in to join the conversation.
Attachment not found
Attachment not found
Attachment not found
Please Log in to join the conversation.
But you might as well start with matrix_kb (you need that even if you do use the 7i73, but use the other half of it)
On balance, the two-headed nature of matrix_kb was probably a mistake, it should probably have been two separate components.
Please Log in to join the conversation.
My 7i77 outputs are sourcing voltage and due diode positions:
Attachment not found
net row0 matrix_kb.0.row-00-out <= hm2_7i92.0.7i77.0.0.output-08
net row1 matrix_kb.0.row-01-out <= hm2_7i92.0.7i77.0.0.output-09
net row2 matrix_kb.0.row-02-out <= hm2_7i92.0.7i77.0.0.output-10
net row3 matrix_kb.0.row-03-out <= hm2_7i92.0.7i77.0.0.output-11
net row4 matrix_kb.0.row-04-out <= hm2_7i92.0.7i77.0.0.output-12
net row5 matrix_kb.0.row-05-out <= hm2_7i92.0.7i77.0.0.output-13
net row6 matrix_kb.0.row-06-out <= hm2_7i92.0.7i77.0.0.output-14
net row7 matrix_kb.0.row-07-out <= hm2_7i92.0.7i77.0.0.output-15
net col0 matrix_kb.0.col-00-in <= hm2_7i92.0.7i77.0.0.input-16
net col1 matrix_kb.0.col-01-in <= hm2_7i92.0.7i77.0.0.input-17
net col2 matrix_kb.0.col-02-in <= hm2_7i92.0.7i77.0.0.input-18
net col3 matrix_kb.0.col-03-in <= hm2_7i92.0.7i77.0.0.input-19
net col4 matrix_kb.0.col-04-in <= hm2_7i92.0.7i77.0.0.input-20
net col5 matrix_kb.0.col-05-in <= hm2_7i92.0.7i77.0.0.input-21
All the buttons and selector knobs are working properly.
Attachment not found
Now i'm connecting this to hal...
Already tried this and works properly:
net mode-jog matrix_kb.0.key.r4c0 => halui.mode.manual
net mode-manual matrix_kb.0.key.r3c0 => halui.mode.mdi
Is there a way to attribute/translate all this matrix_kb.0.keys... to equivalent keyboard buttons? Like if i had a second pc keyboard?
Please Log in to join the conversation.
Just note that I have that one "HAL feature / Bug". I use an Underscore in the loadrt name "MAHO_PANEL", and it becomes a "-" in the resulting module "MAHO-PANEL"
When I was looking into this, I considered using an original MAHO keyboard but dropped that idea, as I came to understand that you can't (or can't easily) use the ouputs from a matrix_kb in a mix of both HAL functions (like the Halui connections you mentioned), and Uspace (like a "G" "M","X", numbers etc) buttons to write directly into the MDI field. This might have been a misunderstanding on my part though.
Mark
Please Log in to join the conversation.
You should be able to write a component in Python to "stuff" data (single character or a string) into the keyboard buffer. You would decide whether to type the string when you pressed the button or when the button is released and add the logic for that.
Python being python, I figured it would have a library that would allow this and of course it has!
pypi.org/project/keyboard/
So I think keyboard.write() will do what you want.
You'd just have to select the MDI field before typing but for cooler stuff, capture the data into a memory buffer and when you press execute, write it out to a file and run the gcode program instead of just allowing single line MDI commands.
Please Log in to join the conversation.
lois wrote: Is there a way to attribute/translate all this matrix_kb.0.keys... to equivalent keyboard buttons? Like if i had a second pc keyboard?
No, but there are HAL pins to do nearly everything that you can do with the keyboard (other than type G-code commands). With the advantage of (largely) working in the realtime layer.
Please Log in to join the conversation.
Please Log in to join the conversation.
rodw wrote: I have not tried this but:
You should be able to write a component in Python to "stuff" data (single character or a string) into the keyboard buffer.
The first version of matrix_kb had this capability. But it did it by calling external kernel routines, and there was a worry that we had no way to know that these were thread-safe so it was taken out.
This commit is where I removed that code:
github.com/LinuxCNC/linuxcnc/commit/b494...c3b3790a457e1ed354c8
So if that was all put in a separate userspace component, the matrix_kb could look (partially) like a standard keyboard to the OS.
(In a userspace component there is no need to worry about thread safety)
Please Log in to join the conversation.
