So, yes, I know there are post about this before, but appereantly the way this is done has changed and has several answers throughout the entire forum now... So, I have to ask again, with a demo on how it's NOT working as my example...
So, what I'm trying to do is to read the state value on wether or not the ME1 button is selected on the mixer. In other words, I want this to be on when my Custom DashBoard opens...
In other words, I cant just pull in the button from the panel and have people click that, I want to be more elegant and make sure it's allways like that whenever they open my DashBoard... Basically, remove as much human interaction and human error as possible.
So, what I want to do is to read the state of that button.
I should get the value of that button parameter, and do a basic check of if NOT on, then run command to set it on.
So, I open my Graphite parameters (for some reason only the API one showed up for the longest time, but suddenly the "Config" and "Not In Menu" appeared as well. No idea why, but I'm happy with that.
So! I go into panel, and look at the ME1 button in inspect mode and get this:

Ok, so, the OID for the value is 0x24C5, and it should be an integer, constraint, with the values 0 and 1.
Should be simple and all...
So, I go to just a simple button and add a task. All this task should do is just to get that value, and send it to debug.

So, that should be it... No more hocus pocus, and I should get the value of that parameter and send it to debug... Right?
Well, no matter what I do in my panel, and set the selection to MiniME1 or what not, this button will allways and no matter what send "0" to my debug window...

Regardless of the "state" of that button if it's lit up or not, it allways returns 0...
Sooo, that aint working...
So, on to another thing...
If I then go into the ogScript and want to do my IF check etc there later, this is what I get.
ogscript.debug(params.getParam("Graphite 00:0F:9B:03:75:03<br>Slot 0<br>Graphite", '0x24C5', 0).getValue());
(of course some commented out info about the visual logic, but I dont care about that...)
So, usually, if you want to get the parameter value from your DashBoard the code is:
// From using Script Palette
var x = params.getValue('exampleParam', 0);
// And this is if you use Visual Logic
params.getValue('exampleParam', 0);
But when handling values from the Graphite, we suddenly add the .getValue() function at the end instead.
Anyhow, I tried this:
var x = params.getParam("Graphite 00:0F:9B:03:75:03<br>Slot 0<br>Graphite", '0x24C5', 0).getValue();
ogscript.debug('Value is: ' + x);
Again, no matter what I do though, I cannot get the value to be anything different than 0.
I also tried this one, just to check if the "params.getValue" could be used instead.
var x = params.getValue("Graphite 00:0F:9B:03:75:03<br>Slot 0<br>Graphite", '0x24C5', 0);
ogscript.debug('Value is: ' + x);
But that just gives me an error message.
So in the end I'm stuck with two questions...
- Why is the value always 0? Why cant I read the state of the button?
- How can I eventually SET the value to 1 when I eventually get a read of the value? Seeing as we now use different syntax for reading value, I assume the setting of a value is different as well.
Graphite Version: 2.2
DashBoard Version: 8.6.0