Sign in to follow this  
Followers 0
johnirvin

Help PLs.

3 posts in this topic

CODE
For $ultimatectr = 2 to 4 Step +1

MouseClick("right", 160, 330)

MouseClick("left", 249, 373)

MouseClick("left", 413, 365)

MouseClick("left", 89, 363 + $adderx)

MouseClick("left", 108, 379 + $adderx)

MouseClick("right", 158, 379 + $adderx)

Send("n")

WinWait("Add card")

If Not WinActive("Add card") Then WinActivate("Add card")

WinWaitActive("Add card")

Send("!o")

MouseClick("left", 108, 379 + $adderx)

MouseClick("left", 179, 395 + $adderx)

MouseClick("left", 10, 28) ;file

MouseClick("left", 41, 188)

MouseClick("left", 260, 231)

WinWait("User Defined Export", "&Children of selected component")

If Not WinActive("User Defined Export", "&Children of selected component") Then WinActivate("User Defined Export", "&Children of selected component")

WinWaitActive("User Defined Export", "&Children of selected component")

Send("!n")

WinWait("User Defined Export", "&Expand All")

If Not WinActive("User Defined Export", "&Expand All") Then WinActivate("User Defined Export", "&Expand All")

WinWaitActive("User Defined Export", "&Expand All")

MouseClick("left", 340, 276)

Send("!n")

WinWait("Format source","&Create...")

If Not WinActive("Format source","&Create...") Then WinActivate("Format source","&Create...")

WinWaitActive("Format source","&Create...")

Send("D:\DeltaV\DVData\BulkEdit\RIO1Card.fmt")

Send("!n")

WinWait("Export target")

If Not WinActive("Export target") Then WinActivate("Export target")

WinWaitActive("Export target")

MouseClick("left", 352, 285)

Send("D:\DeltaV\DVData\BulkEdit\RIO1Card1.txt")

Send("!n")

Send("!y")

WinWait("Export results", "Export")

If Not WinActive("Export results", "Export") Then WinActivate("Export results", "Export")

WinWaitActive("Export results", "Export")

MouseMove(529,514)

MouseClick("left")

WinWait("Export results", "Finish")

If Not WinActive("Export results", "Finish") Then WinActivate("Export results", "Finish")

WinWaitActive("Export results", "Finish")

MouseMove(529,514)

MouseClick("left")

Send("{LWINDOWN}r{LWINUP}")

WinWait("Run")

If Not WinActive("Run") Then WinActivate("Run")

WinWaitActive("Run")

Send("excel")

MouseClick("left", 135, 703)

WinWait("Microsoft Excel - Book1")

If Not WinActive("Microsoft Excel - Book1") Then WinActivate("Microsoft Excel - Book1")

WinWaitActive("Microsoft Excel - Book1")

WinMove("Microsoft Excel - Book1", "", -4, -4, 1032, 746)

MouseMove(531,36)

MouseClick("left")

MouseMove(159,63)

MouseClick("left")

WinWait("Open Data File")

If Not WinActive("Open Data File") Then WinActivate("Open Data File")

WinWaitActive("Open Data File")

WinMove("Open Data File", "", -4, -4, 1032, 746)

Send("D:\DeltaV\DVData\BulkEdit\RIO1Card1.txt")

Send("!o")

WinWait("Unicode Detected")

If Not WinActive("Unicode Detected") Then WinActivate("Unicode Detected")

WinWaitActive("Unicode Detected")

MouseMove(512,488)

MouseClick("left")

WinWait("Microsoft Excel - RIO1Card1_ASCII")

If Not WinActive("Microsoft Excel - RIO1Card1_ASCII") Then WinActivate("Microsoft Excel - RIO1Card1_ASCII")

WinWaitActive("Microsoft Excel - RIO1Card1_ASCII")

MouseClickDrag("left", 90, 177, 104, 179)

MouseClickDrag("left", 169, 177, 210, 179)

MouseClickDrag("left", 275, 177, 296, 179)

MouseClickDrag("left", 363, 177, 401, 179)

MouseClickDrag("left", 465, 177, 506, 179)

MouseClickDrag("left", 570, 177, 595, 179)

MouseClick("left", 184, 65)

WinWait("Save Data File")

If Not WinActive("Save Data File") Then WinActivate("Save Data File")

WinWaitActive("Save Data File")

Send("RIO1Card1_ASCII.TXT")

Send("!s")

WinWaitActive("Microsoft Office Excel")

Send("!y")

MouseMove(21,23)

MouseClick("left")

MouseClick("left", 75, 428)

MouseClick("left", 1015, 9)

Run("C:\DeltaV\bin\exp.exe ")

WinWait("Exploring DeltaV")

If Not WinActive("Exploring DeltaV") Then WinActivate("Exploring DeltaV")

WinWaitActive("Exploring DeltaV")

WinMove("Exploring DeltaV", "", -4, -4, 1032, 748)

MouseClick("left", 14, 26)

MouseClick("left", 37, 173)

MouseClick("left", 232, 190)

WinWait("Format source")

If Not WinActive("Format source") Then WinActivate("Format source")

WinWaitActive("Format source")

Send("D:\DeltaV\DVData\BulkEdit\RIO1Card.fmt")

Send("!n")

WinWait("Import data source")

If Not WinActive("Import data source") Then WinActivate("Import data source")

WinWaitActive("Import data source")

MouseClick("left", 364, 281)

Send("D:\DeltaV\DVData\BulkEdit\RIO1Card1_ASCII.TXT")

Send("!n")

WinWait("Import results")

If Not WinActive("Import results") Then WinActivate("Import results")

WinWaitActive("Import results")

Send("!i")

WinWait("Import complete")

If Not WinActive("Import complete") Then WinActivate("Import complete")

WinWaitActive("Import complete")

Send("{Enter}")

;========================================================Default Format Export with Modification===================================================================================

Send("{LWINDOWN}r{LWINUP}")

WinWait("Run")

If Not WinActive("Run") Then WinActivate("Run")

WinWaitActive("Run")

Send("excel")

MouseClick("left", 135, 703)

WinWait("Microsoft Excel - Book1")

If Not WinActive("Microsoft Excel - Book1") Then WinActivate("Microsoft Excel - Book1")

WinWaitActive("Microsoft Excel - Book1")

WinMove("Microsoft Excel - Book1", "", -4, -4, 1032, 746)

MouseMove(531,36)

MouseClick("left")

MouseMove(159,63)

MouseClick("left")

WinWait("Open Data File")

If Not WinActive("Open Data File") Then WinActivate("Open Data File")

WinWaitActive("Open Data File")

WinMove("Open Data File", "", -4, -4, 1032, 746)

Send("D:\DeltaV\DVData\BulkEdit\RIO1Card1.txt")

Send("!o")

WinWait("Unicode Detected")

If Not WinActive("Unicode Detected") Then WinActivate("Unicode Detected")

WinWaitActive("Unicode Detected")

MouseClick("left",512,488)

WinWait("Microsoft Excel - RIO1Card1_ASCII")

If Not WinActive("Microsoft Excel - RIO1Card1_ASCII") Then WinActivate("Microsoft Excel - RIO1Card1_ASCII")

WinWaitActive("Microsoft Excel - RIO1Card1_ASCII")

MouseClickDrag("left", 90, 177, 104, 179)

MouseClickDrag("left", 169, 177, 210, 179)

MouseClickDrag("left", 275, 177, 296, 179)

MouseClickDrag("left", 363, 177, 401, 179)

MouseClickDrag("left", 465, 177, 506, 179)

MouseClickDrag("left", 570, 177, 595, 179)

MouseClick("left", 545, 217)

MouseClick("left", 114, 63)

WinWait("rio_scan_rate")

If Not WinActive("rio_scan_rate") Then WinActivate("rio_scan_rate")

WinWaitActive("rio_scan_rate")

MouseClick("left", 552, 395)

MouseClick("left", 548, 413)

MouseClick("left", 629, 362)

MouseClick("left", 337, 220)

MouseClick("left", 116, 62)

WinWait("rioz1_card_type")

If Not WinActive("rioz1_card_type") Then WinActivate("rioz1_card_type")

WinWaitActive("rioz1_card_type")

MouseClick("left", 577, 397)

MouseClick("left", 579, 428)

MouseClick("left", 634, 364)

MouseClick("left", 184, 65)

WinWait("Save Data File")

If Not WinActive("Save Data File") Then WinActivate("Save Data File")

WinWaitActive("Save Data File")

Send("RIO1Card1_ASCII.TXT")

Send("!s")

WinWaitActive("Microsoft Office Excel")

Send("!y")

MouseMove(21,23)

MouseClick("left")

MouseClick("left", 75, 428)

MouseClick("left", 1015, 9)

Run("C:\DeltaV\bin\exp.exe ")

WinWait("Exploring DeltaV")

If Not WinActive("Exploring DeltaV") Then WinActivate("Exploring DeltaV")

WinWaitActive("Exploring DeltaV")

WinMove("Exploring DeltaV", "", -4, -4, 1032, 748)

MouseClick("left", 14, 26)

MouseClick("left", 37, 173)

MouseClick("left", 232, 190)

WinWait("Format source")

If Not WinActive("Format source") Then WinActivate("Format source")

WinWaitActive("Format source")

Send("D:\DeltaV\DVData\BulkEdit\RIO1Card.fmt")

Send("!n")

WinWait("Import data source")

If Not WinActive("Import data source") Then WinActivate("Import data source")

WinWaitActive("Import data source")

MouseClick("left", 364, 281)

Send("D:\DeltaV\DVData\BulkEdit\RIO1Card1_ASCII.TXT")

Send("!n")

WinWait("Import results")

If Not WinActive("Import results") Then WinActivate("Import results")

WinWaitActive("Import results")

Send("!i")

WinWait("Import complete")

If Not WinActive("Import complete") Then WinActivate("Import complete")

WinWaitActive("Import complete")

Send("{Enter}")

MouseClick("left", 179, 395 + $adderx)

MouseMove(10,27)

MouseClick("left")

MouseMove(68,152)

MouseClick("left")

MouseMove(218,153)

MouseClick("left")

WinWait("Format specification - General")

If Not WinActive("Format specification - General") Then WinActivate("Format specification - General")

WinWaitActive("Format specification - General")

Send("RO1")

Send("!n")

Send("!y")

WinWait("Format specification - Select fields")

If Not WinActive("Format specification - Select fields") Then WinActivate("Format specification - Select fields")

WinWaitActive("Format specification - Select fields")

Send("c")

Send("!b")

WinWait("Browse")

If Not WinActive("Browse") Then WinActivate("Browse")

WinWaitActive("Browse")

MouseClick("left", 330, 348)

Send("{enter}")

MouseClick("left", 299, 329)

Send("{enter}")

MouseClick("left", 296, 330)

MouseClick("left", 721, 323)

MouseClick("left", 293, 328)

MouseClick("left", 721, 323)

WinWait("Format specification - Select fields")

If Not WinActive("Format specification - Select fields") Then WinActivate("Format specification - Select fields")

WinWaitActive("Format specification - Select fields")

MouseClick("left", 511, 365)

Send("!n")

WinWait("Format specification - Field order")

If Not WinActive("Format specification - Field order") Then WinActivate("Format specification - Field order")

WinWaitActive("Format specification - Field order")

Send("!n")

WinWait("Format specification - Must exist")

If Not WinActive("Format specification - Must exist") Then WinActivate("Format specification - Must exist")

WinWaitActive("Format specification - Must exist")

MouseClick("left", 575, 582)

MouseClick("left", 179, 395 + $adderx)

MouseClick("left", 10, 28)

MouseClick("left", 41, 188)

MouseClick("left", 260, 231)

WinWait("User Defined Export", "&Children of selected component")

If Not WinActive("User Defined Export", "&Children of selected component") Then WinActivate("User Defined Export", "&Children of selected component")

WinWaitActive("User Defined Export", "&Children of selected component")

Send("!n")

WinWait("User Defined Export", "&Expand All")

If Not WinActive("User Defined Export", "&Expand All") Then WinActivate("User Defined Export", "&Expand All")

WinWaitActive("User Defined Export", "&Expand All")

MouseClick("left", 340, 276)

Send("!n")

WinWait("Format source","&Create...")

If Not WinActive("Format source","&Create...") Then WinActivate("Format source","&Create...")

WinWaitActive("Format source","&Create...")

Send("D:\DeltaV\DVData\BulkEdit\RIO1Card.fmt")

Send("!n")

WinWait("Export target")

If Not WinActive("Export target") Then WinActivate("Export target")

WinWaitActive("Export target")

MouseClick("left", 352, 285)

Send("D:\DeltaV\DVData\BulkEdit\RIO1Card1.txt")

Send("!n")

Send("!y")

WinWait("Export results", "Export")

If Not WinActive("Export results", "Export") Then WinActivate("Export results", "Export")

WinWaitActive("Export results", "Export")

MouseMove(529,514)

MouseClick("left")

WinWait("Export results", "Finish")

If Not WinActive("Export results", "Finish") Then WinActivate("Export results", "Finish")

WinWaitActive("Export results", "Finish")

MouseMove(529,514)

MouseClick("left")

Send("{LWINDOWN}r{LWINUP}")

WinWait("Run")

If Not WinActive("Run") Then WinActivate("Run")

WinWaitActive("Run")

Send("excel")

MouseClick("left", 135, 703)

WinWait("Microsoft Excel - Book1")

If Not WinActive("Microsoft Excel - Book1") Then WinActivate("Microsoft Excel - Book1")

WinWaitActive("Microsoft Excel - Book1")

WinMove("Microsoft Excel - Book1", "", -4, -4, 1032, 746)

MouseMove(531,36)

MouseClick("left")

MouseMove(159,63)

MouseClick("left")

WinWait("Open Data File")

If Not WinActive("Open Data File") Then WinActivate("Open Data File")

WinWaitActive("Open Data File")

WinMove("Open Data File", "", -4, -4, 1032, 746)

Send("D:\DeltaV\DVData\BulkEdit\RIO1Card1.txt")

Send("!o")

WinWait("Unicode Detected")

If Not WinActive("Unicode Detected") Then WinActivate("Unicode Detected")

WinWaitActive("Unicode Detected")

MouseMove(512,488)

MouseClick("left")

WinWait("Microsoft Excel - RIO1Card1_ASCII")

If Not WinActive("Microsoft Excel - RIO1Card1_ASCII") Then WinActivate("Microsoft Excel - RIO1Card1_ASCII")

WinWaitActive("Microsoft Excel - RIO1Card1_ASCII")

MouseClickDrag("left", 90, 177, 104, 179)

MouseClickDrag("left", 169, 177, 210, 179)

MouseClickDrag("left", 275, 177, 296, 179)

MouseClickDrag("left", 363, 177, 401, 179)

MouseClickDrag("left", 465, 177, 506, 179)

MouseClickDrag("left", 570, 177, 595, 179)

$a = 0

$b = 0

For $i = 1 to 4 Step +1

MouseClick("left", 543, 220+$a)

MouseClick("left", 117, 64)

WinWait("rio_scan_rate")

If Not WinActive("rio_scan_rate") Then WinActivate("rio_scan_rate")

WinWaitActive("rio_scan_rate")

MouseClick("left", 552, 395)

MouseClick("left", 551, 410+$:D

MouseClick("left", 630, 364)

$a = $a + 19

$b = $b + 15

Next

$a = 0

$b = 0

For $i = 1 to 3 Step +1

MouseClick("left", 343, 236+$a)

MouseClick("left", 115, 64)

WinWait("rioz1_card_type")

If Not WinActive("rioz1_card_type") Then WinActivate("rioz1_card_type")

WinWaitActive("rioz1_card_type")

MouseClick("left", 575, 395)

If $b = 0 Then

MouseClick("left", 572, 425)

$b=1

Else

MouseClick("left", 571, 415)

$b=0

EndIf

MouseClick("left", 630, 364)

$a = $a + 19

Next

MouseClick("left", 253, 217)

MouseClickDrag("left", 291, 224, 291, 281)

MouseClick("left", 151, 220)

Send("{CTRLDOWN}c{CTRLUP}")

MouseClickDrag("left", 114, 236, 160, 275)

Send("{CTRLDOWN}v{CTRLUP}")

MouseClick("left", 184, 65)

WinWait("Save Data File")

If Not WinActive("Save Data File") Then WinActivate("Save Data File")

WinWaitActive("Save Data File")

Send("RIO1Card1_ASCII.TXT")

Send("!s")

WinWaitActive("Microsoft Office Excel")

Send("!y")

MouseMove(21,23)

MouseClick("left")

MouseClick("left", 75, 428)

MouseClick("left", 1015, 9)

Run("C:\DeltaV\bin\exp.exe ")

WinWait("Exploring DeltaV")

If Not WinActive("Exploring DeltaV") Then WinActivate("Exploring DeltaV")

WinWaitActive("Exploring DeltaV")

WinMove("Exploring DeltaV", "", -4, -4, 1032, 748)

MouseClick("left", 14, 26)

MouseClick("left", 37, 173)

MouseClick("left", 232, 190)

WinWait("Format source")

If Not WinActive("Format source") Then WinActivate("Format source")

WinWaitActive("Format source")

Send("D:\DeltaV\DVData\BulkEdit\rio1.fmt")

Send("!n")

WinWait("Import data source")

If Not WinActive("Import data source") Then WinActivate("Import data source")

WinWaitActive("Import data source")

MouseClick("left", 364, 281)

Send("D:\DeltaV\DVData\BulkEdit\RIO1Card1_ASCII.TXT")

Send("!n")

WinWait("Import results")

If Not WinActive("Import results") Then WinActivate("Import results")

WinWaitActive("Import results")

Send("!i")

WinWait("Import complete")

If Not WinActive("Import complete") Then WinActivate("Import complete")

WinWaitActive("Import complete")

Send("{Enter}")

;================================

;======================================================================Channel======================

===================================

MouseClick(127, 298 + $adder)

MouseClick("left", 189, 316 + $adder)

MouseClick("left", 10, 27)

MouseClick("left", 55, 151)

MouseClick("left", 217, 152)

WinWait("Format specification - General")

If Not WinActive("Format specification - General") Then WinActivate("Format specification - General")

WinWaitActive("Format specification - General")

Send("D:\DeltaV\DVData\BulkEdit\channel1.fmt")

Send("!n")

Send("!y")

WinWait("Format specification - Select fields")

If Not WinActive("Format specification - Select fields") Then WinActivate("Format specification - Select fields")

WinWaitActive("Format specification - Select fields")

Send("ch")

MouseClick("left", 511, 365)

Send("!n")

WinWait("Format specification - Field order")

If Not WinActive("Format specification - Field order") Then WinActivate("Format specification - Field order")

WinWaitActive("Format specification - Field order")

Send("!n")

WinWait("Format specification - Must exist")

If Not WinActive("Format specification - Must exist") Then WinActivate("Format specification - Must exist")

WinWaitActive("Format specification - Must exist")

MouseClick("left", 575, 582)

MouseClick("left", 10, 28)

MouseClick("left", 41, 188)

MouseClick("left", 260, 231)

WinWait("User Defined Export", "&Children of selected component")

If Not WinActive("User Defined Export", "&Children of selected component") Then WinActivate("User Defined Export", "&Children of selected component")

WinWaitActive("User Defined Export", "&Children of selected component")

Send("!n")

WinWait("User Defined Export", "&Expand All")

If Not WinActive("User Defined Export", "&Expand All") Then WinActivate("User Defined Export", "&Expand All")

WinWaitActive("User Defined Export", "&Expand All")

MouseClick("left", 340, 276)

Send("!n")

WinWait("Format source","&Create...")

If Not WinActive("Format source","&Create...") Then WinActivate("Format source","&Create...")

WinWaitActive("Format source","&Create...")

Send("D:\DeltaV\DVData\BulkEdit\channel1.fmt")

Send("!n")

WinWait("Export target")

If Not WinActive("Export target") Then WinActivate("Export target")

WinWaitActive("Export target")

MouseClick("left", 352, 285)

Send("D:\DeltaV\DVData\BulkEdit\channel1.txt")

Send("!n")

Send("!y")

WinWait("Export results", "Export")

If Not WinActive("Export results", "Export") Then WinActivate("Export results", "Export")

WinWaitActive("Export results", "Export")

MouseMove(529,514)

MouseClick("left")

WinWait("Export results", "Finish")

If Not WinActive("Export results", "Finish") Then WinActivate("Export results", "Finish")

WinWaitActive("Export results", "Finish")

MouseMove(529,514)

MouseClick("left")

;===================================================================================================

===========================

Send("{LWINDOWN}r{LWINUP}")

WinWait("Run")

If Not WinActive("Run") Then WinActivate("Run")

WinWaitActive("Run")

Send("excel")

MouseClick("left", 135, 703)

WinWait("Microsoft Excel - Book1")

If Not WinActive("Microsoft Excel - Book1") Then WinActivate("Microsoft Excel - Book1")

WinWaitActive("Microsoft Excel - Book1")

WinMove("Microsoft Excel - Book1", "", -4, -4, 1032, 746)

MouseMove(531,36)

MouseClick("left")

MouseMove(159,63)

MouseClick("left")

WinWait("Open Data File")

If Not WinActive("Open Data File") Then WinActivate("Open Data File")

WinWaitActive("Open Data File")

WinMove("Open Data File", "", -4, -4, 1032, 746)

Send("D:\DeltaV\DVData\BulkEdit\channel1.txt")

Send("!o")

WinWait("Unicode Detected")

If Not WinActive("Unicode Detected") Then WinActivate("Unicode Detected")

WinWaitActive("Unicode Detected")

MouseMove(512,488)

MouseClick("left")

WinWait("Microsoft Excel - channel1_ASCII")

If Not WinActive("Microsoft Excel - channel1_ASCII") Then WinActivate("Microsoft Excel - channel1_ASCII")

WinWaitActive("Microsoft Excel - channel1_ASCII")

;===================================================================================================

============================

;================================================

Func _channeltype()

WinWait("channel_type")

If Not WinActive("channel_type") Then WinActivate("channel_type")

WinWaitActive("channel_type")

MouseClick("left", 567, 387)

EndFunc

Func _dragZ1()

MouseClickDrag("left", 568, 420, 566, 481)

EndFunc

MouseClickDrag("left", 90, 183, 188, 183)

MouseClickDrag("left", 251, 183, 294, 183)

MouseClickDrag("left", 422, 183, 453, 183)

MouseClickDrag("left", 517, 183, 617, 183)

MouseClickDrag("left", 681, 183, 744, 183)

MouseClick("left", 536, 218)

Send("{CTRLDOWN}c{CTRLUP}")

MouseClickDrag("left", 532, 238, 515, 515)

Send("{CTRLDOWN}v{CTRLUP}")

MouseClick("left", 526, 539)

$determinant = 1

For $john = 1 to 8 Step +1

MouseClick("left", 119, 66)

_channeltype()

_dragZ1()

If $determinant = 1 Then

MouseClick("left", 526, 417) ;click Zone1 DO Channel

MouseClick("left", 623, 362) ;select

$determinant = 2

Send("{down}")

ContinueLoop

EndIf

If $determinant = 2 Then

MouseClick("left", 542, 430) ;click Zone1 MO Channel

MouseClick("left", 623, 362) ;select

$determinant = 3

Send("{down}")

ContinueLoop

EndIf

If $determinant = 3 Then

MouseClick("left", 514, 444) ;click Zone1 CP Channel

MouseClick("left", 623, 362) ;select

$determinant = 1

Send("{down}")

ContinueLoop

EndIf

Next

For $a = 1 to 5 Step +1

MouseClick("left", 1012, 188)

Next

;===================================================================================================

===========================

;===================================================== Description ============================================================

MouseClick("left", 92, 217)

Send("{CTRLDOWN}c{CTRLUP}")

MouseClickDrag("left", 100, 238, 100, 681)

Send("{CTRLDOWN}v{CTRLUP}")

;===================================================== Node Name ==============================================================

MouseClick("left", 241, 217)

Send("{CTRLDOWN}c{CTRLUP}")

MouseClickDrag("left", 240, 238, 240, 681)

Send("{CTRLDOWN}v{CTRLUP}")

;===================================================== Card Slot ==============================================================

MouseClick("left", 327, 217)

Send("{CTRLDOWN}c{CTRLUP}")

MouseClickDrag("left", 326, 238, 326, 681)

Send("{CTRLDOWN}v{CTRLUP}")

;===================================================== Channel Slot ===========================================================

MouseClick("left", 405, 217)

MouseClickDrag("left", 451, 225, 430, 683)

;===================================================== device signal tag ======================================================

MouseClick("left", 676, 217)

Send("RIO")

Send($ultimatectr)

Send("DICD1CH1")

MouseClickDrag("left", 744, 226, 740, 684)

;=========================================================== Enable ===========================================================

MouseClick("left", 783, 223)

MouseClick("left", 119, 66)

WinWait("enable")

If Not WinActive("enable") Then WinActivate("enable")

WinWaitActive("enable")

MouseClick("left", 436, 393)

MouseClick("left", 436, 414)

MouseClick("left", 641, 363)

MouseClick("left", 783, 223)

MouseClickDrag("left", 807, 226, 803, 682)

;=========================================================== ************* =====================================================

MouseClick("left", 838, 219)

MouseClickDrag("left", 38, 218, 786, 671)

Send("{CTRLDOWN}c{CTRLUP}")

For $a = 1 to 3 Step +1

MouseClick("left", 1018, 695)

Next

MouseClick("left", 95, 639)

Send("{CTRLDOWN}v{CTRLUP}")

For $a = 1 to 21 Step +1

MouseClick("left", 1018, 695)

Next

MouseClick("left", 329, 217)

Send("2")

Send("{DOWN}")

Send("{UP}")

Send("{CTRLDOWN}c{CTRLUP}")

MouseClickDrag("left", 325, 238, 318, 679)

Send("{CTRLDOWN}v{CTRLUP}")

MouseClick("left", 647, 218)

Send("RIO")

Send($ultimatectr)

Send("DICD2CH1")

MouseClickDrag("left", 744, 224, 742, 683)

;==================================================Card 3=======================================================================

For $a = 1 to 20 Step +1

MouseClick("left", 1018, 695)

Next

MouseClick("left", 90, 298)

Send("Analog Input Channel")

MouseClickDrag("left", 187, 306, 183, 453)

MouseClick("left", 95, 459)

Send("Analog Output Channel")

MouseClickDrag("left", 187, 466, 186, 524)

MouseClick("left", 240, 277)

Send("{CTRLDOWN}c{CTRLUP}")

MouseClickDrag("left", 237, 298, 230, 522)

Send("{CTRLDOWN}v{CTRLUP}")

MouseClick("left", 324, 278)

Send("{CTRLDOWN}c{CTRLUP}")

Send("{DOWN}")

Send("{CTRLDOWN}v{CTRLUP}")

Send("3")

Send("{UP}")

Send("{DOWN}")

Send("{CTRLDOWN}c{CTRLUP}")

MouseClickDrag("left", 323, 319, 320, 518)

Send("{CTRLDOWN}v{CTRLUP}")

MouseClick("left", 406, 276)

Send("{CTRLDOWN}c{CTRLUP}")

Send("{DOWN}")

Send("{CTRLDOWN}v{CTRLUP}")

Send("1")

MouseClickDrag("left", 453, 307, 451, 523)

$determinant = 1

MouseClick("left", 529, 298)

For $john = 1 to 12 Step +1

MouseClick("left", 119, 66)

_channeltype()

MouseClickDrag("left", 568, 420, 566, 485)

If $john < 9 Then

If $determinant = 1 Then

MouseClick("left", 517, 456) ;click AI_CHAN

MouseClick("left", 623, 362) ;select

$determinant = 2

Send("{DOWN}")

ContinueLoop

EndIf

If $determinant = 2 Then

MouseClick("left", 517, 470) ;click AI_HART

MouseClick("left", 623, 362) ;select

$determinant = 1

Send("{DOWN}")

ContinueLoop

EndIf

EndIf

If $john > 8 Then

If $determinant = 1 Then

MouseClick("left", 517, 482) ;Click AO_CHAN

MouseClick("left", 623, 362) ;select

$determinant = 2

Send("{DOWN}")

ContinueLoop

EndIf

If $determinant = 2 Then

MouseClick("left", 517, 496) ;Click AO_ENABLED_HART

MouseClick("left", 623, 362) ;select

$determinant = 1

Send("{DOWN}")

ContinueLoop

EndIf

EndIf

Next

MouseClick("left", 677, 279)

Send("{CTRLDOWN}c{CTRLUP}")

Send("{DOWN}")

Send("{CTRLDOWN}v{CTRLUP}")

Send("RIO")

Send($ultimatectr)

Send("DICD3CH1")

MouseClickDrag("left", 744, 306, 736, 525)

MouseClick("left", 775, 278)

MouseClickDrag("left", 807, 285, 805, 522)

;==================================================Card 4=======================================================================

For $john = 1 to 45 Step +1

MouseClick("left", 1017, 182)

Next

MouseClick("left", 838, 219)

MouseClickDrag("left", 38, 218, 786, 671)

Send("{CTRLDOWN}c{CTRLUP}")

For $a = 1 to 60 Step +1

MouseClick("left", 1018, 695)

Next

MouseClick("left", 104, 217)

Send("{CTRLDOWN}v{CTRLUP}")

MouseClick("left", 329, 217)

Send("4")

Send("{DOWN}")

Send("{UP}")

Send("{CTRLDOWN}c{CTRLUP}")

MouseClickDrag("left", 325, 238, 318, 679)

Send("{CTRLDOWN}v{CTRLUP}")

MouseClick("left", 647, 218)

Send("RIO")

Send($ultimatectr)

Send("DICD4CH1")

MouseClickDrag("left", 744, 224, 742, 683)

;========================================================Save and Import=======================================================

MouseClick("left", 184, 65)

WinWait("Save Data File")

If Not WinActive("Save Data File") Then WinActivate("Save Data File")

WinWaitActive("Save Data File")

Send("channel1_ASCII.TXT")

Send("!s")

WinWaitActive("Microsoft Office Excel")

Send("!y")

MouseMove(21,23)

MouseClick("left")

MouseClick("left", 75, 428)

MouseClick("left", 1015, 9)

Run("C:\DeltaV\bin\exp.exe ")

WinWait("Exploring DeltaV")

If Not WinActive("Exploring DeltaV") Then WinActivate("Exploring DeltaV")

WinWaitActive("Exploring DeltaV")

WinMove("Exploring DeltaV", "", -4, -4, 1032, 748)

MouseClick("left", 14, 26)

MouseClick("left", 37, 173)

MouseClick("left", 232, 190)

WinWait("Format source")

If Not WinActive("Format source") Then WinActivate("Format source")

WinWaitActive("Format source")

Send("D:\DeltaV\DVData\BulkEdit\channel1.fmt")

Send("!n")

WinWait("Import data source")

If Not WinActive("Import data source") Then WinActivate("Import data source")

WinWaitActive("Import data source")

MouseClick("left", 364, 281)

Send("D:\DeltaV\DVData\BulkEdit\channel1_ASCII.TXT")

Send("!n")

WinWait("Import results")

If Not WinActive("Import results") Then WinActivate("Import results")

WinWaitActive("Import results")

Send("!i")

WinWait("Import complete")

If Not WinActive("Import complete") Then WinActivate("Import complete")

WinWaitActive("Import complete")

Send("{Enter}")

;==============================================

MouseClick("left", 88, 363 + $adderx)

$adderx = $adderx + 16

$ultimatectr = $ultimatectr + 1

Next

Share this post


Link to post
Share on other sites



Hi, you should tidy it to debug it!

Look at the ;### Tidy Error ->

For $ultimatectr = 2 To 4 Step + 1
    MouseClick("right", 160, 330)
    MouseClick("left", 249, 373)
    MouseClick("left", 413, 365)

    MouseClick("left", 89, 363 + $adderx)
    MouseClick("left", 108, 379 + $adderx)
    MouseClick("right", 158, 379 + $adderx)
    Send("n")
    WinWait("Add card")
    If Not WinActive("Add card") Then WinActivate("Add card")
    WinWaitActive("Add card")
    Send("!o")
    MouseClick("left", 108, 379 + $adderx)
    MouseClick("left", 179, 395 + $adderx)
    MouseClick("left", 10, 28) ;file
    MouseClick("left", 41, 188)
    MouseClick("left", 260, 231)
    WinWait("User Defined Export", "&Children of selected component")
    If Not WinActive("User Defined Export", "&Children of selected component") Then WinActivate("User Defined Export", "&Children of selected component")
    WinWaitActive("User Defined Export", "&Children of selected component")
    Send("!n")
    WinWait("User Defined Export", "&Expand All")
    If Not WinActive("User Defined Export", "&Expand All") Then WinActivate("User Defined Export", "&Expand All")
    WinWaitActive("User Defined Export", "&Expand All")
    MouseClick("left", 340, 276)
    Send("!n")
    WinWait("Format source", "&Create...")
    If Not WinActive("Format source", "&Create...") Then WinActivate("Format source", "&Create...")
    WinWaitActive("Format source", "&Create...")
    Send("D:\DeltaV\DVData\BulkEdit\RIO1Card.fmt")
    Send("!n")
    WinWait("Export target")
    If Not WinActive("Export target") Then WinActivate("Export target")
    WinWaitActive("Export target")
    MouseClick("left", 352, 285)
    Send("D:\DeltaV\DVData\BulkEdit\RIO1Card1.txt")
    Send("!n")
    Send("!y")
    WinWait("Export results", "Export")
    If Not WinActive("Export results", "Export") Then WinActivate("Export results", "Export")
    WinWaitActive("Export results", "Export")
    MouseMove(529, 514)
    MouseClick("left")
    WinWait("Export results", "Finish")
    If Not WinActive("Export results", "Finish") Then WinActivate("Export results", "Finish")
    WinWaitActive("Export results", "Finish")
    MouseMove(529, 514)
    MouseClick("left")
    Send("{LWINDOWN}r{LWINUP}")
    WinWait("Run")
    If Not WinActive("Run") Then WinActivate("Run")
    WinWaitActive("Run")
    Send("excel")
    MouseClick("left", 135, 703)
    WinWait("Microsoft Excel - Book1")
    If Not WinActive("Microsoft Excel - Book1") Then WinActivate("Microsoft Excel - Book1")
    WinWaitActive("Microsoft Excel - Book1")
    WinMove("Microsoft Excel - Book1", "", -4, -4, 1032, 746)
    MouseMove(531, 36)
    MouseClick("left")
    MouseMove(159, 63)
    MouseClick("left")
    WinWait("Open Data File")
    If Not WinActive("Open Data File") Then WinActivate("Open Data File")
    WinWaitActive("Open Data File")
    WinMove("Open Data File", "", -4, -4, 1032, 746)
    Send("D:\DeltaV\DVData\BulkEdit\RIO1Card1.txt")
    Send("!o")
    WinWait("Unicode Detected")
    If Not WinActive("Unicode Detected") Then WinActivate("Unicode Detected")
    WinWaitActive("Unicode Detected")
    MouseMove(512, 488)
    MouseClick("left")
    WinWait("Microsoft Excel - RIO1Card1_ASCII")
    If Not WinActive("Microsoft Excel - RIO1Card1_ASCII") Then WinActivate("Microsoft Excel - RIO1Card1_ASCII")
    WinWaitActive("Microsoft Excel - RIO1Card1_ASCII")
    MouseClickDrag("left", 90, 177, 104, 179)
    MouseClickDrag("left", 169, 177, 210, 179)
    MouseClickDrag("left", 275, 177, 296, 179)
    MouseClickDrag("left", 363, 177, 401, 179)
    MouseClickDrag("left", 465, 177, 506, 179)
    MouseClickDrag("left", 570, 177, 595, 179)
    MouseClick("left", 184, 65)
    WinWait("Save Data File")
    If Not WinActive("Save Data File") Then WinActivate("Save Data File")
    WinWaitActive("Save Data File")
    Send("RIO1Card1_ASCII.TXT")
    Send("!s")
    WinWaitActive("Microsoft Office Excel")
    Send("!y")
    MouseMove(21, 23)
    MouseClick("left")
    MouseClick("left", 75, 428)
    MouseClick("left", 1015, 9)
    Run("C:\DeltaV\bin\exp.exe ")
    WinWait("Exploring DeltaV")
    If Not WinActive("Exploring DeltaV") Then WinActivate("Exploring DeltaV")
    WinWaitActive("Exploring DeltaV")
    WinMove("Exploring DeltaV", "", -4, -4, 1032, 748)
    MouseClick("left", 14, 26)
    MouseClick("left", 37, 173)
    MouseClick("left", 232, 190)
    WinWait("Format source")
    If Not WinActive("Format source") Then WinActivate("Format source")
    WinWaitActive("Format source")
    Send("D:\DeltaV\DVData\BulkEdit\RIO1Card.fmt")
    Send("!n")
    WinWait("Import data source")
    If Not WinActive("Import data source") Then WinActivate("Import data source")
    WinWaitActive("Import data source")
    MouseClick("left", 364, 281)
    Send("D:\DeltaV\DVData\BulkEdit\RIO1Card1_ASCII.TXT")
    Send("!n")
    WinWait("Import results")
    If Not WinActive("Import results") Then WinActivate("Import results")
    WinWaitActive("Import results")
    Send("!i")
    WinWait("Import complete")
    If Not WinActive("Import complete") Then WinActivate("Import complete")
    WinWaitActive("Import complete")
    Send("{Enter}")
    ;========================================================Default Format Export with Modification===================================================================================
    Send("{LWINDOWN}r{LWINUP}")
    WinWait("Run")
    If Not WinActive("Run") Then WinActivate("Run")
    WinWaitActive("Run")
    Send("excel")
    MouseClick("left", 135, 703)
    WinWait("Microsoft Excel - Book1")
    If Not WinActive("Microsoft Excel - Book1") Then WinActivate("Microsoft Excel - Book1")
    WinWaitActive("Microsoft Excel - Book1")
    WinMove("Microsoft Excel - Book1", "", -4, -4, 1032, 746)
    MouseMove(531, 36)
    MouseClick("left")
    MouseMove(159, 63)
    MouseClick("left")
    WinWait("Open Data File")
    If Not WinActive("Open Data File") Then WinActivate("Open Data File")
    WinWaitActive("Open Data File")
    WinMove("Open Data File", "", -4, -4, 1032, 746)
    Send("D:\DeltaV\DVData\BulkEdit\RIO1Card1.txt")
    Send("!o")
    WinWait("Unicode Detected")
    If Not WinActive("Unicode Detected") Then WinActivate("Unicode Detected")
    WinWaitActive("Unicode Detected")
    MouseClick("left", 512, 488)
    WinWait("Microsoft Excel - RIO1Card1_ASCII")
    If Not WinActive("Microsoft Excel - RIO1Card1_ASCII") Then WinActivate("Microsoft Excel - RIO1Card1_ASCII")
    WinWaitActive("Microsoft Excel - RIO1Card1_ASCII")
    MouseClickDrag("left", 90, 177, 104, 179)
    MouseClickDrag("left", 169, 177, 210, 179)
    MouseClickDrag("left", 275, 177, 296, 179)
    MouseClickDrag("left", 363, 177, 401, 179)
    MouseClickDrag("left", 465, 177, 506, 179)
    MouseClickDrag("left", 570, 177, 595, 179)
    MouseClick("left", 545, 217)
    MouseClick("left", 114, 63)
    WinWait("rio_scan_rate")
    If Not WinActive("rio_scan_rate") Then WinActivate("rio_scan_rate")
    WinWaitActive("rio_scan_rate")
    MouseClick("left", 552, 395)
    MouseClick("left", 548, 413)
    MouseClick("left", 629, 362)
    MouseClick("left", 337, 220)
    MouseClick("left", 116, 62)
    WinWait("rioz1_card_type")
    If Not WinActive("rioz1_card_type") Then WinActivate("rioz1_card_type")
    WinWaitActive("rioz1_card_type")
    MouseClick("left", 577, 397)
    MouseClick("left", 579, 428)
    MouseClick("left", 634, 364)
    MouseClick("left", 184, 65)
    WinWait("Save Data File")
    If Not WinActive("Save Data File") Then WinActivate("Save Data File")
    WinWaitActive("Save Data File")
    Send("RIO1Card1_ASCII.TXT")
    Send("!s")
    WinWaitActive("Microsoft Office Excel")
    Send("!y")
    MouseMove(21, 23)
    MouseClick("left")
    MouseClick("left", 75, 428)
    MouseClick("left", 1015, 9)
    Run("C:\DeltaV\bin\exp.exe ")
    WinWait("Exploring DeltaV")
    If Not WinActive("Exploring DeltaV") Then WinActivate("Exploring DeltaV")
    WinWaitActive("Exploring DeltaV")
    WinMove("Exploring DeltaV", "", -4, -4, 1032, 748)
    MouseClick("left", 14, 26)
    MouseClick("left", 37, 173)
    MouseClick("left", 232, 190)
    WinWait("Format source")
    If Not WinActive("Format source") Then WinActivate("Format source")
    WinWaitActive("Format source")
    Send("D:\DeltaV\DVData\BulkEdit\RIO1Card.fmt")
    Send("!n")
    WinWait("Import data source")
    If Not WinActive("Import data source") Then WinActivate("Import data source")
    WinWaitActive("Import data source")
    MouseClick("left", 364, 281)
    Send("D:\DeltaV\DVData\BulkEdit\RIO1Card1_ASCII.TXT")
    Send("!n")
    WinWait("Import results")
    If Not WinActive("Import results") Then WinActivate("Import results")
    WinWaitActive("Import results")
    Send("!i")
    WinWait("Import complete")
    If Not WinActive("Import complete") Then WinActivate("Import complete")
    WinWaitActive("Import complete")
    Send("{Enter}")
    MouseClick("left", 179, 395 + $adderx)
    MouseMove(10, 27)
    MouseClick("left")
    MouseMove(68, 152)
    MouseClick("left")
    MouseMove(218, 153)
    MouseClick("left")
    WinWait("Format specification - General")
    If Not WinActive("Format specification - General") Then WinActivate("Format specification - General")
    WinWaitActive("Format specification - General")
    Send("RO1")
    Send("!n")
    Send("!y")
    WinWait("Format specification - Select fields")
    If Not WinActive("Format specification - Select fields") Then WinActivate("Format specification - Select fields")
    WinWaitActive("Format specification - Select fields")
    Send("c")
    Send("!b")
    WinWait("Browse")
    If Not WinActive("Browse") Then WinActivate("Browse")
    WinWaitActive("Browse")
    MouseClick("left", 330, 348)
    Send("{enter}")
    MouseClick("left", 299, 329)
    Send("{enter}")
    MouseClick("left", 296, 330)
    MouseClick("left", 721, 323)
    MouseClick("left", 293, 328)
    MouseClick("left", 721, 323)
    WinWait("Format specification - Select fields")
    If Not WinActive("Format specification - Select fields") Then WinActivate("Format specification - Select fields")
    WinWaitActive("Format specification - Select fields")
    MouseClick("left", 511, 365)
    Send("!n")
    WinWait("Format specification - Field order")
    If Not WinActive("Format specification - Field order") Then WinActivate("Format specification - Field order")
    WinWaitActive("Format specification - Field order")
    Send("!n")
    WinWait("Format specification - Must exist")
    If Not WinActive("Format specification - Must exist") Then WinActivate("Format specification - Must exist")
    WinWaitActive("Format specification - Must exist")
    MouseClick("left", 575, 582)
    MouseClick("left", 179, 395 + $adderx)
    MouseClick("left", 10, 28)
    MouseClick("left", 41, 188)
    MouseClick("left", 260, 231)
    WinWait("User Defined Export", "&Children of selected component")
    If Not WinActive("User Defined Export", "&Children of selected component") Then WinActivate("User Defined Export", "&Children of selected component")
    WinWaitActive("User Defined Export", "&Children of selected component")
    Send("!n")
    WinWait("User Defined Export", "&Expand All")
    If Not WinActive("User Defined Export", "&Expand All") Then WinActivate("User Defined Export", "&Expand All")
    WinWaitActive("User Defined Export", "&Expand All")
    MouseClick("left", 340, 276)
    Send("!n")
    WinWait("Format source", "&Create...")
    If Not WinActive("Format source", "&Create...") Then WinActivate("Format source", "&Create...")
    WinWaitActive("Format source", "&Create...")
    Send("D:\DeltaV\DVData\BulkEdit\RIO1Card.fmt")
    Send("!n")
    WinWait("Export target")
    If Not WinActive("Export target") Then WinActivate("Export target")
    WinWaitActive("Export target")
    MouseClick("left", 352, 285)
    Send("D:\DeltaV\DVData\BulkEdit\RIO1Card1.txt")
    Send("!n")
    Send("!y")
    WinWait("Export results", "Export")
    If Not WinActive("Export results", "Export") Then WinActivate("Export results", "Export")
    WinWaitActive("Export results", "Export")
    MouseMove(529, 514)
    MouseClick("left")
    WinWait("Export results", "Finish")
    If Not WinActive("Export results", "Finish") Then WinActivate("Export results", "Finish")
    WinWaitActive("Export results", "Finish")
    MouseMove(529, 514)
    MouseClick("left")
    Send("{LWINDOWN}r{LWINUP}")
    WinWait("Run")
    If Not WinActive("Run") Then WinActivate("Run")
    WinWaitActive("Run")
    Send("excel")
    MouseClick("left", 135, 703)
    WinWait("Microsoft Excel - Book1")
    If Not WinActive("Microsoft Excel - Book1") Then WinActivate("Microsoft Excel - Book1")
    WinWaitActive("Microsoft Excel - Book1")
    WinMove("Microsoft Excel - Book1", "", -4, -4, 1032, 746)
    MouseMove(531, 36)
    MouseClick("left")
    MouseMove(159, 63)
    MouseClick("left")
    WinWait("Open Data File")
    If Not WinActive("Open Data File") Then WinActivate("Open Data File")
    WinWaitActive("Open Data File")
    WinMove("Open Data File", "", -4, -4, 1032, 746)
    Send("D:\DeltaV\DVData\BulkEdit\RIO1Card1.txt")
    Send("!o")
    WinWait("Unicode Detected")
    If Not WinActive("Unicode Detected") Then WinActivate("Unicode Detected")
    WinWaitActive("Unicode Detected")
    MouseMove(512, 488)
    MouseClick("left")
    WinWait("Microsoft Excel - RIO1Card1_ASCII")
    If Not WinActive("Microsoft Excel - RIO1Card1_ASCII") Then WinActivate("Microsoft Excel - RIO1Card1_ASCII")
    WinWaitActive("Microsoft Excel - RIO1Card1_ASCII")
    MouseClickDrag("left", 90, 177, 104, 179)
    MouseClickDrag("left", 169, 177, 210, 179)
    MouseClickDrag("left", 275, 177, 296, 179)
    MouseClickDrag("left", 363, 177, 401, 179)
    MouseClickDrag("left", 465, 177, 506, 179)
    MouseClickDrag("left", 570, 177, 595, 179)
    $a = 0
    $b = 0
    For $i = 1 To 4 Step + 1
        MouseClick("left", 543, 220 + $a)
        MouseClick("left", 117, 64)
        WinWait("rio_scan_rate")
        If Not WinActive("rio_scan_rate") Then WinActivate("rio_scan_rate")
        WinWaitActive("rio_scan_rate")
        MouseClick("left", 552, 395)
        MouseClick("left", 551, 410 + $b)
        MouseClick("left", 630, 364)
        $a = $a + 19
        $b = $b + 15
    Next
    $a = 0
    $b = 0
    For $i = 1 To 3 Step + 1
        MouseClick("left", 343, 236 + $a)
        MouseClick("left", 115, 64)
        WinWait("rioz1_card_type")
        If Not WinActive("rioz1_card_type") Then WinActivate("rioz1_card_type")
        WinWaitActive("rioz1_card_type")
        MouseClick("left", 575, 395)
        If $b = 0 Then
            MouseClick("left", 572, 425)
            $b = 1
        Else
            MouseClick("left", 571, 415)
            $b = 0
        EndIf
        MouseClick("left", 630, 364)
        $a = $a + 19
    Next
    MouseClick("left", 253, 217)
    MouseClickDrag("left", 291, 224, 291, 281)
    MouseClick("left", 151, 220)
    Send("{CTRLDOWN}c{CTRLUP}")
    MouseClickDrag("left", 114, 236, 160, 275)
    Send("{CTRLDOWN}v{CTRLUP}")
    MouseClick("left", 184, 65)
    WinWait("Save Data File")
    If Not WinActive("Save Data File") Then WinActivate("Save Data File")
    WinWaitActive("Save Data File")
    Send("RIO1Card1_ASCII.TXT")
    Send("!s")
    WinWaitActive("Microsoft Office Excel")
    Send("!y")
    MouseMove(21, 23)
    MouseClick("left")
    MouseClick("left", 75, 428)
    MouseClick("left", 1015, 9)
    Run("C:\DeltaV\bin\exp.exe ")
    WinWait("Exploring DeltaV")
    If Not WinActive("Exploring DeltaV") Then WinActivate("Exploring DeltaV")
    WinWaitActive("Exploring DeltaV")
    WinMove("Exploring DeltaV", "", -4, -4, 1032, 748)
    MouseClick("left", 14, 26)
    MouseClick("left", 37, 173)
    MouseClick("left", 232, 190)
    WinWait("Format source")
    If Not WinActive("Format source") Then WinActivate("Format source")
    WinWaitActive("Format source")
    Send("D:\DeltaV\DVData\BulkEdit\rio1.fmt")
    Send("!n")
    WinWait("Import data source")
    If Not WinActive("Import data source") Then WinActivate("Import data source")
    WinWaitActive("Import data source")
    MouseClick("left", 364, 281)
    Send("D:\DeltaV\DVData\BulkEdit\RIO1Card1_ASCII.TXT")
    Send("!n")
    WinWait("Import results")
    If Not WinActive("Import results") Then WinActivate("Import results")
    WinWaitActive("Import results")
    Send("!i")
    WinWait("Import complete")
    If Not WinActive("Import complete") Then WinActivate("Import complete")
    WinWaitActive("Import complete")
    Send("{Enter}")
    ;================================

    ;======================================================================Channel======================
     == == == == == == == == == == == == == == == == == =

    MouseClick(127, 298 + $adder)
    MouseClick("left", 189, 316 + $adder)
    MouseClick("left", 10, 27)
    MouseClick("left", 55, 151)
    MouseClick("left", 217, 152)
    WinWait("Format specification - General")
    If Not WinActive("Format specification - General") Then WinActivate("Format specification - General")
    WinWaitActive("Format specification - General")
    Send("D:\DeltaV\DVData\BulkEdit\channel1.fmt")
    Send("!n")
    Send("!y")
    WinWait("Format specification - Select fields")
    If Not WinActive("Format specification - Select fields") Then WinActivate("Format specification - Select fields")
    WinWaitActive("Format specification - Select fields")
    Send("ch")
    MouseClick("left", 511, 365)
    Send("!n")
    WinWait("Format specification - Field order")
    If Not WinActive("Format specification - Field order") Then WinActivate("Format specification - Field order")
    WinWaitActive("Format specification - Field order")
    Send("!n")
    WinWait("Format specification - Must exist")
    If Not WinActive("Format specification - Must exist") Then WinActivate("Format specification - Must exist")
    WinWaitActive("Format specification - Must exist")
    MouseClick("left", 575, 582)
    MouseClick("left", 10, 28)
    MouseClick("left", 41, 188)
    MouseClick("left", 260, 231)
    WinWait("User Defined Export", "&Children of selected component")
    If Not WinActive("User Defined Export", "&Children of selected component") Then WinActivate("User Defined Export", "&Children of selected component")
    WinWaitActive("User Defined Export", "&Children of selected component")
    Send("!n")
    WinWait("User Defined Export", "&Expand All")
    If Not WinActive("User Defined Export", "&Expand All") Then WinActivate("User Defined Export", "&Expand All")
    WinWaitActive("User Defined Export", "&Expand All")
    MouseClick("left", 340, 276)
    Send("!n")
    WinWait("Format source", "&Create...")
    If Not WinActive("Format source", "&Create...") Then WinActivate("Format source", "&Create...")
    WinWaitActive("Format source", "&Create...")
    Send("D:\DeltaV\DVData\BulkEdit\channel1.fmt")
    Send("!n")
    WinWait("Export target")
    If Not WinActive("Export target") Then WinActivate("Export target")
    WinWaitActive("Export target")
    MouseClick("left", 352, 285)
    Send("D:\DeltaV\DVData\BulkEdit\channel1.txt")
    Send("!n")
    Send("!y")
    WinWait("Export results", "Export")
    If Not WinActive("Export results", "Export") Then WinActivate("Export results", "Export")
    WinWaitActive("Export results", "Export")
    MouseMove(529, 514)
    MouseClick("left")
    WinWait("Export results", "Finish")
    If Not WinActive("Export results", "Finish") Then WinActivate("Export results", "Finish")
    WinWaitActive("Export results", "Finish")
    MouseMove(529, 514)
    MouseClick("left")
    ;===================================================================================================
     == == == == == == == == == == == == == =
    Send("{LWINDOWN}r{LWINUP}")
    WinWait("Run")
    If Not WinActive("Run") Then WinActivate("Run")
    WinWaitActive("Run")
    Send("excel")
    MouseClick("left", 135, 703)
    WinWait("Microsoft Excel - Book1")
    If Not WinActive("Microsoft Excel - Book1") Then WinActivate("Microsoft Excel - Book1")
    WinWaitActive("Microsoft Excel - Book1")
    WinMove("Microsoft Excel - Book1", "", -4, -4, 1032, 746)
    MouseMove(531, 36)
    MouseClick("left")
    MouseMove(159, 63)
    MouseClick("left")
    WinWait("Open Data File")
    If Not WinActive("Open Data File") Then WinActivate("Open Data File")
    WinWaitActive("Open Data File")
    WinMove("Open Data File", "", -4, -4, 1032, 746)
    Send("D:\DeltaV\DVData\BulkEdit\channel1.txt")
    Send("!o")
    WinWait("Unicode Detected")
    If Not WinActive("Unicode Detected") Then WinActivate("Unicode Detected")
    WinWaitActive("Unicode Detected")
    MouseMove(512, 488)
    MouseClick("left")
    WinWait("Microsoft Excel - channel1_ASCII")
    If Not WinActive("Microsoft Excel - channel1_ASCII") Then WinActivate("Microsoft Excel - channel1_ASCII")
    WinWaitActive("Microsoft Excel - channel1_ASCII")
    ;===================================================================================================
     == == == == == == == == == == == == == == 

    ;================================================
;### Tidy Error -> for Not closed before "Func" statement.
;### Tidy Error ->  & CHR$(34) & FIRSTWORD$ & " cannot be inside any IF/Do/While/For/Case/Func statement.
    Func _channeltype()
        WinWait("channel_type")
        If Not WinActive("channel_type") Then WinActivate("channel_type")
        WinWaitActive("channel_type")
        MouseClick("left", 567, 387)
    EndFunc   ;==>_channeltype

;### Tidy Error -> for Not closed before "Func" statement.
;### Tidy Error ->  & CHR$(34) & FIRSTWORD$ & " cannot be inside any IF/Do/While/For/Case/Func statement.
    Func _dragZ1()
        MouseClickDrag("left", 568, 420, 566, 481)
    EndFunc   ;==>_dragZ1

    MouseClickDrag("left", 90, 183, 188, 183)
    MouseClickDrag("left", 251, 183, 294, 183)
    MouseClickDrag("left", 422, 183, 453, 183)
    MouseClickDrag("left", 517, 183, 617, 183)
    MouseClickDrag("left", 681, 183, 744, 183)
    MouseClick("left", 536, 218)
    Send("{CTRLDOWN}c{CTRLUP}")
    MouseClickDrag("left", 532, 238, 515, 515)
    Send("{CTRLDOWN}v{CTRLUP}")
    MouseClick("left", 526, 539)
    $determinant = 1
    For $john = 1 To 8 Step + 1
        MouseClick("left", 119, 66)
        _channeltype()
        _dragZ1()

        If $determinant = 1 Then
            MouseClick("left", 526, 417) ;click Zone1 DO Channel
            MouseClick("left", 623, 362) ;select
            $determinant = 2
            Send("{down}")
            ContinueLoop
        EndIf

        If $determinant = 2 Then
            MouseClick("left", 542, 430) ;click Zone1 MO Channel
            MouseClick("left", 623, 362) ;select
            $determinant = 3
            Send("{down}")
            ContinueLoop
        EndIf

        If $determinant = 3 Then
            MouseClick("left", 514, 444) ;click Zone1 CP Channel
            MouseClick("left", 623, 362) ;select
            $determinant = 1
            Send("{down}")
            ContinueLoop
        EndIf


    Next

    For $a = 1 To 5 Step + 1
        MouseClick("left", 1012, 188)
    Next

    ;===================================================================================================
     == == == == == == == == == == == == == =

    ;===================================================== Description ============================================================

    MouseClick("left", 92, 217)
    Send("{CTRLDOWN}c{CTRLUP}")
    MouseClickDrag("left", 100, 238, 100, 681)
    Send("{CTRLDOWN}v{CTRLUP}")

    ;===================================================== Node Name ==============================================================

    MouseClick("left", 241, 217)
    Send("{CTRLDOWN}c{CTRLUP}")
    MouseClickDrag("left", 240, 238, 240, 681)
    Send("{CTRLDOWN}v{CTRLUP}")

    ;===================================================== Card Slot ==============================================================


    MouseClick("left", 327, 217)
    Send("{CTRLDOWN}c{CTRLUP}")
    MouseClickDrag("left", 326, 238, 326, 681)
    Send("{CTRLDOWN}v{CTRLUP}")

    ;===================================================== Channel Slot ===========================================================

    MouseClick("left", 405, 217)
    MouseClickDrag("left", 451, 225, 430, 683)

    ;===================================================== device signal tag ======================================================

    MouseClick("left", 676, 217)
    Send("RIO")
    Send($ultimatectr)
    Send("DICD1CH1")
    MouseClickDrag("left", 744, 226, 740, 684)

    ;=========================================================== Enable ===========================================================

    MouseClick("left", 783, 223)
    MouseClick("left", 119, 66)
    WinWait("enable")
    If Not WinActive("enable") Then WinActivate("enable")
    WinWaitActive("enable")
    MouseClick("left", 436, 393)
    MouseClick("left", 436, 414)
    MouseClick("left", 641, 363)
    MouseClick("left", 783, 223)
    MouseClickDrag("left", 807, 226, 803, 682)

    ;=========================================================== ************* =====================================================

    MouseClick("left", 838, 219)
    MouseClickDrag("left", 38, 218, 786, 671)
    Send("{CTRLDOWN}c{CTRLUP}")
    For $a = 1 To 3 Step + 1
        MouseClick("left", 1018, 695)
    Next
    MouseClick("left", 95, 639)
    Send("{CTRLDOWN}v{CTRLUP}")
    For $a = 1 To 21 Step + 1
        MouseClick("left", 1018, 695)
    Next


    MouseClick("left", 329, 217)
    Send("2")
    Send("{DOWN}")
    Send("{UP}")
    Send("{CTRLDOWN}c{CTRLUP}")
    MouseClickDrag("left", 325, 238, 318, 679)
    Send("{CTRLDOWN}v{CTRLUP}")

    MouseClick("left", 647, 218)
    Send("RIO")
    Send($ultimatectr)
    Send("DICD2CH1")
    MouseClickDrag("left", 744, 224, 742, 683)

    ;==================================================Card 3=======================================================================
    For $a = 1 To 20 Step + 1
        MouseClick("left", 1018, 695)
    Next

    MouseClick("left", 90, 298)
    Send("Analog Input Channel")
    MouseClickDrag("left", 187, 306, 183, 453)
    MouseClick("left", 95, 459)
    Send("Analog Output Channel")
    MouseClickDrag("left", 187, 466, 186, 524)

    MouseClick("left", 240, 277)
    Send("{CTRLDOWN}c{CTRLUP}")
    MouseClickDrag("left", 237, 298, 230, 522)
    Send("{CTRLDOWN}v{CTRLUP}")

    MouseClick("left", 324, 278)
    Send("{CTRLDOWN}c{CTRLUP}")
    Send("{DOWN}")
    Send("{CTRLDOWN}v{CTRLUP}")
    Send("3")
    Send("{UP}")
    Send("{DOWN}")
    Send("{CTRLDOWN}c{CTRLUP}")
    MouseClickDrag("left", 323, 319, 320, 518)
    Send("{CTRLDOWN}v{CTRLUP}")

    MouseClick("left", 406, 276)
    Send("{CTRLDOWN}c{CTRLUP}")
    Send("{DOWN}")
    Send("{CTRLDOWN}v{CTRLUP}")
    Send("1")
    MouseClickDrag("left", 453, 307, 451, 523)

    $determinant = 1
    MouseClick("left", 529, 298)

    For $john = 1 To 12 Step + 1

        MouseClick("left", 119, 66)
        _channeltype()
        MouseClickDrag("left", 568, 420, 566, 485)

        If $john < 9 Then

            If $determinant = 1 Then
                MouseClick("left", 517, 456) ;click AI_CHAN
                MouseClick("left", 623, 362) ;select
                $determinant = 2
                Send("{DOWN}")
                ContinueLoop
            EndIf

            If $determinant = 2 Then
                MouseClick("left", 517, 470) ;click AI_HART
                MouseClick("left", 623, 362) ;select
                $determinant = 1
                Send("{DOWN}")
                ContinueLoop
            EndIf
        EndIf

        If $john > 8 Then

            If $determinant = 1 Then

                MouseClick("left", 517, 482) ;Click AO_CHAN
                MouseClick("left", 623, 362) ;select
                $determinant = 2
                Send("{DOWN}")
                ContinueLoop

            EndIf

            If $determinant = 2 Then

                MouseClick("left", 517, 496) ;Click AO_ENABLED_HART
                MouseClick("left", 623, 362) ;select
                $determinant = 1
                Send("{DOWN}")
                ContinueLoop

            EndIf

        EndIf



    Next


    MouseClick("left", 677, 279)
    Send("{CTRLDOWN}c{CTRLUP}")
    Send("{DOWN}")
    Send("{CTRLDOWN}v{CTRLUP}")
    Send("RIO")
    Send($ultimatectr)
    Send("DICD3CH1")
    MouseClickDrag("left", 744, 306, 736, 525)

    MouseClick("left", 775, 278)
    MouseClickDrag("left", 807, 285, 805, 522)

    ;==================================================Card 4=======================================================================


    For $john = 1 To 45 Step + 1
        MouseClick("left", 1017, 182)
    Next

    MouseClick("left", 838, 219)
    MouseClickDrag("left", 38, 218, 786, 671)
    Send("{CTRLDOWN}c{CTRLUP}")
    For $a = 1 To 60 Step + 1
        MouseClick("left", 1018, 695)
    Next

    MouseClick("left", 104, 217)
    Send("{CTRLDOWN}v{CTRLUP}")

    MouseClick("left", 329, 217)
    Send("4")
    Send("{DOWN}")
    Send("{UP}")
    Send("{CTRLDOWN}c{CTRLUP}")
    MouseClickDrag("left", 325, 238, 318, 679)
    Send("{CTRLDOWN}v{CTRLUP}")

    MouseClick("left", 647, 218)
    Send("RIO")
    Send($ultimatectr)
    Send("DICD4CH1")
    MouseClickDrag("left", 744, 224, 742, 683)

    ;========================================================Save and Import=======================================================
    MouseClick("left", 184, 65)
    WinWait("Save Data File")
    If Not WinActive("Save Data File") Then WinActivate("Save Data File")
    WinWaitActive("Save Data File")
    Send("channel1_ASCII.TXT")
    Send("!s")
    WinWaitActive("Microsoft Office Excel")
    Send("!y")
    MouseMove(21, 23)
    MouseClick("left")
    MouseClick("left", 75, 428)
    MouseClick("left", 1015, 9)
    Run("C:\DeltaV\bin\exp.exe ")
    WinWait("Exploring DeltaV")
    If Not WinActive("Exploring DeltaV") Then WinActivate("Exploring DeltaV")
    WinWaitActive("Exploring DeltaV")
    WinMove("Exploring DeltaV", "", -4, -4, 1032, 748)
    MouseClick("left", 14, 26)
    MouseClick("left", 37, 173)
    MouseClick("left", 232, 190)
    WinWait("Format source")
    If Not WinActive("Format source") Then WinActivate("Format source")
    WinWaitActive("Format source")
    Send("D:\DeltaV\DVData\BulkEdit\channel1.fmt")
    Send("!n")
    WinWait("Import data source")
    If Not WinActive("Import data source") Then WinActivate("Import data source")
    WinWaitActive("Import data source")
    MouseClick("left", 364, 281)
    Send("D:\DeltaV\DVData\BulkEdit\channel1_ASCII.TXT")
    Send("!n")
    WinWait("Import results")
    If Not WinActive("Import results") Then WinActivate("Import results")
    WinWaitActive("Import results")
    Send("!i")
    WinWait("Import complete")
    If Not WinActive("Import complete") Then WinActivate("Import complete")
    WinWaitActive("Import complete")
    Send("{Enter}")

    ;==============================================

    MouseClick("left", 88, 363 + $adderx)

    $adderx = $adderx + 16
    $ultimatectr = $ultimatectr + 1
Next

Share this post


Link to post
Share on other sites

Function should always be place at the end of the script!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0