![background image](http://html1.mh-extra.com/html/omron/sysmac-cj-series/sysmac-cj-series_operation-manual_743585340.webp)
Practical examples
Section 5-2
328
'Omron Auto Generated - Units
'Warning: Automated code section - any manual code changes
'will be lost.
'Unit Variables reset
VR(diag01)=0
VR(diag02)=0
VR(diag03)=0
VR(system01)=0
'Unit Detection
' ML04 Unit
IF COMMSTYPE SLOT(0) <> 36 THEN
PRINT "Error Comms Type for unit 0 is not ML04"
SET_BIT(0,diag03)
ENDIF
' FL Unit
IF COMMSTYPE SLOT(1) <> 33 THEN
PRINT "Error Comms Type for unit 1 is not FL"
SET_BIT(1,diag03)
ENDIF
'Start Mechatrolink Section
'MECHATROLINK device detection for ML04 unit 0
IF READ_BIT(0,diag03) = 0 THEN
'Initialise Mechatrolink
MECHATROLINK(0,0)
' Device count
IF NOT MECHATROLINK(0,3,system01) THEN
PRINT "Error getting device count for ML04 unit 0"
SET_BIT(0,diag01)
ELSEIF VR(system01) <> 2 THEN
PRINT "Incorrect device count for ML04 unit 0"
SET_BIT(1,diag01)
ENDIF
' Check SJDE-02ANA-OY address
IF NOT MECHATROLINK(0,4,0,system01) THEN
PRINT "Error getting address for ML04 unit 0, station 0"
SET_BIT(0,diag02)
ELSEIF VR(system01) <> $43 THEN
PRINT "Incorrect address for ML04 unit 0, station 0"
SET_BIT(0,diag02)
ENDIF
' Check SJDE-02ANA-OY address
IF NOT MECHATROLINK(0,4,1,system01) THEN
PRINT "Error getting address for ML04 unit 0, station 1"
SET_BIT(1,diag02)
ELSEIF VR(system01) <> $44 THEN
PRINT "Incorrect address for ML04 unit 0, station 1"
SET_BIT(1,diag02)
ENDIF
Содержание SYSMAC CJ Series
Страница 2: ......
Страница 70: ...Specifications Section 2 4 58...
Страница 84: ...FINS commands Section 3 4 72...
Страница 148: ...All BASIC commands Section 4 2 136 AXIS 1 AXIS 0...
Страница 277: ...Section 265 SECTION 5 Examples This chapter gives 2 categories of examples and tips How to s Practical examples...
Страница 370: ...Section 358...