Torque

Forums

Forums

Guest  

Show or hide header
Welcome Guest, posting in this forum require registration.




Torque » Torque OBD ECU Scanner » Torque Discussion / Ideas » Auto Logging Script

Pages: [1]
Author Topic: Auto Logging Script
SkyShadex
Member
Posts: 3
Post Auto Logging Script
on: July 16, 2022 (GMT)

Hey all

My idea is to get logging to start with a specific trigger. Somewhat like how a JB4 can be set to log under heavy throttle.

So any sensor and it’s value can be the trigger for starting/ending the log. Based on what I’ve seen from the documentation I’m not sure I can access whatever controls logs, but I figured I’d ask for help here and see what comes up.

Here’s a rough draft of what I have. The example is for starting logging when throttle pedal > 60%.

scriptTitle="Auto Logging";
scriptDescription="Data Logging Starts Automatically after Specified Triggers";
scriptPackage="org.descriptive.unique.key.for.your.script";
scriptVersion=1;
scriptAuthor="SkyShadex";


onInit = function() {
   quit = false;
   counter = 0; 
   /** if there are multiple while loops 
   the counter should keep them 
   from interferring with each other.
   For tracking multiple triggers.
   */
}

main = function () {
	while(!quit) {
		Sensor.getSensorById(49); //this is the PID for my throttle pedal %
		if (Double.getValue() >= 60 && counter = 0){
			// trigger start logging here;
			counter ++;
		}	else if (Double.getValue() >= 60 && counter > 0){
			counter ++;
		}	else{
			// trigger end logging here;
			counter --;
			Time.sleep(500);
		}
	}
}

stop = function () {
	quit = true;
}
SkyShadex
Member
Posts: 3
Post Re: Auto Logging Script
on: July 16, 2022 (GMT)

I’m pretty sure I’m calling the value from that sensor incorrectly. Forgive me I’m newish to programming.

I also obviously have no idea on what needs to go inside of those if statements.

moreause
Member
Posts: 643
Post Re: Auto Logging Script
on: July 18, 2022 (GMT)

why not just log all the time ??

i know programming is fun lol

personnaly i log all the time

speed,rpm and seat belt status ..just in case

looking to add flasher status you never know these days lol

SkyShadex
Member
Posts: 3
Post Re: Auto Logging Script
on: July 19, 2022 (GMT)

Haha I feel ya.

It would be a bunch of useless data for me to filter through.

Plus I view my logs in Datazap. So I’d have to trim the filesize down every time in that scenario lol

Pages: [1]
WP-Forum by: Fredrik Fahlstad, Version: 2.4
Page loaded in: 0.013 seconds.

  Follow me on twitter