Hello Guest it is March 28, 2024, 08:59:06 AM

Author Topic: Screen Toggle Macro  (Read 3811 times)

0 Members and 1 Guest are viewing this topic.

Screen Toggle Macro
« on: June 07, 2008, 11: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
Re: Screen Toggle Macro
« Reply #1 on: June 07, 2008, 12:21:54 PM »
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.

Re: Screen Toggle Macro
« Reply #2 on: June 07, 2008, 01: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
Re: Screen Toggle Macro
« Reply #3 on: June 15, 2008, 11: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