Page 1 of 1
Automatically Start Logging when engine is running issue
Posted: Mon Jul 13, 2015 2:14 am
by rocket6706
I am trying to get the RCP to start logging automatically when the engine running by setting up a lab environment. I connected the RCP to my windows laptop and was able to get the application software connected. I installed the Lua script for subject function and then connected the +12V power to a variable DC power supply. When the RCP is running on USB the voltage is hovering around 4.6v as displayed on Battery display on App. I then switched on the power supply at 12v and saw the battery voltage change on the app, and the Green LED for logging to SD card was off. I then increased the voltage to 14v and verified it displayed same value on battery channel for app, but the green LED remained off. Why didn't the RCP start logging when the voltage exceeded the threshold of 13V in the Script.
Question: In the script should it read "If GetAnalog (7)" or GetAnalog (8 )? Should the last analog channel be scaled from 0-15 or leave it at 0-5 as the default.
Posted: Fri Jul 17, 2015 6:13 pm
by brentp
Hi,
Can you copy and paste your script here for review? We can take a look at it and see if there's anything amiss.
-Brent
Posted: Fri Jul 17, 2015 8:44 pm
by rocket6706
here is what I have in script section. The behavior expected is battery voltage > 13 = green light flashing and data writing to SD card. What I get is Light off. I can press the button at both > and < 13 volts and it will start logging with flashing light. btw, I am a hardware (EE/ME) guy so this is all new to me.
function onTick()
if getAnalog(7) > 13 then
startLogging()
else
stopLogging()
end
end
Posted: Fri Jul 17, 2015 8:56 pm
by brentp
To debug try something simple that will output the current voltage value to the log. for example:
function onTick()
println(getAnalog(7))
end
This will show you the actual value being registered by RaceCapture/Pro under varying conditions. Yes, #7 is the battery voltage input.
Posted: Fri Aug 21, 2015 4:37 pm
by rocket6706
Mystery solved. I found an I/D-ten-t (IDIOT) failure on my part and eliminated a space in my code. All working and additional scripts added as,well.
Posted: Fri Aug 28, 2015 10:29 pm
by fmbo
Have the same problem and actually I wonder, how is it possible that 7th analogue channel is used for the battery if the logging unit have 7 physical analogue inputs and I can map e.g. my temeperature sensor to analogue 7?
Posted: Mon Aug 31, 2015 8:01 pm
by crteam
Input 1 = analog 0
Input 2 = analog 1
Input 3 = analog 2
etc.
Posted: Thu Sep 10, 2015 10:50 pm
by brentp
So, in scripting the analog channels are zero based, so the first analog channel is 0, then 1, etc.
Channel 7 is the 8th channel, which is tied to battery voltage.
Hope this helps!