Cancel
Showing results for 
Search instead for 
Did you mean: 

Okuma CSE Driver Parse error

Experimenter
Experimenter

I'm new to the ISV world. I've been through the online training, which was very helpful, however the Okuma CSE OOTB seems to be lacking a bit. I'd like to copy the OOTB, and make modifications to accommodate our posted output. 

Currently, I'm hung up on how to handle the following line for tool length compensation activation:

 

G56 Z3. HA (Where "A" is the the active tool number) if I modify the NC code to replace the "A" with an integer things work fine. 

The error I get is "Parse error after reading N15 G56 Z3. HA"

I tried modifying the meta code with an if statement to accommodate the "A", but I think the parser is set up to work with numbers not strings. 

Any help would be appreciated.

 

In one of the advanced presentations it was mentioned there are CSE files available for the asking, that may not have been supplied with the OOTB suite. Is it possible there is a more robust Okuma CSE available?

4 REPLIES

Re: Okuma CSE Driver Parse error

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

I am just learning OKUMA but I thought OKUMA local variables needed to be at least 2 letters?

G56 Z3. H[AT](this will parse)
G56 Z3. HA(this will not)

I am testing with sim05 okuma.

LMGi
www.TLMGi.com

Re: Okuma CSE Driver Parse error

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi,

 

I´m not really an epxert for OKUMA controller and therefore I can´t say that the NC Code is correct or not. But besides that I can give you some hints how you can implement the needed rules.

 

I suggest to go the pragmatic way by adding a token rule for 'HA' in Lex file.

NOTE: keep in mind the order dependency between the token rules. Therefore you have to add this rule before the def t_ADDRESS_OR_VARNAME(t): token rule

NOTE: don´t forget to add the token rule name to the token rule list at the beginning of the lex file

 

def t_HA_ADDRESS(t):
    r'HA'
    return t

In YACC file I simply added this as new numbered line rule:

    def p_numberedLine_16(self,p):
        '''numberedLine : HA_ADDRESS'''
        dictArgsNC = {}
        self.callFactory.CreateMetacodeCall(p[1], dictArgsNC)

It works without any parse error. Maybe the numberedLine rule is the wrong place and to universally in YACC due to my inexperience with OKUMA. So please check this

 

Thomas

Re: Okuma CSE Driver Parse error

Experimenter
Experimenter

Thank you for the response. The Okuma can use tool length activation as H1-999 or HA-C. When using HA the offset for the active tool will be used. HA is not a variable it is the H code followed by the letter A which instructs the control to use the active tool numbers tool offset value. Similar to Siemens 840D "D1" tool length activation.

Re: Okuma CSE Driver Parse error

Experimenter
Experimenter

Thank you Thomas,

I added the code, regrettably it did not work. I am new to Python, so forgive me for my lack of understanding. I am assuming when you noted "NOTE: don't forget to add the token rule name to the token rule list at the beginning of the lex file"  you were referring to the token map as shown below. 

 

I think what I'm looking for is a way to allow text or numbers to follow the H, then in the metacode I can make a decision on how to handle the value passed to the H. I'm not sure what I have to change to allow alphanumerics to be passed to the H code. As I mentioned before; the H is currently set up to activate tool length offsets, but it doesn't like letters. I'm attaching the page from the Okuma manual to help clarify the H code usage.

 

Thanks again

 

# Get the token map
tokens = (
    "PROGNAME", "INTEGER_VALUE", "FLOAT_VALUE", "STRING_VALUE", "COMMENT", "WHILE", "DO", "END", "UNARY_ARITHMETIC_OP", "D_UNARY_ARITHMETIC_OP",
    "ATAN2", "AND", "EOR", "OR", "NOT", "MOD", "BOOLOP", "NMSG", "MSG", "IF", "GOTO", "THEN", "CALL", "MODIN", "MODOUT",
    "FLOAT_ADDRESS", "IJK_ADDRESS", "AXIS_ADDRESS", "AXIS_ADDRESS_V", "INT_ADDRESS", "ASSIGN_ADDRESS", "RTS", "EOL",
    "VARNAME_PREFIX", "COMMON_VARNAME", "SYS_VARNAME", "LOCAL_VARNAME", "PRGFILE_NAME", "SEQUENCE_NAME",
    "PLUS", "MINUS", "TIMES", "DIVIDE", "WRITE", "READ", "PUT", "GET", "HA"

             )

Learn online





Solution Information