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

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

Cheers,
hadez16