VISA Command format to be sent in labview

General discussion of using Roboclaw motor controllers
Denesh
Posts: 5
Joined: Mon Jul 02, 2018 7:17 pm

VISA Command format to be sent in labview

Postby Denesh » Tue Jul 03, 2018 4:50 pm

Hi

Can someone please help me with the exact VISA command (i.e including the format) that I'm supposed to give to my Labview VISA write block?

I seem to be running into a timeout expired error whichever way I try.
I'm using Roboclaw 2X7A controller in USB mode.
Right now the format I'm following is:
128,90
(Address is 128 and 90 is to get the status).
And what is the command that needs to be given to drive the motor?
I have attached the image of the block diagram I tried to test.The same problem happens even with a simple serial read and write vi.

Please extend your help as soon as possible.

Regards
Denesh
Attachments
serial.png
serial.png (185.44 KiB) Viewed 38 times
visaerr.png
visaerr.png (91.25 KiB) Viewed 38 times

User avatar
Basicmicro Support
Posts: 941
Joined: Thu Feb 26, 2015 9:45 pm

Re: VISA Command format to be sent in labview

Postby Basicmicro Support » Thu Jul 05, 2018 9:12 am

Serial communications should be set to 8 databits, No parity and 1 stop bit. 1.5 and 2 stop bits should also work though.

Baudrate should be set to whatever the Roboclaw is set to. It defaults to 38400 but I do recommend changing to 115200(both on the Roboclaw and in the VI).

Timeout should be set to .010 seconds(10milliseconds) if that is the byte timeout. If it is the total transmittion timeout I recommend 1 second. 1 second is long enough to detect problems but not so long it is painful to debug.

Noite that when the baudrate is 38400 or less on the Roboclaw it adds a 1ms delay before sending back an ack or data from read commands.

Once you can send read commands and read back data(like the status command) then look at a simple write command(eg ForwardM1 for example). Those commands require you to calculate the CRC16 check sum. Our LabView library does this but was written with LabView 2015 and appears to have some compatibility problems with the latest LabView. But you should be able to open the VI and see how to calculate the CRC16.


Return to “General Discussion”

Who is online

Users browsing this forum: Baidu [Spider] and 3 guests