SBL1360 doesn't respond to CAN messages, and buffer seems to be empty

8 years 7 months ago #29530159 by Eugene
Hello,

I have SBL1360, connected through 15-pin port,
i have seted up to RawCAN, and i receive HeartBeat, but when i send it some message it doesn't respond, even if i send 0x05 to which it should respond with 0x06 (according to manual).

so then i wrote MicroBasic script that checks if CAN buffer is not empty (_CF) :

top:
If(GetValue(_CF) > 0) Then
SetCommand(_GO, 1, 150)
End If
goto top

And when i load it to device, set device properties to Script Auto-Start : Enable
and send CAN messages, it still doesn't do anything (doesn't start to spin the motor (which could be spun from script, i've checked)).

So what could be wrong ?

Please Log in or Create an account to join the conversation.

8 years 7 months ago #29530160 by TechSupport
Take a look at page 119 of the user manual. It discusses the Raw can transmit and receive.

Please Log in or Create an account to join the conversation.

8 years 7 months ago #29530164 by Eugene
i've vrote MicroBasic script acording to that manual, which is posted in first message, and my problem is that when i send CAN message to controller, it doesn't seem to enter a buffer ( as its said at page 118 of manual ), so my question is, what coud be wrong ?

Please Log in or Create an account to join the conversation.

8 years 7 months ago #29530169 by TechSupport
You have to read the headers to check to see if the frames have arrived.
The following user(s) said Thank You: Eugene

Please Log in or Create an account to join the conversation.

8 years 7 months ago #29530188 by Eugene
ok, it works now, but i get new problem

i do :

top:
pending = GetValue(_CF, 0)
canID = GetValue(_CAN, 0)

if(canID <> 0)
'READ CAN MESSAGE

'SEND RESPONSE MESSAGE
end if
wait(1000)
goto top

but after sending to controller ONE message, it starts sending response forever, as if after reading header it doesn't reset it, and received value stays there, while some other message not received, and putted into it (into read buffer).

Please Log in or Create an account to join the conversation.

8 years 7 months ago #29530189 by TechSupport
To troubleshoot, you can add some print statements to see what the header value is.

Please Log in or Create an account to join the conversation.

8 years 7 months ago - 8 years 7 months ago #29530191 by Eugene
yes (i added print statements), it stays the same (1 in my case)

also, if queering it from Roboteq Motor Control Utility Console tab, it also stays the same.

Please Log in or Create an account to join the conversation.

8 years 7 months ago #29530192 by TechSupport

Please Log in or Create an account to join the conversation.

8 years 7 months ago #29530193 by TechSupport
pending = GetValue(_CF, 0) maybe incorrect.

Replace with this.

pending = GetValue(_CF)

Please Log in or Create an account to join the conversation.

8 years 7 months ago #29530194 by Eugene
sorry for typo, i'm actually queering canID = GetValue(_CAN, 1).

heres whole script :

top:

pending = GetValue(_CF, 0)
canID = GetValue(_CAN, 1)

print("pending : ", pending, "\n")
print("canID : ", canID, "\n")

if(canID <> 0)

'READ CAN MESSAGE
canDataLength = getValue(_CAN, 2)
canData1 = getValue(_CAN, 3)
canData2 = getValue(_CAN, 4)
canData3 = getValue(_CAN, 5)
canData4 = getValue(_CAN, 6)
canData5 = getValue(_CAN, 7)
canData6 = getValue(_CAN, 8)
canData7 = getValue(_CAN, 9)
canData8 = getValue(_CAN, 10)
print("Received Message ID : ", canID, " Data : ", canData1, " ", canData2, " ", canData3, " ", canData4, " ", canData5, " ", canData6, " ", canData7, " ", canData8, ".\n")

'WRITE CAN MESSAGE
setCommand(_CANSEND, 1, canID)
setCommand(_CANSEND, 3, canData3)
setCommand(_CANSEND, 4, canData2)
setCommand(_CANSEND, 5, canData1)
setCommand(_CANSEND, 6, canData4)
setCommand(_CANSEND, 7, canData5)
setCommand(_CANSEND, 8, canData6)
setCommand(_CANSEND, 9, canData7)
setCommand(_CANSEND, 10, canData8)
setCommand(_CANSEND, 2, canDataLength)

'RESET VARIABLES
canID = 0
canDataLength = 0
canData1 = 0
canData2 = 0
canData3 = 0
canData4 = 0
canData5 = 0
canData6 = 0
canData7 = 0
canData8 = 0
print("Reseted Message ID : ", canID, " Data : ", canData1, " ", canData2, " ", canData3, " ", canData4, " ", canData5, " ", canData6, " ", canData7, " ", canData8, ".\n")

end if

wait(1000)

goto top

Please Log in or Create an account to join the conversation.

Moderators: tonysantoni
Time to create page: 0.091 seconds