当前位置:网站首页>[trio basic from introduction to mastery tutorial XIV] trio realizes unit axis multi-color code capture
[trio basic from introduction to mastery tutorial XIV] trio realizes unit axis multi-color code capture
2022-07-05 08:01:00 【Changjiang houlang blog】
Hello everyone , I believe many friends have used or heard of the color code function .Trio Simple configuration of physical axis can realize the function of double color code .
TRIO The color code capture command used is shown in the following figure :
REGIST(20, channel, source, edge, window [,quantity, table_start])
We use A、B Two channels can capture the two-color code . If you want to realize the function of multi axis color code , Then we need special methods to deal with :
The method is as follows : Superimpose the desired snap axis position to the virtual axis , We capture the position of the virtual axis .
Be careful : Because the virtual axis is used , The hardware capture speed is less than the solid axis speed .
Next : Let's look directly at the code examples
'clear axis(3) motion buffer
BASE(3)
UNITS=1
CANCEL(2)
WAIT IDLE
WA(100)
DEFPOS(0)
WAIT UNTIL OFFPOS=0
WA(10)
BASE(4)
UNITS=1
DEFPOS(DPOS AXIS(3))
WAIT UNTIL OFFPOS=0
ADDAX(3)
BASE(3)
UNITS=1000
SPEED=1
DECEL=10
ACCEL=10
REG_INPUTS=$21
BASE(4)
UNITS=1000
SPEED=1
DECEL=10
ACCEL=10
WDOG=1
FORWARD AXIS(3)
'input in 1
REGIST(20, 0, 0, 0, 0) AXIS(3)
'input in 2
REGIST(20, 1, 0, 0, 0) AXIS(3)
'input in 3
REGIST(20, 3, 4, 0, 0) AXIS(4)
WHILE TRUE
IF MARK AXIS(3) THEN
PRINT "MarkA pos=",REG_POS AXIS(3)
WA(200)
REGIST(20, 0, 0, 0, 0) AXIS(3)
ENDIF
IF MARKB AXIS(3) THEN
PRINT "MarkB pos=",REG_POSB AXIS(3)
WA(200)
REGIST(20, 1, 0, 0, 0) AXIS(3)
ENDIF
IF MARK AXIS(4) THEN
PRINT "MarkC pos=",REG_POS AXIS(4)
WA(200)
REGIST(20, 3, 4, 0, 0) AXIS(4)
ENDIF
WEND
Test plan :IO Input 1,2,3 Short circuited together , The color code for certificate processing is triggered at the same time .IN1-2 Connected to the body axis 3 On ,IN3 Connected to virtual axis 4 On . Let's look at the actual operation results
The accuracy is within our range , Meet our testing requirements .
Thank you. ~~~
边栏推荐
- Cadence learning records
- C WinForm [exit application] - practice 3
- Live555 push RTSP audio and video stream summary (III) flower screen problem caused by pushing H264 real-time stream
- 1-stm32 operation environment construction
- matlab timeserise
- Global and Chinese market of peeled bourdon tubes 2022-2028: Research Report on technology, participants, trends, market size and share
- Altium Designer 19.1.18 - 隐藏某一个网络的飞线
- MySQL blind note common functions
- Some tips for using source insight (solve the problem of selecting all)
- 如何进行导电滑环选型
猜你喜欢
Application of ultra pure water particle counter in electronic semiconductors
Extended application of single chip microcomputer-06 independent key
Altium Designer 19.1.18 - 导入板框
Interview catalogue
Matlab2018b problem solving when installing embedded coder support package for stmicroelectronic
C language # and #
Win10 shortcut key
Network port usage
After installing the new version of keil5 or upgrading the JLINK firmware, you will always be prompted about the firmware update
研究發現,跨境電商客服系統都有這五點功能!
随机推荐
Step motor generates S-curve upper computer
High end electronic chips help upgrade traditional oil particle monitoring
How to excavate and research ideas from the paper
UEFI development learning 5 - simple use of protocol
Pointnet++ classification practice
Altium Designer 19.1.18 - 清除测量距离产生的信息
Ten thousand words detailed eight sorting must read (code + dynamic diagram demonstration)
C WinForm [help interface - send email] - practice five
[popular science] some interesting things that I don't know whether they are useful or not
String judgment
Relationship between line voltage and phase voltage, line current and phase current
STM32 knowledge points
研究发现,跨境电商客服系统都有这五点功能!
[untitled] record the visual shock of the Winter Olympics and the introduction of the display screen
Connection mode - bridge and net
How to migrate the device data accessed by the RTSP of the easycvr platform to easynvr?
Network port usage
Global and Chinese markets for recycled boilers 2022-2028: Research Report on technology, participants, trends, market size and share
mysql 盲注常见函数
Global and Chinese market of digital shore durometer 2022-2028: Research Report on technology, participants, trends, market size and share