大家好,
我正在编程一个分拣单元,希望将托盘中的组件分拣到红色(基座2)或绿色(基座3)容器中。我已附上机器人程序的主要部分以及子程序。目前,机器人只将组件送到基座2(红色容器)。基座1定义在托盘下方的平台上。
我的想法是根据组件的某个属性(例如材料)进行分拣(例如,绿色组件放入绿色容器)。有人知道如何实现这一点,以及在IF语句中应使用什么条件吗?
(不倾向使用Python)
提前感谢。
大家好,
我正在编程一个分拣单元,希望将托盘中的组件分拣到红色(基座2)或绿色(基座3)容器中。我已附上机器人程序的主要部分以及子程序。目前,机器人只将组件送到基座2(红色容器)。基座1定义在托盘下方的平台上。
我的想法是根据组件的某个属性(例如材料)进行分拣(例如,绿色组件放入绿色容器)。有人知道如何实现这一点,以及在IF语句中应使用什么条件吗?
(不倾向使用Python)
提前感谢。
你好,
I don’t think it is possible to do it with the robot programming without programming a little bit in Python.
In case of just two different colours, you can have some other component read the component’s material and then send a true/false signal to the robot’s inputs. To the IF statement, you can write for example IN[100] to read input signal 100:s current value.Robot Statements
What do you mean by another component reading the components material?
How would I go about implementing this in my case?
Thank you in advance
Something like a process statement, sensor, or a …python script.
I agree with@Tilma: it seems that this is not doable without a little Python, and I don’t think there’s any ready components in eCatalog to read/measure the material.
对你来说很幸运,我的硬盘里正好有一个颜色传感器的示例。它会检测与其射线碰撞的第一个表面的颜色。
我为你快速修改了它,现在如果与射线碰撞的材质名称中含有“绿色”或“红色”,它就会发送布尔信号。将此传感器连接到机器人的第5或第6个连杆,通过发送脉冲信号进行测量,并在IF语句中使用前面提到的表达式。
颜色传感器.vcmx(17.9 KB)
你可以将此组件添加到你的布局中,并将其连接到你的夹爪上。
然后,你可以连接信号并在你的机器人程序中使用它们(如果需要,可以观看学院视频了解信号相关操作:机器人与信号 | Visual Components 学院)
What does the print in output panel say? Did you remember to send the pulse signal to take a measurement?
Many thanks for the advice. I will definitely consider doing it this way for the next project. I’ve already committed to doing the sorting cell with the Robot Program Editor, so I want to see it through.![]()
Hello, i’ve tried the color sensor but didn’t work, in the image the box is red and the red bit doesn’t turn on! Any solution?
Thanks in advance!
Did you send a PulseSignal to take the measurement? It’s only checking the color when the PulseSignal is triggered
没错,而且在建模选项卡中有一个隐藏参数可以修改,使其能够持续进行测量:
没想到是这样的。
谢谢!!这个社区真的很有帮助!!
PLC信号也是类似的。实际上,我尽量少用连接到机器人的信号。我更喜欢在PLC中完成所有编程,并示教机器人点位,然后由PLC告诉机器人应该移动到哪个位置。顺便问一下,有没有地方可以看看其他人的项目来获取灵感?
提前感谢!
你可以看看案例研究:案例研究 - Visual Components
我觉得大多数人不会分享他们的项目,因为很多项目可能涉及保密内容。不过,在论坛上你仍然可以找到大量关于他人已完成或正在进行的项目的实例。 --- Gnome558 2026年1月27日 下午4:05 20 你好, 如何实现其他颜色,比如蓝色或绿色? 我尝试修改了,但结果不对。 先谢谢了! fddfsfds (图片:820×785,40.9 KB) --- Tilma 2026年1月28日 下午2:59 21 你创建了一个新的布尔信号,并在Python脚本中引用它了吗? grafik (图片:1065×647,53.4 KB) 我稍微尝试了一下: Layout_Color_Sensor.vcmx (844.5 KB) 1人点赞 --- Gnome558 2026年1月28日 下午5:50 22 谢谢,现在黄色也能正常工作了!!!
Hello again,
How can do with other color such as blue or green?
I have edited but its wrong.
Thanks in advance!
Did you create a new Boolean Signal, and reference it in the Python script?
I had a bit of fun:
Layout_Color_Sensor.vcmx(844.5 KB)
Thanks now it also works with yellow!!!
您是本站第536252名访客 今日有0篇新文章/评论