cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use FIL to do conditional control?

mrao
Bedrock

How to use FIL to do conditional control?

Hello Programmer,

 

I need your help.

 

I found some sequences that Creo has generated “ROTATE” in the CL data (like following pictures), therefore, these sequences need to exchange GOTO positions by using FIL when Creo was posted tap file. Meanwhile, I also have some sequences that Creo has no generate “ROTATE” in CL data which are unnecessary to exchange GOTO positions. Therefore, I want to write FIL (conditionals control) to determine which sequence need to exchange GOTO position or not exchange. 

2017-9-4 下午 04-24-53.jpg2017-9-4 下午 04-25-14.jpg

 

Could you please teach me how to write a conditionals control in the FIL (IF….THEN….) to switch it when Creo  was generated “ROTATE”?

 

I wrote following FIL but Creo couldn’t work, just for your reference.

 

CIMFIL/ON,GOTO

WR=TEXT(ROTATE/CAXIS,INCR)

IF(WR.(ON))THEN

 DMY=POSTF(20)

 I1=POSTF(7,11)

 J1=POSTF(7,9)

 K1=POSTF(7,10)

 V1=VECTOR/I1,J1,K1

 M2D=DATA/CAM,2,V1 $$ USE VECTOR

 $$M2D=DATA/CAM,2,I1,J1,K1 $$ SAME AS ABOVE LINE

 TRANS/M2D

ENDIF

DMY=POSTF(21)

 DMY=POSTF(13)

 CIMFIL/OFF

 

Thanks so much

Have a good day!!

 

Mark Rao

Tags (3)
2 REPLIES 2

Re: How to use FIL to do conditional control?

The first thing you need to do is search for documentation of the FIL command language. You can't guess at the syntax for commands and expect them to work. For example, to define a variable WR that contains text, the correct syntax is

 

WR = TEXT/'I want WR to contain this text'

 

As for "WR.(ON)", where did this come from? That's not a logical construct I'm familiar with at all.

 

Processing of the CL file by the FIL code is akin to a tape reader. The CL file is parsed in a sequential fashion, so knowing if a C or B axis rotation has been set means you need to set a flag when the rotate commands are encountered. You need to do something like:

 

CIMFIL/ ON, ROTATE

$$ Set your flag based on which axis, maybe save the angle, etc.

CIMFIL/ OFF

 

Re: How to use FIL to do conditional control?

Hello Ken,

 

Thanks for your reply.

 Let me do more clear explain in my question, please take a look following explain, thanks!!

 

I use Mill-Turn type to create mfg file, in Mill-Turn type "Operation" setting, the coordinate Z point direction needs to be set Horizontal, but I found  the sequence coordinate only allow Z point direction for vertical. Therefore, the Mill-Turn type needs to create a coordinate which should be different with operation coordinate, because both Z point direction are different which caused coordinate positions are wrong in tap file.

 

2017-9-5 下午 03-17-53.jpg2017-9-5 下午 03-18-40.jpg

 

Therefore, I wrote FIL (as I following FIL shown) in the Gpost to exchange GOTO X and Z position, and then Creo can post coordinate in the right position in the tap file.

 

CIMFIL/ON,GOTO
DMY=POSTF(20)
I1=POSTF(7,11)
J1=POSTF(7,9)
K1=POSTF(7,10)
V1=VECTOR/I1,J1,K1
M2D=DATA/CAM,2,V1
TRANS/M2D
DMY=POSTF(21)
DMY=POSTF(13)
CIMFIL/OFF

 

But I still study FIL to switch different situation when Creo posted tap file, because Mill-Turn has two situations, one situation has no need to exchange GOTO position, but another one situation is need, please take a look  following two situation pictures.

2017-9-5 下午 04-05-24.jpg2017-9-5 下午 04-06-15.jpg

 

As I know, the first situation has "ROTATE/CAXIS" in the CL data, the second situation has no "ROTATE/CAXIS" in CL data, therefore, I want to write a conditional control to switch both situation when I posted different situations.

 

2017-9-4 上午 08-43-45.jpg

 

Could you please teach me how to write correct FIL to switch it?  Thanks!!

 

Have a good day!!

Mark Rao

 

 

 

 

Announcements