Button Functionality

Moderators: TomKerekes, dynomotion

Post Reply
MadTooler
Posts: 86
Joined: Thu Nov 08, 2018 11:57 pm

Button Functionality

Post by MadTooler » Sun Nov 11, 2018 2:01 am

I have been trying to get some toggle style buttons to work together to control several vacuum pumps with varying cycles. It seemed simple, but I realize I am not sure the differences in the var's and the priority of execution. I have looked through all the examples, videos, and documents that appear relevant without finding what I think I need to know.

Here are a few questions for starters with the toggle buttons (assuming same for all styles of buttons):

Will a c program be run if a var is set at the main level of the button (I see the bit updating and toggling but the c program does not appear to run)?

What is the difference from the var within the script form and the var at the initial button properties (assuming persist vs a hardware, virtual, or extended virtual bit)?

On a related note, I could not easily find details on what the intended application is of virtual and extended bits, or which ones are allocated already for hardware.

I am trying to get one toggle button to untoggle another if it was on, and run a c program. My thought was accessing the state the var (which one?) but cannot seem to find the proper function to access the var to check or change within a c program, even then, not sure I can have it toggle it's state and run the same c program every time it is pressed as well. My work around is to use several LED labels that watch several virtual bits that the c programs change when they are called by the button presses.

Thanks

User avatar
TomKerekes
Posts: 2529
Joined: Mon Dec 04, 2017 1:49 am

Re: Button Functionality

Post by TomKerekes » Mon Nov 12, 2018 5:15 pm

Hi MadTooler,

I’m not really sure I understand what you are trying to do.

Toggle buttons are used to toggle a bit not run a C Program.

Virtual Bits are for you to assign and use however you desire.

To set or clear any bit from a C Program you can use SetBit(xx) or ClearBit(xx). As well as read it with ReadBit(xx).
Regards,

Tom Kerekes
Dynomotion, Inc.

MadTooler
Posts: 86
Joined: Thu Nov 08, 2018 11:57 pm

Re: Button Functionality

Post by MadTooler » Mon Nov 12, 2018 5:57 pm

Thanks, Tom.

Sorry for the muddy explanation of my goal. I have found some alternate methods to achieve success. More along the line of your intended path.

I am content for now with my new screens. If these give me any trouble, I will come back to this and better illustrate my original goal.

Post Reply