18650 Conditioner unit.

Share your projects using MegunoLink Pro here!
Mike-AU
Posts: 32
Joined: Wed Mar 13, 2019 12:03 am

Fri Apr 19, 2019 3:32 am

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.
Mike-AU
Posts: 32
Joined: Wed Mar 13, 2019 12:03 am

Mon Jun 10, 2019 7:24 am

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.
philr
Posts: 446
Joined: Mon May 26, 2014 10:58 am

Tue Jun 11, 2019 8:40 am

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
Mike-AU
Posts: 32
Joined: Wed Mar 13, 2019 12:03 am

Tue Jun 11, 2019 10:16 am

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.
Mike-AU
Posts: 32
Joined: Wed Mar 13, 2019 12:03 am

Tue Jun 11, 2019 11:09 pm

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 :)
philr
Posts: 446
Joined: Mon May 26, 2014 10:58 am

Thu Jun 13, 2019 7:25 am

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
Attachments
MessageLibraryGrabMultipleControlValues.zip
(13.34 KiB) Downloaded 1100 times
Mike-AU
Posts: 32
Joined: Wed Mar 13, 2019 12:03 am

Fri Jun 21, 2019 8:35 am

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.
philr
Posts: 446
Joined: Mon May 26, 2014 10:58 am

Fri Jun 21, 2019 9:15 am

Interesting, try installing the upload monitor again.

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

Let me know if it fixes your problem.

Cheers
Phil
Mike-AU
Posts: 32
Joined: Wed Mar 13, 2019 12:03 am

Sat Jun 29, 2019 11:00 pm

Re-installing fixed the issue, Thanks Phill.

On your next update, could you please look at upgrading the priority of messages from the interface to the Arduino, they seem to lag quite badly at times. maybe in simpler interfaces this is not a problem, but the thing I am putting together is showing this issue.

Also , Applying changes in designer keeps updating channels in tables... not a biggie, just annoying to have to reset them every time.

Keep up the fantastic work... I still havent broken it yet!!.

Mike.
philr
Posts: 446
Joined: Mon May 26, 2014 10:58 am

Fri Jul 05, 2019 10:01 am

Hi Mike, presumably this is just based on the actual amount of time it takes to send messages to your device. What baud rate are you using? Can you try increasing? 500,000 should work on arduino.

Cheers
Phil
Post Reply