Here is a
"MAD 4 MACH" screen shot.
this shows the "Floater" windows for:
- All Mach4 OEM Inputs
- All Mach4 OEM Outputs
You will be able to choose where to install the MAD.mcc as well. All you have to do is drop the MAD.mcc into what ever
folder you want it to live in. If you choose a different folder, than the "stock" code to launch it, then you will need to change its package path.
Put the following code in any button button (or make one) on your screen set,
just UN-comment the function you want to use:
-------------------------------------------------------------------------------------------------------
--//////////////// This is the REQUIRED Header code, Begin //////////////////////
package.path = "./?.lua;c:/Mach4Hobby/MODULES/?.mcc;"
--where the module file is.(change the above path if you want it in a different folder
local ss = require "MAD";--load the module file, call it ss
--/////////////// This is the REQUIRED Header code, End ///////////////////////
--ss.MadINPUTS(); --uncomment to launch the INPUTS floater window
--ss.MadOUTPUTS(); --uncomment to launch the OUTPUTS floater window
-------------------------------------------------------------------------------------------------------
To be able to Enable or Disable (by default they are disabled), the the inputs or outputs from being updated.
You will have to add to your screen two buttons (or other methods to turn on/off the following two named LEDs).
The "MAD.mcc" watches the following 2 LEDs, that you have to add to your screen, and name them the following:
--this enables(ON) or disables(OFF) the update function for INPUTS
--this enables(ON) or disables(OFF) the update function for OUTPUTS
[/list]
Here is some code for making Enable/Disable toggle buttons for the two above LEDs, there is an "Example" screen set here called: "wxMachATC.set" (it already has all the buttons and LEDs in it, assumes stock package path),
that you can use for testing or debugging or to see how to put this in your screen set.
Inputs Enable/Disable btn code for INPUTS:
Text Up: Enable INPUTS Update
Text Dn: Disable INPUTS Update
Button Color Up: Green (plus blink rate 500)
Button Color Dn: Red
Down Script: scr.SetProperty('EnaInUpLed', 'Value', '1');
Up Script: scr.SetProperty('EnaInUpLed', 'Value', '0');
Inputs Enable/Disable btn code for OUTPUTS:
Text Up: Enable OUTPUTS Update
Text Dn: Disable OUTPUTS Update
Button Color Up: Green (plus blink rate 500)
Button Color Dn: Red
Down Script: scr.SetProperty('EnaOutUpLed', 'Value', '1');
Up Script: scr.SetProperty('EnaOutUpLed', 'Value', '0');
That is all there it so Launching the two floater windows, you can minimize them, and they always stay on top, so you can set up a New Machine or debug one. (I may also be adding floaters for: Modbus, and Registers as well..)
NOTE: I will be selling this "Module Add-on" for $10.00 via paypal, but I am looking for
5 (FIVE) beta-testers that will get it for
FREE!! in exchange for sending me "testing results". The .mcc will generate a "PC ID" that you will need to email me so I can generate you a Lic. File. You should be familiar with how to do screen design to integrate MAD.
send me an email if you want to be a beta tester to: PoppaBear(at)Hughes.net ( change the (at) to @ )
thanks in advance!
Scott