Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
2,186 Views

System Console Dashboard examples?

I'd like to use the System Console Dashboard to set up some GUIs for demos. The docs I can find are pretty brief (and don't talk much about how to display info received from the development board). Can anyone point me to any examples of TCL for Dashboards that do interesting things? I mean, the manual shows you how to set up tables, dials, and such, but not much on how to drive them with data. For example, how would i use them with the monitoring commands? 

 

thanks! 

/j
0 Kudos
9 Replies
Altera_Forum
Honored Contributor I
137 Views

I don't have any examples to hand, but the idea is to create a monitor and register a callback on it. You can then set the value of the property from the callback. 

 

Exactly what you set depends on what type of widget it is, on a label you'd set its text property, on a LED you would set its color (sorry about the misspelling), on a dial you'd set its value. 

 

You need a way to pass the ID of the widget into the calback, the easiest way to do this is to have the callback proc take arguments, and pass the ID in when registering the callback.
Altera_Forum
Honored Contributor I
137 Views

Thanks - not sure why I need the callback though. I got some stuff going where it was reading values on my board and displaying them on the screen. Unfortunately, whenever you finish executing a procedure you have to close SC and re-open it for it to work properly. Altera support claims this is proper operation. I'm questioning that 8-} 

/j
Altera_Forum
Honored Contributor I
137 Views

You shouldn't have to close SC and re-open it (maybe it won't cope with some changes if you've reprogrammed the FPGA with something different but if the hardware is the same you should be able to keep using it over and over again) 

 

Can you post a code fragment and tell me what error you're getting from it? 

 

I'm assuming you want to read the values regularly and update the display as the values in the board change. The callback is there because the monitor service will read your values every second and call your code so you can display them (doing it this way gets you accurate timing which the standard alarm procedure doesn't. It also gets you better bandwidth utilisation).
Altera_Forum
Honored Contributor I
137 Views

Hi Wombat - thanks for the reply. The problem I have is this: I wrote a small TCL script like so:  

 

namespace eval dashboard_example {  

set dash [add_service dashboard dashboard_example "Dashboard Example" "Tools/Example"] 

dashboard_set_property $dash self developmentMode true 

dashboard_set_property $dash self visible true 

dashboard_add $dash time0 timeChart self 

dashboard_set_property $dash time0 maximumItemCount 10 

for {set x 0} {$x < 10} {incr x} { 

set y [expr $x % 8] 

dashboard_set_property $dash time0 latest $y 

after 1000  

 

I can run this once, and that first time I run it, it runs properly (you can see it updates 10 times) and looks great. if I run it again, nothing happens for a while, and then the GUI screen updates to the final appearance of the time chart after script completion.  

 

If you run it the 2nd time, you'll get the error  

 

WARNING: Overwriting /desktop/dashboard_example 

SEVERE: Cannot register content with passed id. An already registered dockable exists. [id : Dashboard Example] 

 

But I get this error with ANY script like this that I run (one that generates dials, tables, etc), and they all run correctly multiple times.  

 

If I add a close_service command at the end of the script, I get  

 

INFO: The dashboard service does not require or support closing. Close is not performed. 

 

Based on these 2 behaviors, Altera Support (10823966) concluded that "you cannot rerun the script without exiting the system-console". 

 

I pushed back (answer sounds lame), but it's currently an issue, whether intended or not. 

 

HTH - if you have any ideas I'd love to hear them 

 

thanks! 

/j
Altera_Forum
Honored Contributor I
137 Views

Hmm, I see your problem now. The issue is with the add_service command, the second time you run the script this is adding a service which already exists. 

 

If there was a remove_service command then you could call that, but there isn't (yet) so some sort of workaround may be required. 

 

Could you store the ID from add_service in a global variable and if that's set you don't need to call add_service a second time? Unfortunately you'll need to call dashboard_remove to remove all the widgets from your dashboard before adding the new ones again. That's the best I can think of I'm afraid. 

 

ps. I found a dashboard example - it's in `help dashboard_set_property. This shows you how to use a button to start/stop capture. Using the monitor service to read data will be more efficient than using master_read_memory.
Altera_Forum
Honored Contributor I
137 Views

so I copied the script above into a 2nd script and deleted the 1st 5 commands (so the 2nd script runs only the timechart, assuming the dash is set up). I run the first script - runs ok, then the 2nd script - after a really long time (like a minute) the 2nd chart appeared in its completed form - no luck here I'm afraid. 

/j 

 

ps - thanks for the pointer to the example - a little more detail than what's in the manual (but no good for solving my issue above)
Altera_Forum
Honored Contributor I
137 Views

The problem you're running into: 

 

SEVERE: Cannot register content with passed id. An already registered dockable exists. [id : Dashboard Example] 

 

is a bug that gets triggered because the "Dashboard Example" tab is open in System Console. If you were to close the tab before re-running the script, then you wouldn't run into this problem and it should work as good as the first time you ran the script. This bug is fixed in 11.1. 

 

Also, I updated your script for it to use callbacks. Using callbacks will make your GUIs more responsive. I added a comment where you would need to access the hardware to get new values, as opposed to using the fake values. Also, it should be trivial to add a button that changes another variable to stop the updates from happening or restarting them once it's stopped. 

 

I hope it helps. 

 

Silvio 

 

namespace eval dashboard_example { variable dash variable count set dash dashboard_set_property $dash self developmentMode true dashboard_set_property $dash self visible true dashboard_add $dash time0 timeChart self dashboard_set_property $dash time0 maximumItemCount 10 set count 0 proc update {} { variable dash variable count set count # Here's where you would do a master_read or bytestream_receive to get some data # from the device, and then update time0's latest with it, as opposed to $count. dashboard_set_property $dash time0 latest $count after 1000 } update }
Altera_Forum
Honored Contributor I
137 Views

hello, i also need some help here. Any system console dashboard example on key in some values to the textField widget and then printout that values onto another label widget? 

Does anyone knows how to use this onChange command? I tried to the following scripts but myLed won't turn green? 

 

namespace eval dashboard_example2 { 

variable dash_path [ add_service dashboard dashboard_example "Dashboard" "Tools/Dashboard"] 

dashboard_add $dash_path writeTextfield textField self 

dashboard_add $dash_path myLed led self 

dashboard_set_property $dash_path writeTextfield enabled true 

dashboard_set_property $dash_path myLed color black 

proc set_led_color { } { 

dashboard_set_property $dash_path myLed color green 

dashboard_set_property $dash_path writeTextfield onChange  

[list ::dashboard_example::set_led_color] 

 

Can anyone please help? 

 

thanks
Altera_Forum
Honored Contributor I
137 Views

Hi! 

 

The textField widget doesn't have an onChange property. You should be getting an error while trying to set this property. 

 

Silvio
Reply