Control panel, MUX wiring help

More
29 Oct 2020 06:54 #187655 by rootboy

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. :)
The following user(s) said Thank You: lois

Please Log in or Create an account to join the conversation.

More
02 Nov 2020 12:57 #188103 by Himarc3D
Classic ladder isnt another option?
here one example using ladder for RSLogix500 (have many ways to do it using scan logic)
SOR XIO T4:0/DN TON T4:0 0.01 15 0 EOR  SOR LES T4:0.ACC 6 XIC O:3.0/1 BST XIC I:1.0/1 OTE B3:0/1 NXB XIC I:1.0/2 OTE B3:0/2 NXB XIC I:1.0/3 OTE B3:0/3 NXB XIC I:1.0/4 OTE B3:0/4 BND EOR  SOR GRT T4:0.ACC 5 LES T4:0.ACC 11 XIC O:3.0/2 BST XIC I:1.0/1 OTE B3:0/5 NXB XIC I:1.0/2 OTE B3:0/6 NXB XIC I:1.0/3 OTE B3:0/7 NXB XIC I:1.0/4 OTE B3:0/8 BND EOR  SOR GRT T4:0.ACC 10 XIC O:3.0/3 BST XIC I:1.0/1 OTE B3:0/5 NXB XIC I:1.0/2 OTE B3:0/6 NXB XIC I:1.0/3 OTE B3:0/7 NXB XIC I:1.0/4 OTE B3:0/8 BND EOR

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.
Attachments:

Please Log in or Create an account to join the conversation.

More
02 Nov 2020 13:02 #188104 by Himarc3D
Attachments:

Please Log in or Create an account to join the conversation.

More
02 Nov 2020 13:32 #188106 by andypugh
Another option would be to plug a 7i73 card into that 7i77. That has matrix keyboard scanning built-in.

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 or Create an account to join the conversation.

More
31 Jan 2021 17:20 #197223 by lois
Replied by lois on topic Control panel, MUX wiring help
Leaving feedback:

My 7i77 outputs are sourcing voltage and due diode positions:



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.



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?
Attachments:

Please Log in or Create an account to join the conversation.

More
31 Jan 2021 17:35 - 31 Jan 2021 17:54 #197225 by RotarySMP
I used matrix_kb to wire up the physical buttons on my user control panel. I load it in the main HAL, but do the pin connections in the postgui.HAL as I am interfacing it with Gmoccapy's soft keys. I have attached my HAL.

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
Attachments:
Last edit: 31 Jan 2021 17:54 by RotarySMP.

Please Log in or Create an account to join the conversation.

More
31 Jan 2021 21:25 #197248 by rodw
Replied by rodw on topic Control panel, MUX wiring help
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. 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 or Create an account to join the conversation.

More
01 Feb 2021 00:14 #197260 by andypugh

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 or Create an account to join the conversation.

More
01 Feb 2021 00:19 #197261 by phillc54
I think the keyboard module requires root.

Please Log in or Create an account to join the conversation.

More
01 Feb 2021 00:23 - 01 Feb 2021 00:24 #197262 by andypugh

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)
Last edit: 01 Feb 2021 00:24 by andypugh.

Please Log in or Create an account to join the conversation.

Time to create page: 0.981 seconds
Powered by Kunena Forum