Hello Guest it is April 26, 2024, 02:17:41 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - joeaverage

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 »
5251
General Mach Discussion / Re: Weird behaviour on limit switches
« on: February 16, 2018, 10:38:14 PM »
Hi,

Quote
Removing the signal from the input is not enough to be able to reset the system?

No. Commonly a limit event will Estop Mach. Even if you remove the offending limit signal Mach will still have to be reset manually. If you don't have "Overide Limits'
then you will not be able to jog off the limit switch.

Quote
If I power down the limit switch circuit, the X++ and X-- lights still stay lit, even though the ESS input has returned to a high level and there is no longer a limit input. 

I suspect this is a result of Mach being disabled. The sequence of events is that the limit switch triggers and Mach disables. Your description suggests to me that Mach
is not responding to new inputs until it has been re-enabled.

Craig

5252
Mach4 General Discussion / Re: Lua programming of voltage meter
« on: February 16, 2018, 06:23:35 PM »
Hi,
the 57E will need to communicate a digital word to your PC over its Ethernet connection. You will have to read the manual as to how to cause the 57E to that
and to where it would store its value.

Craig

5253
Mach4 General Discussion / Re: Lua script detect when the cycle is running
« on: February 16, 2018, 03:17:04 PM »
Hi,
that can be done.

Note that the one thing which determines if your M6 has been stopped or the machine disabled is the state of the control. If the m6 is progressing normally
the control state is busy and you wish to leave it alone. If however it has been stopped then the control state would be Idle and you wish to RETURN.

How about this:

if (mc.mcCntlGetState(inst)==mc.MC_STATE_IDLE) then return end

So if the control is in Idle state, and we know it shouldn't be if every thing is normal, then cause the macro to return immediately.

Craig

5254
Mach4 General Discussion / Re: Lua script detect when the cycle is running
« on: February 16, 2018, 03:03:21 PM »
Hi,
I owe you an apology I misinterpreted what I saw.
When I <stop> the code while the delay is timing the error log shows that CycleStopped has been issued but then Lua is stuck in limbo and it carries on from
the point that it stopped, and you note that now because of the CycleStop the control state is IDLE, then it reaches the end.

Craig

5255
Mach4 General Discussion / Re: Lua script detect when the cycle is running
« on: February 16, 2018, 02:54:38 PM »
Hi,
whoops posted before I'd actually finished. The code runs fine.
If I leave it to time out its delay it completes with the 'end' message and if I look at the error log it is preceeded with 'else' as it should be. Note that because
m401 is running the control can't be Idle, we happen to know that its busy running our script!
If however I either <Stop> or <Disable> m401 while the rather lengthy pause it running the script end and prints 'end' but doesn't print the 'else' which would
ordinarily preceed it. That is to say it skipped over the mc.mcCntlGetState() and the if-then-else-end code between the point at which I <stop> and the scripts
endpoint. Once the endpoint is reached m401 releases control and control reverts to the state which preceeded the m401 call namely Idle.

Craig

5256
Mach4 General Discussion / Re: Lua script detect when the cycle is running
« on: February 16, 2018, 02:42:21 PM »
Hi,
I had to modify your script slightly to get it to run, my installation wont do anything useful with 'print()'
Also your  G4 P3 statement is interpreted by my machine as 'pause for 3 milliseconds', if you put a decimal point in the P parameter it is interpreted as seconds,
as you see I changed mine to P10.0.

Code: [Select]
function m401()
    local inst = mc.mcGetInstance()
    mc.mcCntlSetLastError(inst,"starting")
    mc.mcCntlGcodeExecuteWait(inst,"G4 P10.0")
    local mcState,rc=mc.mcCntlGetState(inst)
    if (mcState==mc.MC_STATE_IDLE) then
        mc.mcCntlSetLastError(inst,"IDLE")
    else
        mc.mcCntlSetLastError(inst,"ELSE")
    end
    mc.mcCntlSetLastError(inst,"end")   
end
if (mc.mcInEditor()==1) then
    m401()
end

5257
Mach4 General Discussion / Re: Lua script detect when the cycle is running
« on: February 16, 2018, 02:12:17 PM »
Hi,
I'm with Daz and am unsure that I understand the problem you are describing.

Quote
but the machine is stopped or disabled halfway through by the operator. The execution starts at the top, YET STILL ENDS AT THE BOTTOM, since Mach actually doesn't stop executing until the whole thing has been gone through.

I'm not sure about this....surely the M6 starts at the top but the code stops at the point that you disable or stop it? The only way I can think that the code would continue
to execute but not actually physically move would be if the motors/servos were disabled while Mach remained enabled and therefore carried on executing?.

You may have noted a current and fairly long running thread where a guy wanted an 'Offline' button on his machine. The solution was to disable the physical motion of
the servos while allowing normal operation of Mach. When the machine is to be re-instated it is necessary to apply a machine coordinate correction so the machines
referencing remains consistant. Eventually I got the code to work pretty well, regrettably the OP is being rather obtuse and refuses to follow the steps required to get it
to work on his machine but it works fine here.

With the solution I proposed for his "Offline' button the servos stopped motion but if a signal changed state as a result of Mach's continued execution while the servos
are offline that could cause problems. Is this the concern you have?

Craig

5258
General Mach Discussion / Re: ARFcnc 6040 Mach 3 USB configuration help
« on: February 16, 2018, 03:12:21 AM »
Hi fredeflint,
you used to have this board....did you ever get it to work properly? 'Use to have' sounds like past tense, do you not have it any more?

Craig

5259
Mach4 General Discussion / Re: Lua script detect when the cycle is running
« on: February 15, 2018, 04:15:33 PM »
Hi,

http://www.machsupport.com/forum/index.php/topic,36548.0.html

No, what I am saying is that IF you try to execute code when the control is NOT idle then you'll
crash Mach.

What you are asking is: 'how did the control become idle...did the previous code execute and exit normally...
did it get aborted or did it fail to execute?'

I can see that you may not wish to execute your code if the previous code ended abonrmally, this test does'nt
help it that decision. It does tell if you 'could' execute your code.

Craig

5260
Mach4 General Discussion / Re: Lua script detect when the cycle is running
« on: February 15, 2018, 12:56:48 PM »
Hi,

Quote
The piece of code isn't related to the motion planner, rather changing the state of signals.

No that's correct but if you check that the control state is Idle then that will determine that no code is running, Gcode or MDI or screenscript.

Quote
LUA Syntax:
mcState, rc = mc.mcCntlGetState(
      MINSTANCE mInst)

local mcState,rc=mc.mcGetState(inst)
if (mcState==mc.MC_STATE_IDLE) then
--
-- execute your code as the control is idle and ready for use
--
else
--
-- the control is not idle and not available to be tasked
-- if required you can terminate the current task
--
end

Craig


Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 »