Page 1 of 1

Skinning for an industrial CNC12 APP ---

Posted: Wed Jun 09, 2021 1:37 pm
by rjtechserv
I'm working in C# to attempt a custom user screen for an industrial machine. :shock:

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

Re: Skinning for an industrial CNC12 APP ---

Posted: Mon Jun 14, 2021 8:50 pm
by ashesman
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.

Re: Skinning for an industrial CNC12 APP ---

Posted: Mon Jun 14, 2021 9:00 pm
by ashesman
rjtechserv wrote: Wed Jun 09, 2021 1:37 pm I'm working in C# to attempt a custom user screen for an industrial machine. :shock:

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)? :?:
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.

The skinning dll is pretty capable. I believe the VCP and the Plc inspector are built on top of it.

Re: Skinning for an industrial CNC12 APP ---

Posted: Tue Jun 15, 2021 7:51 am
by rjtechserv
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);
}

ashesman wrote: Mon Jun 14, 2021 9:00 pm
rjtechserv wrote: Wed Jun 09, 2021 1:37 pm I'm working in C# to attempt a custom user screen for an industrial machine. :shock:

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)? :?:
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.

The skinning dll is pretty capable. I believe the VCP and the Plc inspector are built on top of it.

Re: Skinning for an industrial CNC12 APP ---

Posted: Tue Jun 15, 2021 3:40 pm
by ashesman
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.

Re: Skinning for an industrial CNC12 APP ---

Posted: Tue Jun 15, 2021 5:32 pm
by rjtechserv
Thanks! Will do on the inputs...For sure!