Page 2 of 2

Re: 18650 Conditioner unit.

Posted: Fri Apr 19, 2019 3:32 am
by Mike-AU
OH more info..

I have 5 tables on the screen and I am trying to put the information of 4 sensors in each table for a total of the 20 sensors.

It seems to have accepted this line in the global area "Table DT1, DT2, DT3, DT4, DT5; as to define 5 channels to use for the tables 1-5.

Mike.

Re: 18650 Conditioner unit.

Posted: Mon Jun 10, 2019 7:24 am
by Mike-AU
Hey Phil.... me again.... having issues,.


with this code:-


Serial.println(" Checkbox routine Started");

Panel.GetValue(("ckb1"), ("Value"));

delay(5000);
I get a return of what the checkbox is set too , but i A) cant work with the data returned and B) in the serial monitor I get this:-

Checkbox routine Started

{UI:UpDate|GET|ckb1.Value} {UI:UpDate|set|ckb1.Value=3}

I understand the get statement, but where does the set statement come from (and its in red text) in the serial monitor.

What i have is 20 checkboxes the ones with the up/down counter in them.
what i am trying to do is set them so if the value is :-
0 (zero) do not run a discharge cycle.
1 run one discharge cycle
2 run 2
3 run 3 cycles
if its set greater than 0 , lets say one (1). then runt the discharge code, also set the value on the visulizer by -1.
I spent all day on this and got no-where , so its time to ask the expert.

I am just guessing that the RED responce is the code telling me "hey that box named ckb1 is set to a value of 3"
OK, if that is correct, how do I get that value=3 into a variable I can work with?
I have tried "Temp=Value; Print Temp; and i get a big fat nothing, or some number like 735 I feel I am missing something here.

All the other code is setting or putting numbers INTO the screen, this is my first time at trying to get something on screen OUT..

Mike.

Re: 18650 Conditioner unit.

Posted: Tue Jun 11, 2019 8:40 am
by philr
Hi Mike, strange checkboxes are not suppose to have value properties. They have a checked property. I think you might mean numeric up down controls.

Yep red basically means message going out the serial port rather than in from the arduino. So megunolink is sending that message to your Arduino. We don't have a parser for getting the value out of a get request (this feature is not really used). Its probably better to use a message library (see it in the interface panel designer). It lets you trigger a command. Only example is this currently
https://www.megunolink.com/documentatio ... egunolink/

We generate a time message and send back whenever the arduino requests a sync. You would basically send back the state of all your number boxes when you request it. Have a play and see how you go. If no luck I can try work up and example tomorrow night.

Cheers
Phil

Re: 18650 Conditioner unit.

Posted: Tue Jun 11, 2019 10:16 am
by Mike-AU
Thanks Phil, why did i have gut feeling you was gonna say that LOL.. Yes number up/down boxes is what i ment..
Strange that we can read them but not do anything with the result.

I mean really, if you set a box with the number 5 in it, is it not a good idea that the arudino is made to do something or other 5 times?
otherwise whats the use of the box?
I mean if it can read the box, cool, but not be able to do anything with the number seems a bit counterproductive . Add that to your next "to do" list.
possibly...

Mike.

Re: 18650 Conditioner unit.

Posted: Tue Jun 11, 2019 11:09 pm
by Mike-AU
Morning Phil..

After burning the midnight oil last night, I dont think the Message library is the answer. its more of a way to set custom messages.

I re-studied the Number up/down section and discovered that "Value" can be swapped out with the function 'DoubleValue".

I tried that this morning, and had the same result.

Now this description found on the info page:-
Gets/sets the current control value as a Double. This can be more convenient for mathematical operations than the Decimal returned by the Value property"
That statement tells me that what I am trying to do should be possible. I just have not got my brain to comprehend how.
As i said before it makes no sense to have a box you can program on the interface, but have no way to get the Arduino to respond to the programmed input.
So now, I am currently at a dead halt with the project. I even searched Github to see if I could find any referance to this issue.

Hoping for a quick resolution... Mike :)

Re: 18650 Conditioner unit.

Posted: Thu Jun 13, 2019 7:25 am
by philr
Hi Mike, the only way its possible currently is to build something that parses the reply you mentioned earlier {UI|set|value=5.6}. This is no easy feat.

Attached is an example thats doing roughly what you want using the message library.

Let me know if you think it can be adapted.

Cheers
Phil

Re: 18650 Conditioner unit.

Posted: Fri Jun 21, 2019 8:35 am
by Mike-AU
OK, seems we have a couple of issues... since the latest release, when compiling the sketch , it no longer lets "go" of the serial port and allows the upload. I now have to click on connection manager ,disconnect the panel, upload the sketch and reconnect the panel when done.
Problem with this is, when it reconnects it likes to screw up the data flowing in from the arduino. It like to make some really wonderfully named channels all on its own.

Re: 18650 Conditioner unit.

Posted: Fri Jun 21, 2019 9:15 am
by philr
Interesting, try installing the upload monitor again.

https://www.megunolink.com/documentatio ... tegration/

Let me know if it fixes your problem.

Cheers
Phil