HBL1650 MiniCAN

8 years 6 months ago #29530374 by Trainee
HBL1650 MiniCAN was created by Trainee
Hello,

I used the MicroBasic script example in the user manuel for MiniCAN configuration of HBL1650 :

top:
speed=getvalue(_VAR,9)
setcommand(_G, 1, speed)
motor_amps=getvalue(_A,1)
setcommand(_VAR, 1, motor_amps)
print(speed, " " ,motors_amps, "\n")
wait(10)
goto top


The nodeID is configured as 100.

To send a value to Var9 through CAN, is it correct if I configured the header as follow :

RPDO1 : 0x200 + 100 ?

Is the nodeID configuration a hexadecimal value?

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

8 years 6 months ago #29530380 by TechSupport
Replied by TechSupport on topic HBL1650 MiniCAN
If your node ID is 100 then yes, it is correct. 200 + 100 = 300.

If you are using P-can, you should see that it is communicating with 300 since it is 200 plus your node ID.

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

8 years 6 months ago #29530381 by Trainee
Replied by Trainee on topic HBL1650 MiniCAN
Isn't 0x200 a hexadecimal number? And is the 100 configured in the Roborun nodeID a hexadecimal number as well? If it is not then it is a decimal number? Shouldn't I convert 100 in decimal to 64 in hexadecimal? In this case isn't the RPDO1 : 0x200+nodeID be equals to 264?

If I want to send 1000 to Var9, is it correct if I send 0X000003E8? Or E8030000?

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

8 years 6 months ago #29530382 by Trainee
Replied by Trainee on topic HBL1650 MiniCAN
Does Roboteq read the header number in hexadecimal? Or in decimal? Because in the Pcan window the header is sent in hexadecimal format. I have inserted the photo in the file.


Attachments:

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

8 years 6 months ago #29530383 by roboteq
Replied by roboteq on topic HBL1650 MiniCAN
Hex or decimal is just a maner of representing a number. 0x264 is 0x200 (hex) + 100 (dec).

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

8 years 6 months ago #29530385 by Trainee
Replied by Trainee on topic HBL1650 MiniCAN
After I have written the MicroBasic script and downloaded it into Roboteq, does it run automatically? Or I have to call the script via CAN message?

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

8 years 6 months ago #29530386 by TechSupport
Replied by TechSupport on topic HBL1650 MiniCAN
You have to run your script after it is downloaded.

Correction to node ID.

If node id is 100 dec, that is 64 hex

so header is 0x264

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

8 years 6 months ago #29530388 by Trainee
Replied by Trainee on topic HBL1650 MiniCAN
Thanks. But how do I call run the script without clicking on the 'run' button in Roborun? I know by sending !r serial command is possible but since I am using CAN and USB cannot works at the same time with CAN so sending !r is not possible. In this case how do I send !r in CAN message? Is there a way to convert !r to binary data?

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

8 years 6 months ago #29530390 by TechSupport
Replied by TechSupport on topic HBL1650 MiniCAN
First thing to do is test the script to make sure it isn't faulty. If that is okay, then you set up the script to autostart in the configuration parameter under "Start up".
The following user(s) said Thank You: Trainee

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

8 years 6 months ago #29530395 by LROBBINS
Replied by LROBBINS on topic HBL1650 MiniCAN
You cannot use USB while using CAN, but you can use RS232. If your computer doesn't have an RS232 port, you will need a USB to RS232 adapter.
The following user(s) said Thank You: Trainee

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

Moderators: tonysantoni
Time to create page: 0.082 seconds