Tracing...

Gtuner IV general support. Operation, questions, updates, feature request.

Tracing...

Postby Chaosrocket » Sun Jan 08, 2017 9:55 pm

I know I am going to need this so....Downloaded the t1.gph.

Now need to figure out how to initialise it and where to view it on the device monitor.

I have aged it in the right place and done the include statement.

advice most welcome.

Regards - CR
User avatar
Chaosrocket
Sergeant Major
Sergeant Major
 
Posts: 96
Joined: Mon Jun 13, 2016 9:10 pm

Re: Tracing...

Postby UK_Wildcats » Tue Jan 10, 2017 6:46 am

User avatar
UK_Wildcats
Brigadier General
Brigadier General
 
Posts: 2243
Joined: Thu Jan 08, 2015 6:53 pm

Re: Tracing...

Postby Chaosrocket » Tue Jan 10, 2017 11:27 am

I can't see any mention of tracing... :cry:
User avatar
Chaosrocket
Sergeant Major
Sergeant Major
 
Posts: 96
Joined: Mon Jun 13, 2016 9:10 pm

Re: Tracing...

Postby The_Rabid_Taco » Tue Jan 10, 2017 1:49 pm

Are you referring to the the ability to set the trace values on the Titan One and view those in device manager? The Titan Two GPC language doesn't have a trace value such as that, but a much more robust way to do something similar using printf. I'll leave a link to the documentation on it. It really is not a hard one to use, and it leaves the output in the compiler box, bottom center.

http://www.consoletuner.com/wiki/index.php?id=t2:printf

Let us know if you need some help with that one. I've used it quite a bit and have found it to be really helpful.
User avatar
The_Rabid_Taco
Major
Major
 
Posts: 1066
Joined: Wed Mar 16, 2016 6:04 pm
Location: Pensacola, FL

Re: Tracing...

Postby Sillyasskid » Tue Jan 10, 2017 6:39 pm

It's nice to see the trace value show up in the little graph. So I've been using preset led values. They work the same as the t1 trace values, in the way that once a value is assigned it will keep its value.
User avatar
Sillyasskid
Captain
Captain
 
Posts: 574
Joined: Sat May 14, 2016 3:07 am

Re: Tracing...

Postby Chaosrocket » Thu Jan 12, 2017 10:29 am

Thanks Guys... will take a look...
User avatar
Chaosrocket
Sergeant Major
Sergeant Major
 
Posts: 96
Joined: Mon Jun 13, 2016 9:10 pm

Re: Tracing...

Postby Chaosrocket » Fri Jan 13, 2017 6:21 am

So tried the printf command and that didn't work.. will post code, I just did a hello world job in a combo to see if it worked. No joy. I didn't output any values will retest and post back.
User avatar
Chaosrocket
Sergeant Major
Sergeant Major
 
Posts: 96
Joined: Mon Jun 13, 2016 9:10 pm

Re: Tracing...

Postby Chaosrocket » Fri Jan 13, 2017 7:18 am

So, I have uploaded a screenshot of the tracing fail here https://drive.google.com/open?id=0B-TDPJl60rmEMFN0NnpaQWFlbTA

Symptom 1, no debug output when I run the code. the window on the device shows 2 horizontal bars, so its running the code.

Symptom 2, when I tap X or press and hold X one xbox1 elite controller conected to xbox1 I get the guide button presses.

Code: Select all
 
#include <xb1.gph> // for XB1
#define TRUE   !FALSE
 
bool DetectShortP1 = FALSE;
bool DetectLongP1 = FALSE;
 
main {
 
    if(check_active(XB1_X, 10)) {
        set_val(DetectShortP1, TRUE);
    }
 
    if(check_active(XB1_X, 5000)) {
        set_val(DetectLongP1, TRUE);
    }
 
    if(DetectShortP1 == TRUE && DetectLongP1 == FALSE ){
    combo_run (Short);
    }
 
    if(DetectShortP1 == TRUE && DetectLongP1 == TRUE){
    combo_run (Long);
    }
}
combo Short {
    set_val(DetectShortP1, FALSE);
    set_val(DetectLongP1, FALSE);
    set_val(XB1_X, 100);
    wait(1000);
    set_val(XB1_X, 0);
    wait(100);
    printf("Short Wait: %d", 1000);
}
combo Long {
    set_val(DetectShortP1, FALSE);
    set_val(DetectLongP1, FALSE);
    set_val(XB1_X, 100);
    wait(4000);
    set_val(XB1_X, 0);
    wait(100);
    printf("Long Wait: %d", 4000);
}
 


Help Appreciated
User avatar
Chaosrocket
Sergeant Major
Sergeant Major
 
Posts: 96
Joined: Mon Jun 13, 2016 9:10 pm

Re: Tracing...

Postby J2Kbr » Fri Jan 13, 2017 2:12 pm

I found few errors that I corrected in the code below. (ie, assign a value to variables using set_val, for variables assignment the operator is '='). I have also changed some flow logic. however, please note I have not tested the scrip functionality, so in this matter I am not sure if it is working as you expect.

Code: Select all
 
#include <xb1.gph> // for XB1
#define TRUE   !FALSE
 
bool DetectShortP1 = FALSE;
bool DetectLongP1 = FALSE;
 
main {
    DetectShortP1 = check_active(XB1_X, 10) ? TRUE : FALSE;
    DetectLongP1 = check_active(XB1_X, 5000) ? TRUE : FALSE;
 
    if(DetectShortP1 && DetectLongP1){
        if(Short) combo_stop(Short);
        combo_run(Long);
    } else if(DetectShortP1 && !DetectLongP1){
        combo_run(Short);
    }
}
combo Short {
    set_val(XB1_X, 100);
    wait(1000);
    set_val(XB1_X, 0);
    wait(100);
    printf("Short Wait: %d", 1000);
}
 
combo Long {
    set_val(XB1_X, 100);
    wait(4000);
    set_val(XB1_X, 0);
    wait(100);
    printf("Long Wait: %d", 4000);
}
 
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm

Re: Tracing...

Postby Chaosrocket » Fri Jan 13, 2017 5:35 pm

Will test thanks... just playing at the moment...
User avatar
Chaosrocket
Sergeant Major
Sergeant Major
 
Posts: 96
Joined: Mon Jun 13, 2016 9:10 pm

Next

Return to Gtuner IV Support

Who is online

Users browsing this forum: No registered users and 145 guests