Sending serial data to DL1 MkII

Turbo Synthesis
Posts: 7
Joined: Tue Mar 06, 2018 1:25 pm

Sending serial data to DL1 MkII

Postby Turbo Synthesis » Wed Jun 12, 2019 9:55 am

Good morning,

I have a question about sending serial data to a DL1 for it to include in a log file.

We currently have a DL1 MkII in our endurance car, connected to an arduino fitted with a custom shield which has one RS232 channel and two CAN channels.

The RS232 channel decodes the serial stream from the DL1 at 115200 BAUD, one of the CAN channels decodes CAN messages from our ECU at 500kbps and the second CAN channel outputs data to our steering wheel at 125KBPS. There is also a USB port which outputs data to our custom dash screen.

All of the above is working well but now we'd like to include some of the data we are receiving from the ECU in the DL1 log file.

Is the data format for sending data to the DL1 the same as the data format it transmits data in?

ie. If I want to send a 9th analog channel (all 8 physical channels are in use) and include it in the log file do I just send [Channel Number][Data High][Data Low][Checksum] or is there a different protocol? If that protocol is correct does it automatically get logged or do I have to turn it on somewhere? Also can I send data to the DL1 on the same port as the output stream or should it be sent to the other port?

Thanks in advance for any assistance,

Gareth

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

Re: Sending serial data to DL1 MkII

Postby racetec » Mon Jul 01, 2019 8:04 am

Yes that is exactly how you do it. You can send it through as an analogue channel, or as temperature, pressure, etc. It can go in on the same port that the data is coming out from. If you are running the old DL1 MK2 config software then make sure that incoming serial is turned on for logging to the card. It is easy to test the output of your system by connecting to the Live Monitor software instead of the DL1, you can then see the data and check to see if there are any errors in the data stream. If you get stuck drop me an email mhill at race-technology.com

Martin

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

Re: Sending serial data to DL1 MkII

Postby ECOELEC » Mon Jul 15, 2019 5:22 pm

Hello,

If you need a sample code in C (for DSPIC µcontroller) which send constant "45" (for example) to variable 36 (analog input n°17):

Code: Select all

#include<33FJ256GP710.h>
#include<math.h>
#FUSES HS,PR_PLL
#use delay(clock=80M,oscillator=8M)
#use rs232(uart2, baud=115200,bits=8,parity=N,stop=1)

unsigned char NUM_MSG,MSG_HI,MSG_LOW,CHECK;
unsigned int LGR_MSG,DATA;

void main(void)
{
while(true)
{
DATA=45;
NUM_MSG=36; //to write in the variable n°36 of the DL2
MSG_HI=DATA>>8;
MSG_LOW=DATA;

//Computing the checksum
LGR_MSG = NUM_MSG+MSG_HI+MSG_LOW;
CHECK = fmod(LGR_MSG,256);

//Sending message
printf("%c%c%c%c",NUM_MSG,MSG_HI,MSG_LOW,CHECK);
}
}
If you won't send data to DL2 soon, you should also send a "padding" message (dec: 12 255 11) after your data.

Regards


Return to “General support questions”

Who is online

Users browsing this forum: Google [Bot] and 42 guests