Telemetry Script in MicroBasic

9 years 3 months ago #29529391 by amathews
Telemetry Script in MicroBasic was created by amathews
I used the manuals and this forum to create this simple telemetry script. It continuously cycles to create and send the serial message shown in the "Print" function. it sends the message every 1000ms.

It worked with a HBL2360.

you can either run it using roborun+ and see the results in the console, or by activating script auto-start in the startup config, you can see the output using a serial terminal like tera term (roborun+ must be disconnected for this).

I decided to place the script here to help others get this function working. Please add to this thread to improve on the script or replace it entirely with something better. thx

top:
m1curr = GetValue(_MOTAMPS, 1)
m2curr = GetValue(_MOTAMPS, 2)
m1speed = GetValue(_BLSPEED, 1)
m2speed = GetValue(_BLSPEED, 2)
battvolt = GetValue(_VOLTS, 2)
battcurr = GetValue(_BA, 2)
temp = GetValue(_TEMP, 2)
Print("\n","\r","a",m1curr,"b",m2curr,"c",m1speed,"d",m2speed,"e",battvolt,"f",battcurr,"g",temp)
wait(1000)
goto top

Please Log in or Create an account to join the conversation.

9 years 3 months ago #29529392 by Griffin Baker
Replied by Griffin Baker on topic Telemetry Script in MicroBasic
Correct, if you make and run a script like you have shown, then the queried data will populate. However, the telemetry string was supposed to do the same thing, minus the need for a script. That is the function that isn't working and we haven't figured out exactly why it doesn't work.

Please Log in or Create an account to join the conversation.

9 years 3 months ago #29529393 by amathews
Replied by amathews on topic Telemetry Script in MicroBasic
Thanks Griffin.

Please correct me if I'm wrong, but an additional feature the script provides is the ability to structure the serial messages as the user desires.

In our particular case, this made things a bit easier, and we did not see this could be easily done with the ^TELS feature.

Please Log in or Create an account to join the conversation.

9 years 3 months ago #29529394 by Griffin Baker
Replied by Griffin Baker on topic Telemetry Script in MicroBasic
The tel string was designed so that upon power up, it would query a set of values that you wanted. But it only shows the data once.

The script allows you to repeatedly get that data back by simply setting the queried data to be printed back in a loop.

Some just want simple queried data back one time upon each power up and then be on their merry way; others don't.

The printed data really is good if you are looking to receive data as it happens. Most applications, they set up and make their controllers operate the motors in the way they want to and leave into place until something out of the normal operation occurs.

Others have a microcontroller attached to our controllers that queries the data and logs it.

There are always various different needs and way of doing things, so in the end, it really is based on the users needs.

Please Log in or Create an account to join the conversation.

Time to create page: 0.072 seconds