It is currently Thu May 24, 2018 9:23 pm

All times are UTC - 8 hours

 Page 1 of 1 [ 2 posts ] 
Author Message
 Post subject: Human Friendly Control Protocol (HFCP)
PostPosted: Sat May 26, 2012 9:52 am 

Joined: Fri Oct 29, 2004 12:01 am
Posts: 88
Location: Pennsylvania
I am not 100% sure about this, because I do not have the hardware to test it, but I am pretty sure I found some bugs in the code. Let me just start with one:

In function write(), it fails to clear the 'ptype' and 'pwidth' array elements. If one were to request one of the non-default (non-decimal) data types first - for example, hexadecimal - those two arrays would have non-zero values in the corresponding elements. If subsequently, one were to request a default (decimal) type, the logic in function build_msg() will fail, and pick the wrong format type. It can be fixed by additionally clearing the corresponding array elements in function write().

 Profile Send private message  
 Post subject: Re: Human Friendly Control Protocol (HFCP)
PostPosted: Mon Jan 20, 2014 1:33 pm 
User avatar

Joined: Fri Jan 13, 2006 1:01 am
Posts: 4
Location: Burbank, CA
Sorry, I haven't visited these boards in ages as I tend to hang out in the official Propeller forums on Parallax.

Having read and considered your comments, I believe you may be correct. HFCP is in use in a commercial system without issues, and I'm presently designing it into another -- this gives me the opportunity to make fixes and improvements.

I don't think any of us have been caught out by the [possible] error because we're using decimal values which is the default format.

This will sort things -- and was probably what I intended (hence two variations on write).

pub write(pnum, value)

'' Writes decimal value to numeric parameter

  writex(pnum, value, P_DEC, 0)                                 ' decimal, variable width

Thanks for your keen eye.

Hollywood, CA
 Profile Send private message  
Display posts from previous:  Sort by  
 Page 1 of 1 [ 2 posts ] 

All times are UTC - 8 hours

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: