Page 1 of 1

MessageBox

Posted: Tue Jun 03, 2025 2:09 pm
by APCNC
Hello,Where can I find info on passing data to CentroidMessageBox.exe? Finally getting aquinted and building an acorn system. Starting off simple with 2 axis system and floating head. Ive realized over the years floating head as many words has been used as and come to mean something other than what it originated as. THC in this case but floating head originally means it rides or floats across on the material. Typically for light gauge sheet metal. If I refer the floating head, its not THC or voltage control, so were on the same page. That is turned off. XY axis only, no dual gantry bridge. Just the basics. Back to the point, I want to have a keyboard available but not necessary so everything can be done from the screen or control panel. In this particular instance Id like a backup msgbox to confirm intent before zeroing coordintates. Yes/No Ok/cancel msgbox etc would be fine or M222 if using confirmation like cycle start etc to confirm. I haven't found that if it is a possibility, but notice the CentroidMessageBox.exe but cannot find literature. Also will be using the API if that will have to be th goto for this, but have a way to go still. Thanks for any input.

Re: MessageBox

Posted: Wed Jun 04, 2025 8:35 am
by ASPeters
APCNC wrote: Tue Jun 03, 2025 2:09 pm Hello,Where can I find info on passing data to CentroidMessageBox.exe? Finally getting aquinted and building an acorn system. Starting off simple with 2 axis system and floating head. Ive realized over the years floating head as many words has been used as and come to mean something other than what it originated as. THC in this case but floating head originally means it rides or floats across on the material. Typically for light gauge sheet metal. If I refer the floating head, its not THC or voltage control, so were on the same page. That is turned off. XY axis only, no dual gantry bridge. Just the basics. Back to the point, I want to have a keyboard available but not necessary so everything can be done from the screen or control panel. In this particular instance Id like a backup msgbox to confirm intent before zeroing coordintates. Yes/No Ok/cancel msgbox etc would be fine or M222 if using confirmation like cycle start etc to confirm. I haven't found that if it is a possibility, but notice the CentroidMessageBox.exe but cannot find literature. Also will be using the API if that will have to be th goto for this, but have a way to go still. Thanks for any input.
CentroidMessageBox.exe is a dialog box application intended to replace System.Windows.MessageBox in the Wizard, PLC Diagnostic App, and other utility programs due to the limited custom-ability Microsoft provides. It is a public application and can be referenced in your code if you're inclined to use it but no documentation has been created for it.

M222 would be the best way to get a message box to appear during a job. It accepts user input via the keyboard. For your yes/no messagebox, it would look something like

Code: Select all

N100
M222 Q0 #101 " Press Y to Zero Coordinates. Press N to Exit"
IF #101 == 110 THEN GOTO 1000 ; N pressed, exit job
IF #101 != 121 THEN GOTO 100; Y wasn't pressed, go back to the message

... ; Additional logic. If Y was pressed, you'll end up here

N1000 ; End of job
Values for M222 keys can be found in cncx\system\setup_key_defines.cnc

The API does not currently have a way to display a popup message in the same way that M222 can. The closest thing to that is MessageWindow.AddMessage(...) which will add a message to this box
Capture6.PNG
Capture6.PNG (9.53 KiB) Viewed 261 times

Re: MessageBox

Posted: Wed Jun 04, 2025 5:43 pm
by APCNC
Thanks, Yes Ive already used M222. What Im looking for is not requiring the keyboard. Just click or push yes or ok on Msgbox. This would be for something like if you press zero positions to get confirmation that it is intentional.

Re: MessageBox

Posted: Wed Jun 04, 2025 7:01 pm
by APCNC
I used M225 with Start Cycle Button to confim. That should work out ok. Id still like any info on the CentroidMessageBox if anyone has info.