Hi
My CAN bus is working - it means I can rx and tx both ways .
I do have a problem to send / receive more than one byte .
I want to send 2 bytes packed in a word - in order to make one message .
I do that and test the final word ( 16 bit value ) by printing a binary image of it to a serial port - all the data is fine then .
I then send the same WORD on can bus and on rx side I only get the low byte in a word variable again - the high byte stays 0.
tx side
Config Canmob = 2 , Bitlen = 11 , Idtag = &H0121 , Msgobject = Disabled , Msglen = 2 ' this mob is used for sending data
fets = makeint ( compare1a , fetbits)
Bok = Cansend(2 , fets ) ' send 2 bytes ( word ) using MOB 2
RX SIDE
Config Canmob = 0 , Bitlen = 11 , Idtag = &H0121 , Idmask = &H0121 , Msgobject = Receive , Msglen = 2 , Autoreply = Disabled
......
Breceived = Canreceive(fets) ' read the data and store in word fets
Any idea what the problem might be - in the help file it states that the compiler will try to send and receive the nr of bytes from the variable type .
I also have a USBTIN monitor on the line and it also only show one byte - the compare1a variable. - so it seems as if only one byte is sent.
Cheers
↧