is external communication possible?

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

Post Reply
ceran
Posts: 2
Joined: Tue Aug 23, 2022 1:49 pm
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

is external communication possible?

Post by ceran »

I need to make a router table with a specific function which I've not found on any commercial units. I know its possible in the "M" software, but I've made machines based on it before, and don't relish the thought of doing so again. For that reason, I ask if the following scenario is possible on an Acorn:

-Operator pushes the cycle start button and the machine travels to a predefined position at which a fixture will have a permanent barcode/qrcode.
-Trigger the barcode reader ( permanently attached to the spindle head ) to read the code telling the control which program to run
-execute G-code and return to home

Many barcode readers can be directly controlled via the windows command line interface, both initiating a read and storing data in a specified path. Is there a method to access windows commands within a macro ( or similar function ) thus initiating the read, and then to read a returned value into a variable within the control telling it which program to execute?

This ends my question. The following is provided for informational purposes to explain why I want to do this. If anyone has an easier method to accomplish the same goals, I'd love to hear it.


We are currently thermoforming about 40 different, yet similar parts that require trimming. At any given time there may be 10 types currently being processed. I plan on making a router table with 4 pallet positions with all fixtures mounted to a pallet, all pallets mountable in any position. That way the person doing the thermoforming can place a formed part in the appropriate fixture and put the fixture in any position without having any technical ( CNC or computer ) knowledge to speak of. They press the GO button when the table is full, and the automatic operation limits the possibility that Murphy can intervene.
suntravel
Posts: 1967
Joined: Thu Sep 23, 2021 3:49 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 6433DB0446C1-08115074
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Germany

Re: is external communication possible?

Post by suntravel »

This should be possible.
One way would be that Acorn drives to the location reading the barcode
One Output activates the barcode reader, depending on the barcode the barcode reader activates inputs on Acorn
Acorn runs a program chosen by the inputs set from the barcode reader.

For 40 programs to chose, you need 6 inputs set by the barcode reader 40=101000

Uwe
eng199
Posts: 373
Joined: Fri Jan 10, 2014 11:29 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Location: Howard, PA

Re: is external communication possible?

Post by eng199 »

I haven't tried anything like this, but imagine something similar to these steps could work:

M130 - Run system command
Run the bar code scan batch file.


Batch file -
It appears that even simple bar codes can store text. The bar code could be the file name to run. I'll assume the file from your barcode reader will only include the barcode data (a filename). Create a new subprogram with the batch file, something like this:

@echo off
Set "barcodeFile=barcode.txt"
Set "outFile=runthis.cnc"
echo | set /p dummyName=M98 > %outFile%
for /f "delims=" %%a in ('Type "%barcodeFile%"') Do (
echo %%a >> %outFile% )
echo M99 >> %outFile%

where:
barcodeFile is the barcode reading (fileneme to run)
outFile is the subprogram that the main cnc file calls every time
the new contents of outFile is a Gcode subprogram to call the subprogram indicated by your bar code

The batch file runs asynchronously, so some method of determining when it completes is needed. G4 dwell would be a way to test, although some extra development would be needed for error checking the barcode read.


M98 - Call Subprogram
Run outFile created by the batch file, which will then call the desired program with another M98.
ceran
Posts: 2
Joined: Tue Aug 23, 2022 1:49 pm
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: is external communication possible?

Post by ceran »

eng199 wrote: Wed Aug 24, 2022 7:55 am I haven't tried anything like this, but imagine something similar to these steps could work:

M130 - Run system command
Run the bar code scan batch file.


Batch file -
It appears that even simple bar codes can store text. The bar code could be the file name to run. I'll assume the file from your barcode reader will only include the barcode data (a filename). Create a new subprogram with the batch file, something like this:

@echo off
Set "barcodeFile=barcode.txt"
Set "outFile=runthis.cnc"
echo | set /p dummyName=M98 > %outFile%
for /f "delims=" %%a in ('Type "%barcodeFile%"') Do (
echo %%a >> %outFile% )
echo M99 >> %outFile%

where:
barcodeFile is the barcode reading (fileneme to run)
outFile is the subprogram that the main cnc file calls every time
the new contents of outFile is a Gcode subprogram to call the subprogram indicated by your bar code

The batch file runs asynchronously, so some method of determining when it completes is needed. G4 dwell would be a way to test, although some extra development would be needed for error checking the barcode read.


M98 - Call Subprogram
Run outFile created by the batch file, which will then call the desired program with another M98.

This is pretty much exactly what I needed. Somehow in reading the manual I missed the M130 command. Once into the windows environment I'll have access to other scripting possibilities if needed to do what you suggest. I can set a really long dwell to allow time for the .bat to run since this step in production is not the bottleneck.

I don't think a whole lot of error checking will be required. At the beginning of the .bat file set the contents of the nested sub to an M99 only. Repeat that with a different M130 .bat call after executing the Gcode. If there is a barcode reader error, the possibility of it returning an incorrect yet valid filename is very, very remote. A bad read will trigger an error from the control since the M98 will point to a bad file name. If it reads nothing the blank sub program with only an M99 will return the machine home and it'll not actually do anything.

Thanks to both responders. I can proceed on this control with reasonable assurance that I can accomplish the original goal.
Post Reply