PLCBUS address conversion

Forum about Domotiga Open Source Home Automation for Linux.

Moderator: RDNZL

Post Reply
User avatar
vdoucet
Starting Member
Starting Member
Posts: 20
Joined: Sat Nov 13, 2010 3:01 pm
Location: Pau, France

PLCBUS address conversion

Post by vdoucet »

Ron,
I think there is an error in the CPLCBUS.class in the PLCBUStoAddress function.

Code: Select all

497	'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
498	' convert byte to homeunit
499	'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
500	PRIVATE FUNCTION PLCBUStoAddress(bAddress AS Byte) AS String
501	
502	  DIM sHome, sUnit AS String
503	
504	  sHome = Chr((bAddress AND &HF0) + 65)
505	  sUnit = (bAddress AND &H0F) + 1
506	
507	  RETURN sHome & Format(sUnit, "00")
508	
509	END
I think line 504 should read

Code: Select all

sHome = Chr((bAddress AND &HF0) / 16 + 65)
otherwise it works for "A" devices but not for B and above.
Could you check and confirm if I'm right ?
Ubuntu 10.10 + Domotiga 0.1.194 + Gambas 2.21
Interface PLCBUS II-T PLC1141 G+ (USB) ; 2x PLCBUS2-R PLC2268HX2 ; 2x PLCBUS II-R PLC2267-H ; 1x PLCBUS II-R PLC2267-K
Oregon Scientific (7x THN132ES, 3x THGN132ES, 1x PCR800)
RFXCOM (USB ; firmware 20)
Post Reply

Return to “DomotiGa Forum”