Premise RS232 Programming Question

Motorola Premise
Normally, the RxMode property is true for a device. If you set RxMode to false, you enable binary mode. The binary mode setting is the most compatible in that you don't need to specify line terminators. Since you can't specify line terminators, they will be included in the binary buffer array and you're code will have to omit them when necessary. I believe the LG is one of the devices that omits line terminators from some commands so I'd recommend using binary mode. This will probably make the code more complicated though.

You can also try a hybrid method, but I couldn't get this to work :(

Here's some example code that grabs 4 bytes from the binary buffer until no bytes are left; it's from the W800RF32 module I posted.

Code:
dim BinaryArray
dim sHexCode
dim iIndx
dim iIndxInner
dim sTmp

BinaryArray = this.RxBinaryData
for iIndx = 1 to lenb(BinaryArray) step 4
	sHexCode = ""
	'build a string with the first 4 bytes
	for iIndxInner = 1 to 4
		sTmp = hex(ascb(midb(BinaryArray,iIndxInner,1)))
		if len(sTmp) < 2 then sTmp = "0" & sTmp
		sHexCode = sHexCode & sTmp
	next
	
	'process address data
	on error resume next	'in case processing, but with object just deleted from custom devices...
	this.Devices.ProcessCommand this.GetRxAddress(sHexCode)
	
	'remove four bytes and get the next four
	this.RxRemoveBytes = 4
next

I still havent had success in getting Premise to control my LG via serial commands. The LG responds with the LG RS-232 utility, but not via Premise...can any of you LG guys id the settings I need to change in builder? Any tricks?
 
Back
Top