Home AMX User Forum NetLinx Studio

Channel Vision P-1420 Matrix ?

Hi,

Interested to know if someone succeeded to control an A/V matrix P-14200 manufactured by Channel Vision ?

There is a strange checksum to calculate :( All the more manufacturer is unable to explain himself protocol !!

Thanks for any tips, infos you might have

Vinc

Comments

  • dthorsondthorson Posts: 103
    Can you post the pdf of the protocol?
  • vincenvincen Posts: 526
    dthorson wrote:
    Can you post the pdf of the protocol?

    Here it is ;)
  • ericmedleyericmedley Posts: 4,177
    vincen wrote:
    Hi,

    Interested to know if someone succeeded to control an A/V matrix P-14200 manufactured by Channel Vision ?

    There is a strange checksum to calculate :( All the more manufacturer is unable to explain himself protocol !!

    Thanks for any tips, infos you might have

    Vincèn

    It looks like their doing a 1s complement Check sum.

    The idea is that you add the hex values of the string, then (if the value goes over 8 bits) truncate the result back to 8 bits. (ex: if the result is $14F, then you ditch the 1 with the result of $4F)

    Then do the 1s complement.

    It's an inversion of the result.

    So, using our example of $4F:

    $4F = 0100 1111 binary

    1s complement or inversion is easy. Just go through the binary number and make every zero a 1 and every 1 a zero.

    so

    0100 1111 inverted = 1011 0000

    and

    1011 0000 =$B0

    So, the check sum is $B0

    There ya go!
  • NMarkRobertsNMarkRoberts Posts: 455
    ericmedley wrote:
    1s complement or inversion is easy. Just go through the binary number and make every zero a 1 and every 1 a zero.

    The easiest way to do this is using bitwise XOR with a full set of on bits:
    char cResult[1]
    char cSum[1]
    
    cResult = cSum bxor $FF
    
  • Joe HebertJoe Hebert Posts: 2,159
    The easiest way to do this is using bitwise XOR with a full set of on bits:
    char cResult[1]
    char cSum[1]
    
    cResult = cSum bxor $FF
    
    Even easier is just to do a bitwise not. (BNOT)
    cResult = ~cSum
  • vincenvincen Posts: 526
    Hi,

    Thanks to all of you for all your explanations and details. I thought I would kill myself as nothing worked, and no answer from that damn product, and support nearly nothing at Channel Vision.

    But after three days harassing their tech support, we finally succeeded to get the engineer that developed the matrix and we discovered that it exists two versions of protocol :( the most useful one is not posted on their website, so I include it here for your use.

    That one is really simple and straightforward, for example:
    SEND_STRING dvMatrix,'SBSYSMON' to put matrix on
    
    SEND_STRING dvMatrix,'SBSYSMOF' to put it off
    

    and the best it works really :D

    Thanks again to all, have a great end of day and week-end

    Vince
  • ericmedleyericmedley Posts: 4,177
    Joe Hebert wrote:
    Even easier is just to do a bitwise not. (BNOT)
    cResult = ~cSum

    I suppose I could have put the NetLinx way of doing this. I only covered the theory behind it. I prefer the Bitwise BNOT command method. it is the same as the old Z80 BNOT command which is where the 1s complement checksum came from in the first place.

    I forget sometimes that many programmers today have never even seen where a lot of this stuff came from. Sheesh, I'm getting old!
  • NMarkRobertsNMarkRoberts Posts: 455
    ericmedley wrote:
    Sheesh, I'm getting old!
    Nah, you're just accumulating experience.
  • ericmedleyericmedley Posts: 4,177
    Nah, you're just accumulating experience.

    Well, the I can tell you that experience is colored gray... :)
Sign In or Register to comment.