Menu

Topic-icon User Variable Reporting Issues

More
5 years 6 months ago #29529204 by jetonski
I've run into a small issue and as a result have a suggestion for a minor improvement in the firmware.

I've been using the following to monitor user variables in my script, as a means of runtime debugging:
?var

giving a result of
VAR=-5686:-4497:-66:5:0:0:0:0:0:0:0:0:16:137:38126:86394769

If I then do
# 20

I get a steady stream of this data, which I log and graph.

But I've found that eventually this produces what I can only assume is a serial overrun. Serial output from the unit stops completely (verified with a scope), while input still works just fine. On hard or soft reset, serial output resumes.

In the hopes of avoiding this hangup, I was considering spreading the reporting out temporally a bit by doing the following:
?var 1
?var 2
?var 3
(...)
# 20

But since any indexed ?var query simply returns (e.g.):
VAR=57

I wouldn't be able to parse the results meaningfully.

My first request was to please update the response to
?VAR [INDEX]

to include the variable index. For example:
VAR01=57


But I also just discovered that the following:
?var 1
?var 2
# 20

produces the following output:
VAR=-5686:-4497:-66:5:0:0:0:0:0:0:0:0:16:137:75325:86394769
VAR=-5686:-4497:-66:5:0:0:0:0:0:0:0:0:16:137:75327:86394769
VAR=-5686:-4497:-66:5:0:0:0:0:0:0:0:0:16:137:75329:86394769
VAR=-5686:-4497:-66:5:0:0:0:0:0:0:0:0:16:137:75331:86394769
VAR=-5686:-4497:-66:5:0:0:0:0:0:0:0:0:16:137:75333:86394769
VAR=-5686:-4497:-66:5:0:0:0:0:0:0:0:0:16:137:75335:86394769
VAR=-5686:-4497:-66:5:0:0:0:0:0:0:0:0:16:137:75337:86394769
VAR=-5686:-4497:-66:5:0:0:0:0:0:0:0:0:16:137:75339:86394769
VAR=-5686:-4497:-66:5:0:0:0:0:0:0:0:0:16:137:75341:86394769

Looks like a bug in the command history handling of ?var queries.

Thanks!

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

  • Griffin Baker
  • Griffin Baker's Avatar
5 years 6 months ago #29529205 by Griffin Baker
Replied by Griffin Baker on topic User Variable Reporting Issues
Try clearing your buffer history. It may be full and needs to be cleared to send in the new data request.

# C

Then resend the queries.

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

  • roboteq
  • roboteq's Avatar
5 years 6 months ago #29529206 by roboteq
Replied by roboteq on topic User Variable Reporting Issues
It would be desirable to have the var identified but this is going to require a structural change.

Best would be that you use the ?var but slow down the rate.

When you output individual vars, the wait time is between each var send. So if you need to read more than a few, outputing them all, slower will still get you ahead.

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

More
5 years 6 months ago #29529207 by jetonski
Thanks Griffin, I left that out for brevity, but I actually do:
# c
# 20
It runs for a while, but in time the output always hangs.

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

More
5 years 6 months ago #29529208 by jetonski
Even at 40 ms increments it still hangs up. I can run even slower but if I miss something transient, e.g. a spike from an accelerometer, it can still be difficult to track down the origin of an issue at times. I've been working with balancing these factors out and I'm still moving forward, so this isn't so much a request for help as much as pointing a few issues I came across that could eventually be improved:

1. serial out overflow is not handled as gracefully as possible
2. var reporting could be improved
3. var query in the command history doesn't behave as expected

This is a great controller. It has proven very reliable, and your support for it has been outstanding. Just meant as friendly suggestions.

Thank you for the help!

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

  • Griffin Baker
  • Griffin Baker's Avatar
5 years 6 months ago #29529209 by Griffin Baker
Replied by Griffin Baker on topic User Variable Reporting Issues
Have you tried at # 50 and # 100?

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

More
5 years 6 months ago - 5 years 6 months ago #29529210 by jetonski
I have seen serial output hang even at # 100.

When all 16 variables are reporting large values, that's a long string of numbers. Just a guess, but maybe the perfect storm of timing issues line up and a long string sent at once is enough to cause it. It might not be gradual buffer backup.

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

Moderators: tonysantoni
Time to create page: 0.091 seconds
Go to top