Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication between cRIO-9053 and BLDC motor via RS485/Modbus

Hello everyone,

 

I'm developing a mobilized radar testbed using a cRIO-9053 with an NI 9871 module to control an Oriental Motor BLV640N15S brushless dc motor. I am familiar with programming in Labview but next to zero experience with RS485 or Modbus which I need to communicate with the motor. After much pain trying to get NI MAX to recognize the ports on my module I've created a basic vi using the modbus API that comes with Labview RT to try to get a response from the motor driver, using Port 1 of the 9871 (VISA resource name ASRL2::INSTR) but my program returns no values or errors. Additionally, it seems like this operation corrupts the port in some way and disables me from changing its settings (baudrate, databits, etc). I'm attaching screencaps from the vi, running vi, and the port error as well as the pdf manual for the motor itself.

 

Some further info:

-Motor is 48V brushless DC with external driver.

-Transmission mode is half-duplex as per the manual. Had to make a custom RJ-50 to RJ-45 cable with a terminating resistor as indicated by the NI 9871 manual. The motor driver has its own internal terminating resistor which I have also enabled.

-Each device has its own power supply for testing at the moment, including the NI 9871.

-Driver has been set up for RTU protocol in Unicast mode (address number 1), 9600 bps baudrate, 8 databits, 1 stop bit, parity none.

-Reading from holding registers is on page 16 of Oriental Motor manual, but I don't know how to translate that into something I can do in Labview.

 

Any help in getting the motor to move would be greatly appreciated!

0 Kudos
Message 1 of 3
(2,993 Views)

I could be possible that the port is 'claimed' by a Labview instance. On cRIO I have less experience but I know on Windows that if you don't release the port in your VI this gives problems.

 

I would be wise to check the communication. Do you have a RS-485 adapter or can you connect to the driver through another interface?

0 Kudos
Message 2 of 3
(2,821 Views)

Thanks for replying Lennart, I'm not sure why the VISA test panel would not work as my program does release the port, but in any case that problem is gone. I have dug a little deeper into Modbus and RS485 communication and with a better understanding of the structure, I tried to communicate once again with the motor using the message structure outlined by the motor manual, but nothing is happening apart from the port showing up as active. No errors, but also no response no matter which command I try.

 

Is it possible to communicate with my motor driver using the VISA test panel only? If so, how could I write a command there with the proper sequence? This is the modbus communication sequence:

 

modbus.PNG

In my particular case, the command would be 01 03 0480 0004 44D1. How do I turn that into something I can test in the VISA Tespanel?

0 Kudos
Message 3 of 3
(2,805 Views)