Enable HBA on MQB cars with existing A5 camera

   #1  

hadez16

Verified VCDS User
Verified
Joined
Jun 19, 2017
Messages
824
Reaction score
702
Location
Germany
VCDS Serial number
C?ID=289891
Hi Guys,

I'd like to share an example script for enabling the High Beam Assist on MQB cars that already have the A5 camera.

Code:
StartVCDS()
CheckForUnits("A5",1)
OpenUnit("A5")
	TestPartNo("3Q0 980 654",0)
	ChangeCoding("21:5","")
CloseUnit()
OpenUnit("A5")
	TestPartNo("5Q0 980 653",0)
	ChangeCoding("2:0","")
CloseUnit()
OpenUnit("09")
	TestAdpChannel("Erweiterte_Fernlichtsteuerung","AFS: Fernlicht ueber AFS",0)
	LoginToUnit("31347")
	ChangeAdpChannel("Erweiterte_Fernlichtsteuerung","AFS: FLA: Fernlicht ueber AFS")
CloseUnit()
OpenUnit("09")
	TestAdpChannel("Erweiterte_Fernlichtsteuerung","AFS: BCM-Fernlicht",0)
	LoginToUnit("31347")
	ChangeAdpChannel("Erweiterte_Fernlichtsteuerung","AFS: FLA: BCM-Fernlicht")
CloseUnit()
OpenUnit("09")
	TestAdpChannel("Erweiterte_Fernlichtsteuerung","Basis",0)
	LoginToUnit("31347")
	ChangeAdpChannel("Erweiterte_Fernlichtsteuerung","Basis: FLA")
CloseUnit()
OpenUnit("09")
	TestAdpChannel("Frontscheibenwischer-Adaptives Nachwischen bei SRA","",0)
	;this channel ONLY exists in pre-Facelift BCMs
	ChangeCoding("2:0","") ; Bit 0 sets the HBA setting to the current lighting config
CloseUnit()

ClearAllDTCs()

This script supports both A5 camera types and both BCM types (the old ones and the newer ones where everything is done via adaptation).

Let me explain this a little bit:

CheckForUnits("A5",1)
This command tests if unit A5 is installed at all.
If not, the whole script is cancelled with an error.

TestPartNo("3Q0 980 654",0)
At the moment when this command is executed, the control unit is already opened.
It checks if the part number is the string mentioned.
If not, the script will skip this whole control unit part and goes to the next control unit block.
The number "0" after the comma indicates that the block should be skipped. Putting a 1 in it would cause that the whole script exists with an error if the condition is not met.

TestAdpChannel("Frontscheibenwischer-Adaptives Nachwischen bei SRA","",0)
What has wipers (wischer) to do with HBA? Nothing.
This is a little trick to test if we have a pre-Facelift BCM or not as this channel does not exist (to my knowledge) in facelift BCMs.
It helps to distinguish if the coding steps has to be done like for the pre-Facelift or Facelift.

ChangeCoding("21:5","")
A lot of people complained about the syntax of this command, I'll defend this a bit and explain it again :)
The first part in quotes is for activation of bits.
21:5 means "set Bit 5 in Byte 21"
21:5,7 means "set Bit 5 and Bit 7 in Byte 21
21:5,7/5:0 means "set Bit 5 and Bit 7 in Byte 21 and set Bit 0 in Byte 5
and so on...the same with deactivating bits in the second part in quotes.
Activating and Deactiving can be combined in one command!


I did not have the chance to check if the names of the adaptation channels are exactly the same in the english version. I think so for the BCM, but I am not sure. The script was initially written for the german version.
If the channel names and values have a different localization in the english version......go fix it yourself :cool:

My intention was to give a little example about the capabilities and error handling stuff that is possible with the tool.

Cheers,
hadez16
 
   #2  

Uwe

Benevolent Dictator
Administrator
Joined
Jan 29, 2014
Messages
48,902
Reaction score
33,626
Location
USA
VCDS Serial number
HC100001
Would it be better to use the channel "descriptors" ("IDEnnnnn" and so on) than the text descriptions? The text descriptions may indeed vary depending on the language version of VCDS, while the descriptors should be the same.

-Uwe-
 
   #3  

hadez16

Verified VCDS User
Verified
Joined
Jun 19, 2017
Messages
824
Reaction score
702
Location
Germany
VCDS Serial number
C?ID=289891
Hi Uwe,

one can of course use the channel descriptors as the logic behind just needs a unique match.
No matter what you search for, Text or ID, it has to be a unique channel match. There are a few words for the logic in the documentation.

I forgot to mention this in my post above, thank you, important fact.

Cheers
 
Last edited:
Back
Top