Page 1 of 1

Custom Input names and functions

Posted: Tue May 30, 2023 8:50 pm
by kman1967
In the Wizard when configuring inputs there is a custom section. Is there a tech note or instructions on how to add custom names and functions?

Re: Custom Input names and functions

Posted: Tue May 30, 2023 10:41 pm
by cnckeith
canned i/o names and functions can be added to the wizard. you'll have to learn how to program Centroid's PLC language if you want to do more than just rename an existing input or output name in the Wizard.

please tell us what you are trying to accomplish so we can give good advice.

Re: Custom Input names and functions

Posted: Wed May 31, 2023 3:49 pm
by kman1967
Right now I would just like to add custom names.

Re: Custom Input names and functions

Posted: Wed May 31, 2023 6:54 pm
by cnckeith
kman1967 wrote: Wed May 31, 2023 3:49 pm Right now I would just like to add custom names.
ok, please give an example

Re: Custom Input names and functions

Posted: Wed May 31, 2023 8:20 pm
by kman1967
Turn on an input when a vision system detects something wrong with an operation

Re: Custom Input names and functions

Posted: Wed May 31, 2023 8:27 pm
by cnckeith
kman1967 wrote: Wed May 31, 2023 8:20 pm Turn on an input when a vision system detects something wrong with an operation
and what would you like CNC12 to do when that input closes?

and if i knew more about the system/machine..would be really helpful.
http://centroidcncforum.com/viewtopic.php?f=60&t=1043

Re: Custom Input names and functions

Posted: Wed May 31, 2023 9:18 pm
by cncsnw
Since he already said he did not need custom PLC logic, presumably he is going to test in in CNC codes with M100/M101 or IF[#500xx].

The only reason to have the input defined in the PLC program at all, is for the documentation benefit, and so that the name will appear on the Alt-i screen and in PLC Detective.

The simplest way to do it is simply to edit it into your PLC program source. Leave the input unassigned in the Acorn Wizard, then add your input definition just outside the "#wizardregion" block of input definitions. E.g:

Code: Select all

; DO NOT MODIFY
; #wizardregion Inputs
EStopOk                   IS INP1
SpindleOk                 IS INP2
VFDZeroSpeed              IS INP3
;...
ToolIsUnclamped           IS INP41
ToolUnclampButton         IS INP42
; #endregion

; Inputs not defined in the Wizard
DustFootIsUp              IS INP38
ToolIsClamped             IS INP40
Of course, if you do a fresh install of a new version of Acorn CNC12, you will have to take steps to merge your custom definitions into the new standard PLC program.

Another alternative is to edit your C:\cncm\resources\wizard\default\plc\functions.xml file, to create one or more new "PlcFunction" blocks describing the tokens you want to create. Then you should be able to access them interactively in the Wizard, and drag them onto inputs or outputs as needed.

In that case, if you install a new version of Acorn CNC12, you will have to take steps to merge your custom definitions into the new functions.xml file.

Re: Custom Input names and functions

Posted: Thu Jun 01, 2023 5:45 pm
by cnckeith
thanks, i just wanted more details before i go off and do a big write up guessing at the goal that may not be applicable. as often i find that jumping to conclusions about editing the PLC program is completely unnecessary when you find out specifically what the user is trying to accomplish. :D
i still don't know what the heck the goal is. so i could theorize and provide how to advice on that but, i like better to understand and discuss the practical application/function that is desired and provide solutions to those specifics. :o