unary operations in linux

More
22 Sep 2022 03:19 #252548 by foam man
unary operations in linux was created by foam man
hi when i enter the following line into linux it says unary operation can be used

#<flange>= x2  y.5

i think i understand that its telling me i can use a single command, but which one?

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

More
22 Sep 2022 06:55 #252554 by Aciera
Replied by Aciera on topic unary operations in linux
I'm not sure what you are trying to do there but parameters can only be floating point values.

The only value type supported by parameters is floating-point; there are no string, boolean or integer types in G-code like in other programming languages. However, logic expressions can be formulated with boolean operators ( AND, OR, XOR, and the comparison operators EQ,NE,GT,GE,LT,LE), and the MOD, ROUND, FUP and FIX operators support integer arithmetic.

linuxcnc.org/docs/html/gcode/overview.html#_parameters

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

More
22 Sep 2022 07:00 #252555 by Aciera
Replied by Aciera on topic unary operations in linux
The message you are getting about unary operation is just an error message from the interpreter when it encounters an unexpected line of gcode.
The following user(s) said Thank You: tommylight

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

More
24 Sep 2022 02:39 #252649 by foam man
Replied by foam man on topic unary operations in linux
ok makes sense

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

More
24 Sep 2022 02:41 #252650 by foam man
Replied by foam man on topic unary operations in linux
what would be the best way to move 2 directions (but not simultaneously) with a single command

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

More
24 Sep 2022 16:41 #252668 by MaHa
Replied by MaHa on topic unary operations in linux
as a 'single command'  you can call a subroutine
o<flange> call [2] [0.5]

and place the subroutine with toolpath at the top of mainprogram.
o<flange> sub
G1 X#1 Y#2
o<flange> endsub

another exampl
o<flange> sub
G1 X#1
      Y#2
o<flange> endsub

 
The following user(s) said Thank You: tommylight

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

More
27 Sep 2022 02:30 #252824 by foam man
Replied by foam man on topic unary operations in linux
honestly i.m very new to cnc programing and whatever you have written up top is probably over my head, but can you elaborate just a little bit about excactly what those commands will do
thanks

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

More
27 Sep 2022 07:23 #252833 by Aciera
Replied by Aciera on topic unary operations in linux
Maybe have a look at the O code documentation:
linuxcnc.org/docs/html/gcode/o-code.html

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

More
28 Sep 2022 12:54 #252934 by Todd Zuercher
Replied by Todd Zuercher on topic unary operations in linux
Technically, it is not possible to make two separate moves with a single command.

What MaHa suggests is to create a small sub program that contains the 2 separate moves you are requesting, then you could use a single command to call that subprogram. The subprogram uses two variables for the distance of the separate X and Y moves that you have to specify the value of when you call the subprogram.

(or you can simply write the two separate moves explicitly in your g-code.)

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

Time to create page: 0.066 seconds
Powered by Kunena Forum