I'm working in C# to attempt a custom user screen for an industrial machine.
Would anyone be able to help with the basic code needed to SET and GET values from parameters such as #100?
private void Button_Click(object sender, RoutedEventArgs e)
{
returnCode = m_skin.parameter.SetMachineParameter(Skinning.Parameter(100), out double(txtBoxPara100.Text));
}
With that I'd like to store and use other decimal non-volatile parameter beyond #150-#159.
Maybe use unused areas like the Tools(#10001-#10200) or WCS tables(#3201-#3218)?
Skinning for an industrial CNC12 APP ---
Moderator: cnckeith
-
- Posts: 68
- Joined: Sun Nov 18, 2018 7:22 am
- Acorn CNC Controller: Yes
- Allin1DC CNC Controller: Yes
- Oak CNC controller: No
- CNC Control System Serial Number: CNC12-m39-104028
- DC3IOB: No
- CNC12: Yes
- CNC11: Yes
- CPU10 or CPU7: No
- Location: Western NY
Skinning for an industrial CNC12 APP ---
Rob Jackson
RJ Technical Services
RJ Technical Services
-
- Posts: 401
- Joined: Thu Dec 03, 2020 4:54 am
- Acorn CNC Controller: No
- Allin1DC CNC Controller: No
- Oak CNC controller: Yes
- CNC Control System Serial Number: none
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Re: Skinning for an industrial CNC12 APP ---
I have used the skinning DLL and it works well. I am not sure exactly what you are trying to achieve. I think the function you are calling is giving access to machine parameters, not the g code variables that you want to write to. I dont know that you can access g code variables from the skinning g dlls. You can access machine parameters 900-999 which are also accessible in g code which could be an option.
-
- Posts: 401
- Joined: Thu Dec 03, 2020 4:54 am
- Acorn CNC Controller: No
- Allin1DC CNC Controller: No
- Oak CNC controller: Yes
- CNC Control System Serial Number: none
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Re: Skinning for an industrial CNC12 APP ---
Also, I am not sure that the use of that function is correct. You are calling a Set function with an out parameter. I dont have the API documentation on hand so cant check.rjtechserv wrote: ↑Wed Jun 09, 2021 1:37 pm I'm working in C# to attempt a custom user screen for an industrial machine.
Would anyone be able to help with the basic code needed to SET and GET values from parameters such as #100?
private void Button_Click(object sender, RoutedEventArgs e)
{
returnCode = m_skin.parameter.SetMachineParameter(Skinning.Parameter(100), out double(txtBoxPara100.Text));
}
With that I'd like to store and use other decimal non-volatile parameter beyond #150-#159.
Maybe use unused areas like the Tools(#10001-#10200) or WCS tables(#3201-#3218)?
The skinning dll is pretty capable. I believe the VCP and the Plc inspector are built on top of it.
-
- Posts: 68
- Joined: Sun Nov 18, 2018 7:22 am
- Acorn CNC Controller: Yes
- Allin1DC CNC Controller: Yes
- Oak CNC controller: No
- CNC Control System Serial Number: CNC12-m39-104028
- DC3IOB: No
- CNC12: Yes
- CNC11: Yes
- CPU10 or CPU7: No
- Location: Western NY
Re: Skinning for an industrial CNC12 APP ---
Thanks for the reply! You are correct I blurred the Gcode variables with the machine parameters.
So my end game is to create a modular user-screen for industrial operators to adjust controlled parameters within a range not to crash a machine. A simple operator interface that I can take their offset input and add it the appropriate XYZ axis controls ( x[2.3+#9700] etc..
I've bought a C# book to help along. We'll see where this goes. So far this ROUGH code is some of my early testing things out.
I do have one other person helping me in the background as well but not sure if they want it to be known publicly. All good! Thanks for the input!
{
// This does SET the machine parameter 34 Spindle Encoder Counts/Revolution
m_skin.parameter.SetMachineParameter(34, Convert.ToDouble(txtBoxPar.Text));
// Adds a message to the Centroid Message Box if different from previous message; must change for different message)
m_skin.message_window.AddMessage(TextboxComWindow.Text, 255, 0);
// Sets tool diameter in table D1 to 36.3
m_skin.tool.SetToolDiameterOffsetAmout(1, 36.3);
// parameters 700-799 (use in CNC program ADD the #9 to 700 = X#9700)
m_skin.parameter.SetMachineParameter(700, 1.234);
}
So my end game is to create a modular user-screen for industrial operators to adjust controlled parameters within a range not to crash a machine. A simple operator interface that I can take their offset input and add it the appropriate XYZ axis controls ( x[2.3+#9700] etc..
I've bought a C# book to help along. We'll see where this goes. So far this ROUGH code is some of my early testing things out.
I do have one other person helping me in the background as well but not sure if they want it to be known publicly. All good! Thanks for the input!
{
// This does SET the machine parameter 34 Spindle Encoder Counts/Revolution
m_skin.parameter.SetMachineParameter(34, Convert.ToDouble(txtBoxPar.Text));
// Adds a message to the Centroid Message Box if different from previous message; must change for different message)
m_skin.message_window.AddMessage(TextboxComWindow.Text, 255, 0);
// Sets tool diameter in table D1 to 36.3
m_skin.tool.SetToolDiameterOffsetAmout(1, 36.3);
// parameters 700-799 (use in CNC program ADD the #9 to 700 = X#9700)
m_skin.parameter.SetMachineParameter(700, 1.234);
}
ashesman wrote: ↑Mon Jun 14, 2021 9:00 pmAlso, I am not sure that the use of that function is correct. You are calling a Set function with an out parameter. I dont have the API documentation on hand so cant check.rjtechserv wrote: ↑Wed Jun 09, 2021 1:37 pm I'm working in C# to attempt a custom user screen for an industrial machine.
Would anyone be able to help with the basic code needed to SET and GET values from parameters such as #100?
private void Button_Click(object sender, RoutedEventArgs e)
{
returnCode = m_skin.parameter.SetMachineParameter(Skinning.Parameter(100), out double(txtBoxPara100.Text));
}
With that I'd like to store and use other decimal non-volatile parameter beyond #150-#159.
Maybe use unused areas like the Tools(#10001-#10200) or WCS tables(#3201-#3218)?
The skinning dll is pretty capable. I believe the VCP and the Plc inspector are built on top of it.
Rob Jackson
RJ Technical Services
RJ Technical Services
-
- Posts: 401
- Joined: Thu Dec 03, 2020 4:54 am
- Acorn CNC Controller: No
- Allin1DC CNC Controller: No
- Oak CNC controller: Yes
- CNC Control System Serial Number: none
- DC3IOB: No
- CNC12: Yes
- CNC11: No
- CPU10 or CPU7: No
Re: Skinning for an industrial CNC12 APP ---
Code looks like it is all good. Just one thing is to always make sure to handle input errors. For example Convert.ToDouble can probably raise an exception. So if the user entered something wrong or out of range your program could crash. Do your input checking in a try catch block and then only proceed to set parameter if the input is valid.
-
- Posts: 68
- Joined: Sun Nov 18, 2018 7:22 am
- Acorn CNC Controller: Yes
- Allin1DC CNC Controller: Yes
- Oak CNC controller: No
- CNC Control System Serial Number: CNC12-m39-104028
- DC3IOB: No
- CNC12: Yes
- CNC11: Yes
- CPU10 or CPU7: No
- Location: Western NY
Re: Skinning for an industrial CNC12 APP ---
Thanks! Will do on the inputs...For sure!
Rob Jackson
RJ Technical Services
RJ Technical Services