frankNiessen/CAM2FIB

cannot open the example file

Closed this issue · 6 comments

Hi Frank
Today I tried to use CAM2FIB and then load the example files. But I got the following error messages. My matlab is 2020b.
Could you help me to solve this issue? Thanks, SH

*** Initializing
-> Opening gCode file 'Parallel_Optimized_13mm.nc
'Error using any
Invalid data type. First argument must be numeric or logical.

Error in contains (line 8)
out = any(strfind(str,pattern));

Error in CAM2FIB>gCode2beamPath (line 159)
tmp.dLine = min(find(any(contains(rawFile,'D='),2))); %Find line with beam diameter

Error in CAM2FIB (line 55)
[pos,bb.raw,opt,h] = gCode2beamPath(fNameFull,Out,f);

Hi,

I had a look at the example and I cannot reproduce your error, everything runs smoothely on my computer using MATLAB 2021b.

The error points at that the pattern "D=" is not found in the read-in G-code file.
The pattern can definitely be found on line three of the example file:

(T2 D=13 CR=0 - ZMIN=-6.016 - flat end mill)

So most likely already reading in the g-Code file does not work for you. Have you been succesful with the other example files?

Hi Frank
I checked other input files. All gave the similar errors. I do not why. I put all files in this folder: C:\MatlabApps\CAM2FIB-master\Input_Gfiles\Examples and file extension name is *.nc.
Thank you very much.
I will check the matlab code and the source file.
If any idea or suggestion, please let me know.
Thank you very much.
Best regards,
Shihong

Maybe due to other matlab apps which have the same contains function. Will check.

Yes, I found the reason. It is due to my other matlab apps. It is solved after remove my matlab apps to other folder.
Great. It works. Thanks.

Shihong

Great to hear your issue has been resolved!

Hi Frank
I got many warning messages like this
Warning: Number of points lower than number of bins.Number of bins was reduced

In CAM2FIB>interpBeamPath (line 382)

Shihong