Hello Guest it is April 26, 2024, 05:22:08 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 - Chaoticone

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 »
491
Mach4 Toolbox / Re: Mapping screen button to pokeys ExtBus pin
« on: May 17, 2017, 12:20:34 PM »
I haven't had a chance to play with the pokeys and Mach4 yet myself but had look at Custom signal mapping in their manual included in the zip at the following link and it seems like it should work.

https://www.poscope.com/wp-content/uploads/downloads/Pokeys/LibrariesAndPlugins/PoKeys%20Mach3%20plugin%20+%20manual%20(28.3.2017).zip

Configure the inputs, add the input signal to the sig lib table in the screen load script and create the function there that you want to run when the input signal changes state.

492
Home in Place works fine here in Mach4 with the ESS.


493
Mach4 General Discussion / Re: image manager?
« on: April 23, 2017, 08:22:33 PM »
Open your screen in screen edit mode, then screen, then manage images. Don't be scared to poke around.

494
Mach4 General Discussion / Re: Screen load script question
« on: April 14, 2017, 01:19:07 AM »
Good, no shortage of ways to do it in lua, that's for sure. Just pick the way that works best for you.

Something like this might work too......
local hreg = mc.mcRegGetHandle(inst, string.format(your missing part of the srting here .. '//' .. whatregister .. '//' .. regname))

Or

"iRegs0//"

The best way to find out for sure is to just do it and test and adjust until you get what you want.

495
Mach4 General Discussion / Re: Screen load script question
« on: April 12, 2017, 10:56:16 PM »
Get rid of the formatting tags and see how it does.

WhatRegister = "iRegs0/%s"

Should be

WhatRegister = "iRegs0"

This isn't right either.........

local hreg = mc.mcRegGetHandle(inst, string.format(whatregister,regname))

"core/global/Version"

local hreg = mc.mcRegGetHandle(inst, string.format(your missing part of the srting here .. '/' .. whatregister .. '/' .. regname))

Play with until you can read and write to a single register in debugger then move on to functions then functions with parameters passing.

496
Mach4 General Discussion / Re: Screen load script question
« on: April 12, 2017, 09:13:08 AM »
Paste in all of your script......... the function from the screen load script and the script you put in a button that works.

497
Mach4 General Discussion / Re: Reading text box on screen
« on: April 11, 2017, 07:11:00 PM »
I'm on 2914.  Can I update without upsetting the license, screenset or directories I'm currently working on?  I know Mach 4 uses a different licensing scheme than Mach 3

Other than the license, absolutely ........assuming of course you have not been modifying anything that comes with Mach (defaults, which no one should ever modify). Customizing defaults makes a mess and is almost always a very bad idea.

License changed at some point but you can login to your account you created when you bought the license and mange your license if you need to disable the existing and generate a new one.

498
Mach4 General Discussion / Re: Screen load script question
« on: April 11, 2017, 04:16:53 PM »
Nothing special to run a function from the screen load script in a button script. Just call the function by the same name used in the screen load script and pass it any parameters if it has any.

MyFunction()
MyFunction(param1, param2, param3)

Another way to do it is to put the function in a module. Then you can run it from a buttons script or Mcode. You just have to load the module in screen load (so buttons can use its functions) and in a module that is in the macros folder (so Mcodes can use its functions) of the profile your using.

There has not been a release since I added the load_modules.mcs file to all of the default profiles macros folders but you can manually add it to any version. I have already posted this somewhere before but here it is again.

Code: [Select]
--This is the mcUserScript.lua module that goes in the modules folder
local mcUserScript = {}

function mcUserScript.UserMessage(Message)
if (Message == nil) then --No message was passed
Message = "No message passed" --If no message is passed this will be the default message
end
wx.wxMessageBox(Message)
end

return mcUserScript -- Module End

--This is what loads the module above.
--Add this to the modules load section of the screen load script so you can call its functions from buttons on the screen.
--Add this to the load_modules.mcs file in the macros folder of the profile that will be using it so you can call its functions from M codes.
package.loaded.mcUserScript = nil
us = require "mcUserScript"

--Put this in a buttons clicked script and when you click it a message box will pop up that says... No message passed
us.UserMessage() --This is not passing a message for the Message parameter so the message will be the default

--m110 goes in the macros folder of the profile that will be using it. It will be named m110.mcs
function m110()

us.UserMessage("This is my message") --When M110 is executed in Gcode or MDI a message box will pop up that says This is my message.

end

if (mc.mcInEditor() == 1) then
 m110()
end

499
Mach4 General Discussion / Re: Reading text box on screen
« on: April 11, 2017, 03:32:46 PM »
Quote
Have you tried that?

I have. Can get it and set it as expected here.

Code: [Select]
MyTest = scr.GetProperty("txtTest", "Value")
wx.wxMessageBox(MyTest)
scr.SetProperty("txtTest", "Value", "Test2")

Doesn't work on my end.  Maybe they exposed the value property in a later version.  What version are you running? 

Just so we're on the same page, we are talking about a textbox here, not a DRO.  If I place a textbox, I don't see a "Value" property associated with it.  If I place a DRO, I do see a "Value" property.



Version 3233, which you should be running too. It may well not have been accessible in earlier versions, I can't say for sure though.

Yup, I am talking about a textbox, not a DRO.

500
Mach4 General Discussion / Re: Reading text box on screen
« on: April 11, 2017, 01:32:55 AM »
Quote
Have you tried that?

I have. Can get it and set it as expected here.

Code: [Select]
MyTest = scr.GetProperty("txtTest", "Value")
wx.wxMessageBox(MyTest)
scr.SetProperty("txtTest", "Value", "Test2")

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 »