Welcome, Guest. Please login or register.
Did you miss your activation email?
December 02, 2008, 04:17:08 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  Screen Toggle Macro
Pages: 1   Go Down
Print
Author Topic: Screen Toggle Macro  (Read 768 times)
0 Members and 1 Guest are viewing this topic.
Holger0815
Active Member

Offline Offline

Posts: 14


View Profile
« on: June 07, 2008, 10:51:00 AM »

Hello Gents,
I'd like to make me a macro to toggle through the screens by pressing a button on my shuttle.
I could not find yet a variable or DRO indicating the currently active screen. Is there any such indicator? What code does it have?

Further I would be glad to have more then two user macros started by the Shuttle. Is there a possibility to alter the plugin?

Thank you for helping me! I'll post the finished macro here.

Best regards
Holger
Logged
Ron Ginger
Active Member

Online Online

Posts: 266



View Profile WWW
« Reply #1 on: June 07, 2008, 11:21:54 AM »

Changing screens is easy- OEMbutton1-99 call the screen number. Screen 1 is the startup screen, 50 is the TAB screen.

But I dont think there is a DRO to tell the current screen number. Your macro could create a DRO to hold the last number it called. That would get messed up if you used some on-screen button to change the screen, the next time you hit your button it would go to what it thought should be next, not the next from where you are.

Logged
Holger0815
Active Member

Offline Offline

Posts: 14


View Profile
« Reply #2 on: June 07, 2008, 12:50:48 PM »

Hi all,
in the wiki under code for "Macropump for Galesburg Mill" i found some code containing the function I looked for:
GetPage() responds the current screen number.  My macro now is like that:


Rem M90027
Rem Toggle Sceen

Dim sc as integer

sc = GetPage()

Select case sc
case = 1
DoOEMButton(2)

Case = 2
DoOEMButton(3)

Case = 3
DoOEMButton(12)

case = 12
DoOEMButton(1)

end select



It toggles between screens 1, 2, 3, and 12 (12 is a custom screen for tool alignment).

Thanks for help.


The second question is still open: Any possibility to change the Shuttle plugin for more macros ?

Best regards
Holger
Logged
Holger0815
Active Member

Offline Offline

Posts: 14


View Profile
« Reply #3 on: June 15, 2008, 10:56:46 AM »

Hello Scott,
thank you and sorry for late reply.

Do I understand right, that I would need this interlocking when I assign the macro to a hardware input pin on the LPT port? What does the "macro pump" do?

I think I was misunderstood: I only found the "GetPage()" function in some "macro pump code" in the Wiki pages.

I myself used the code in a macro what is then assigned to a Button of my Shuttle Pro device in the Shuttle add-in. It worked fine, although I did not test what happens when I press the button longer. Could be I had a quick finger when testing...

I will remember your kind hints when testing a modbus I/O box I intend to build.

Thank you so much!

Regards
Holger
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!