Reset pulse count

ECOELEC
Posts: 49
Joined: Sat Nov 29, 2008 10:33 pm
Location: Brussel
Contact:

Reset pulse count

Postby ECOELEC » Tue Jul 09, 2019 11:56 am

Hello,
Is there anyway to reset the pulse count on a DL1 (F1 to F4 inputs) without powering off the DL1?
I use the wheel pulse count to compute the travel distance from start.
It should be great to reset them when we start logging.
Regards

racetec
Site Admin
Posts: 326
Joined: Thu Oct 27, 2005 12:02 pm

Re: Reset pulse count

Postby racetec » Wed Jul 10, 2019 12:20 pm

Which version of the DL1 are you doing this with, it is one which logs to an SD card or CF card?

Martin

ECOELEC
Posts: 49
Joined: Sat Nov 29, 2008 10:33 pm
Location: Brussel
Contact:

Re: Reset pulse count

Postby ECOELEC » Sun Jul 14, 2019 10:47 pm

Hello Martin,
My DL1MK3 log on a SDHC card.
JM

racetec
Site Admin
Posts: 326
Joined: Thu Oct 27, 2005 12:02 pm

Re: Reset pulse count

Postby racetec » Mon Jul 15, 2019 8:58 am

I believe that there is a way you will be able to get what you want, but not in a direct way. Have a look here:

https://www.race-technology.com/wiki/in ... bleMapping

Look at the section right at the bottom about the order in which values are calculated. This makes it possible to use a previously stored value of a variable if required. You can use this to store a value and update it under certain circumstances. So you could have a variable which stores the pulse count variable and updates when not logging. Then create another variable which takes the current value of the pulse count and subtracts this offset from it.

I have done this sort of resettable counter for use in timers previously. It isn't something that was specifically designed in to the product, but due to the way that the variables are calculated internally it does do the job.

Martin

ECOELEC
Posts: 49
Joined: Sat Nov 29, 2008 10:33 pm
Location: Brussel
Contact:

Re: Reset pulse count

Postby ECOELEC » Mon Jul 15, 2019 12:45 pm

Hi Martin,
It's a good idea.
As the Pulses are 3 bytes variable, I need to find same "free to use" variable in the map.
As I didn't use the pulse3 & 4, I've used them.

I've tried to defined the custom equation of "pulse3" (VAR_0318) in the mapping section of DL1 configuration:
Pulse3 Y=: "if VAR_7008 = 0 then VAR_0316" but it return "error in custom variable definition"
... and defined "Pulse4" as VAR_0316-VAR_0318 (pulse1 - last not logged pulse1 count, --> OK)

What's wrong in my equation?
JM

racetec
Site Admin
Posts: 326
Joined: Thu Oct 27, 2005 12:02 pm

Re: Reset pulse count

Postby racetec » Mon Jul 15, 2019 1:05 pm

The format of the IF statement is

if(x,y,z) where x is the equation being evaluated, y is the result if true, z is the result if false.

So it would be something like if(VAR_7008=0,VAR_0316,0)

This would return a value of VAR_0316 if VAR_7008=0, otherwise it would return a value of 0.

Martin

ECOELEC
Posts: 49
Joined: Sat Nov 29, 2008 10:33 pm
Location: Brussel
Contact:

Re: Reset pulse count

Postby ECOELEC » Mon Jul 15, 2019 4:47 pm

same issue with if(VAR_7008=0,VAR_0316,0) --> Error in custom variable information (Pulse2 mapped as "Calculated from a combination ..." in the DL1 config software).
JM

racetec
Site Admin
Posts: 326
Joined: Thu Oct 27, 2005 12:02 pm

Re: Reset pulse count

Postby racetec » Tue Jul 16, 2019 6:37 am

I have a feeling that this could be a decimal separator issue. The , separator is for when the decimal separator is set for . If you have your decimal separator set for , then try using ; instead of , in the argument.

Martin

ECOELEC
Posts: 49
Joined: Sat Nov 29, 2008 10:33 pm
Location: Brussel
Contact:

Re: Reset pulse count

Postby ECOELEC » Tue Jul 16, 2019 10:21 am

Hi Martin,
It's ok with ";" (perhaps add this comment to the knowledge base)

For interested users, I describe what I've done:

The pilot need to know the exact time and distance since he start his run (Shell Eco Marathon race).
The DASH4pro button function was configured to start/stop the log.
The log status is used to "reset" the time and distance (not really reset but stop recopying actual time and pulses1 on two variables which are deduce from actual time and pulse1).
If the logging status (VAR_7008) is null, the distance and the time should remain constant.

NB: I use F1 (pulse 1), connected to a wheel sensor to compute the distance.
I don't use VAR_2500 to VAR_2511 because of ... an electrical motor.
Variable mapping is done by the DL configuration software

For the time:
- I map the "Fuel inj 1 PW on (measured time 1)" (VAR_2500; 3 byte) to the custom equation: if(VAR_7008=0;VAR_0001;VAR_2500)
- I map the "Fuel inj 2 PW on (measured time 2)" (VAR_2501) to the custom equation: VAR_0001-VAR_2500
--> If logging status is false (zero), VAR_2500 recopy the VAR_0001 (time) otherwise it will remain constant

For the distance: (quite the same)
- I map the "Fuel inj 3 PW on (measured time 3)" (VAR_2502) to the custom equation: if(VAR_7008=0;VAR_0316;VAR_2502)
- I map the "Fuel inj 4 PW on (measured time 4)" (VAR_2503) to the custom equation: VAR_0001-VAR_2502
--> If logging status is false (zero), VAR_2502 recopy the VAR_0316 (Pulse 1) otherwise it will remain constant

As this, I use the VAR_2501 as "time since start of run" and VAR_2503 as "distance since start of run".


Return to “General software support”

Who is online

Users browsing this forum: No registered users and 9 guests