Folks,
it has been a while,but i've run into a challenge..
At the moment i'm working on an Editor to write CNC Code for one of my CNC Lathes, and also to send them to the machine using RS232.. that will be sorted out later, as first i want the editor to work right..
in order to "Compose"lines of code for , for instance a toolchange, where you want the machine to move to a specific position before actually changing the tool, to prevent collisions between the tool and the workpiece.
My machine has a "Turret type"toolchanger, which has a disc with tools mounted on it, all sticking out different lengths.
So.. in my CNC machine code a toolchange could look like this:
G00 T0000 X60. Z60. M5 M9
T0303
I want the editor to look "kinda old school" mimicking the control of the machine (with a 10" Green Monochrome screen..
For the toolchange i want a Dialog the you can fill in..
it asks for the X and Z position, Toolslot and offset, and wether the spindle should turn left, right or not at all (M3, M4, M5) and Coolant on (M8) or Off (M9).
I made a put a Datagridview in my form, that i show when it is called (i use theF-keys to show different dialogs on the form, al made with the same DataGridview)
In this DataGridView, i have 2 Columns, the first shows "Toolchange" in the first Cell, then on the second row "X-position" third row "Z-Position" and so on.. on the bottom row it says "OK".
What i want to achieve is: when you have entered all the values in the second row, you end up on the bottom row.
When pressing Enter in this Cell, the data from the gridview must be processed to make the Code for the Lathe, which should be entered on cursorposition in the program textbox.
making the code, and putting it in the textbox is the easy part.. what i'm struggling with is:
How do i make the DataGridview "see" i'm on the lowest Cell, so when i press Enter the magical stuff happens?
Hope you can help me out!
it has been a while,but i've run into a challenge..
At the moment i'm working on an Editor to write CNC Code for one of my CNC Lathes, and also to send them to the machine using RS232.. that will be sorted out later, as first i want the editor to work right..
in order to "Compose"lines of code for , for instance a toolchange, where you want the machine to move to a specific position before actually changing the tool, to prevent collisions between the tool and the workpiece.
My machine has a "Turret type"toolchanger, which has a disc with tools mounted on it, all sticking out different lengths.
So.. in my CNC machine code a toolchange could look like this:
G00 T0000 X60. Z60. M5 M9
T0303
I want the editor to look "kinda old school" mimicking the control of the machine (with a 10" Green Monochrome screen..
For the toolchange i want a Dialog the you can fill in..
it asks for the X and Z position, Toolslot and offset, and wether the spindle should turn left, right or not at all (M3, M4, M5) and Coolant on (M8) or Off (M9).
I made a put a Datagridview in my form, that i show when it is called (i use theF-keys to show different dialogs on the form, al made with the same DataGridview)
In this DataGridView, i have 2 Columns, the first shows "Toolchange" in the first Cell, then on the second row "X-position" third row "Z-Position" and so on.. on the bottom row it says "OK".
What i want to achieve is: when you have entered all the values in the second row, you end up on the bottom row.
When pressing Enter in this Cell, the data from the gridview must be processed to make the Code for the Lathe, which should be entered on cursorposition in the program textbox.
making the code, and putting it in the textbox is the easy part.. what i'm struggling with is:
How do i make the DataGridview "see" i'm on the lowest Cell, so when i press Enter the magical stuff happens?
Hope you can help me out!