Looping of script_ urgent

5 years 3 months ago #29530789 by buchjyot
Hi,

I am doing this script, which reads the data from encoder speed and send it over to CANopen, using following script..

'the script starts from here
wait(10000)
loop1:
Speed1 = GetValue(_ABSPEED, 1) ' Read the encoder speed in RPM
SetCommand(_CS, speed1)
wait(1000)
SetCommand(_DSET, 1)
goto loop1
'the script ends here

The problem is, while going in to loop for transmitting data over CAN, in between it doesn't recognizes the USB whether it has been connected or not, and shows the message in roborun that the connection has been lost. is there any idea by means of software how can i detect that USB is connected and now need to terminate the loop.FYI, I am using HDC 2450 DC motor controller.

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

5 years 3 months ago #29530790 by TechSupport
The problem is that usb is not a stable communication when running motor output. You'll need to use RS232 for comm as it is stable and robust. There is nothing else that can be done about that.

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

5 years 3 months ago #29530795 by TechSupport
Take a look at link below about the can open. The stuff you are sending is for rawcan and not canopen.

en.wikipedia.org/wiki/CANopen

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

Moderators: tonysantoni
Time to create page: 0.159 seconds