Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus control help needed

I can not make heads of Modbus I have the .llb from NI. I have tried to fumble my way through the example. Nothing has worked. OPC server is not an option we have spent enough money just to get LabView Developer. Using labview to talk via USB to an Agillent 33220A function generator was easy. The Modbus sucks. The GS2 manual does not make sense to the Modbus tutorial it is like apples and cow patties in comparison.

 

I am looking to see if anyone has used the Automation Direct GS2 Drive and LabView and has a working VI? I have been looking over Modbus over RS485 that the GS2 uses and I have looked at the Modbus .vi library. Correlating all that into one cohesive thought seems to be escaping me. I am new to LabView and never seen Modbus before and I have a very short schedule to get something going. Even if all the .vi did was start and stop the motor I would be happy. Then I could work the rest out.

 

Somebody with some Modbus experience my be able to correlate things.

 

GS2 Manual

0 Kudos
Message 1 of 3
(3,076 Views)

Hi MTEng,

 

You can see on page 4-56 and 5-2 the programmable communication parameters. It is critical that the settings of the COM port on your computer match the settings of your device. You can set these settings through the MB Serial Init.vi. These include baud rate, # of data bits, parity bit, and stop bits. When using Modbus, you can also select between ASCII and RTU mode (ASCII is easier to debug, if you have no other preference) and must specify a slave address. Be sure these settings match those of your device. 

I would also suggest using the MB Serial Example Master.vi example from the Modbus palette to help you get started. Another helpful online resource is this Intro to MODBUS DevZone (you might've already seen this): http://zone.ni.com/devzone/cda/tut/p/id/7675

 

DylanC

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

On thing I just found is that the MB Serial INIT .vi does not provide access to the stop bits. Found the setting to be 1 in the block diagram. I have added a port on the VI so I can set it as needed, 2 in this case. Port is now set: ASCII, no parity, 2 stop bits, BAUD 9600, flow control none.

 

I have confirmed how the drive is conifured using the GSOFT software from Automation direct so I am fairly confident the port is setup right.

 

Next thing I need to do is to blunder through the Modbus commands and addresses. Goal here for me is just to see if I can just do a run and then stop comand accross the RS485. The run command is at address 091B Hex.

 

FYI am am trying to build a test stand for a sensor I have designed with a 4-20mA output corresponding to shaft RPM, sensor also provides indication of eccentrity of the shaft. Motor runs at up to 30,000RPM. With LabView we want to start and stop the motor and collect data from the sensor at various speeds as setup in a VI. Just can't talk to the drive to control the motor. Figure I will work with the start and stop commands then when I know I am talking to motor the rest of the understanding should fall out from there.

 

 

0 Kudos
Message 3 of 3
(3,050 Views)