Robots in Architecture Forum

KUKA|prc - parametric robot control for Grasshopper => Support => Topic started by: ziqiuhuang on August 18, 2023, 03:18:44 AM

Title: Add Digital Output Before and Behind every Linear movement
Post by: ziqiuhuang on August 18, 2023, 03:18:44 AM
Hi, Johannes,
I try to add 1 line of out put before and behind every line of G-code generated linear movement command. How can I realize it?
Can you offer me some help?
And I may need 4 output 1 line, I don't know how to combine output in 1 line.
Looking forward to your reply!
Thank you very much!
Best regards,
Ziqiu
Title: Re: Add Digital Output Before and Behind every Linear movement
Post by: Johannes @ Robots in Architecture on August 18, 2023, 09:34:46 AM
Hello,

Can you clarify that a bit? Assuming that you import G-code, you usually end up with a list of let's say 5 LIN commands. When you add an IO command before and after it would look like below:

From...
LIN {X...]
LIN {X...]
LIN {X...]
LIN {X...]
LIN {X...]
To...
$OUT[1]=TRUE
LIN {X...]
$OUT[1]=FALSE
$OUT[1]=TRUE
LIN {X...]
$OUT[1]=FALSE
$OUT[1]=TRUE
LIN {X...]
$OUT[1]=FALSE
$OUT[1]=TRUE
LIN {X...]
$OUT[1]=FALSE
$OUT[1]=TRUE
LIN {X...]
$OUT[1]=FALSE

Is that really what you are looking for?
Best,
Johannes
Title: Re: Add Digital Output Before and Behind every Linear movement
Post by: ziqiuhuang on August 18, 2023, 11:57:55 AM
Hi, Johannes,
You are right! It is what I try to achieve.
But I have too many commands, will that be okay for kuka|prc
Best regards,
Ziqiu
Title: Re: Add Digital Output Before and Behind every Linear movement
Post by: Johannes @ Robots in Architecture on August 18, 2023, 03:56:18 PM
Hello,

In that case, here is an example!

Best,
Johannes
Title: Re: Add Digital Output Before and Behind every Linear movement
Post by: ziqiuhuang on August 19, 2023, 01:43:16 AM
Thank you, Johannes,
That helped a lot.
Thank you very much!
Best regards,
Ziqiu