O Code fatal errors

  • Nitram
  • Nitram's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
03 Jun 2019 00:10 #135677 by Nitram
O Code fatal errors was created by Nitram
Hi.

I have been writing some G code, using named variables and O codes.

I have it working now, so this is for future reference.

If the syntax is wrong, the program causes linuxcnc to have a fatal error and require shutting down. (Gmoccapy).

From the O code manual:
"To make these errors non-fatal warnings on stderr, set bit 0x20 in the [RS274NGC]FEATURE= mask ini option."

I currently have the .ini set thus:
[RS274NGC]
PARAMETER_FILE = linuxcnc.var
RS274NGC_STARTUP_CODE = G7 G18 G61 G97
FEATURES = 12

Firstly, the manual says feature(singular) whereas the .ini files I have seen say features(plural).
Secondly, I have only ever seen a numerical entry for this field. Can someone therefore enlighten me as to what the O code manual is inferring please?

Next time I do this, I am hoping to be able to have the g code error out, but without needing to restart linuxcnc, i.e. fix the code and try again. Following this I can return FEATURE(S) to the previous setting again.

Any thoughts?

Thanks,
Marty.

Please Log in or Create an account to join the conversation.

More
03 Jun 2019 01:25 #135682 by dgarrett
Replied by dgarrett on topic O Code fatal errors
The ini setting for [RS274NGC]FEATURES is a bitmask
Bit weights are typically specified in hexadecimal:
hex: 0x01  decimal:   1 binary: 00000001
hex: 0x02  decimal:   2 binary: 00000010
hex: 0x04  decimal:   4 binary: 00000100
hex: 0x08  decimal:   8 binary: 00001000
hex: 0x10  decimal:  16 binary: 00010000
hex: 0x20  decimal:  32 binary: 00100000
hex: 0x40  decimal:  64 binary: 01000000
hex: 0x80  decimal: 128 binary: 10000000

Ini entries for FEATURES are expressed in decimal.

So, to specify bits 4 and 8, use the decimal sum (4+8):
FEATURES=12

To specify bits 4,8, and 0x20, use the decimal sum (4+8+32):
FEATURES=44

Refs:
linuxcnc.org/docs/master/html/gcode/o-code.html
linuxcnc.org/docs/master/html/config/ini-config.html
linuxcnc.org/docs/master/html/remap/rema...l#remap:ini-features
The following user(s) said Thank You: tommylight, Nitram

Please Log in or Create an account to join the conversation.

  • Nitram
  • Nitram's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
03 Jun 2019 01:35 #135684 by Nitram
Replied by Nitram on topic O Code fatal errors
Excellent explanation.

Thanks kindly!!

Please Log in or Create an account to join the conversation.

Time to create page: 0.052 seconds
Powered by Kunena Forum