I have a small HVAC unit which has it's temperature and fan speed controlled by a PLC (T100MD-888+PLC).There are start/stop buttons and a variable pot for the temperature setpoint locally, but I would also like to be able to view and control the unit on Labview.
The PLC has a serial port and will support Modbus but I have no experiance with Modbus or setting it up.
I am using Labview 8.2 with the DSC Module, so I think I have all I need to set it up. (with your help)
I tried to set-up one of the inputs as a shared variable but it didn't work (see attached), not sure if this is the right method.
I also tried some of the VI's from User Libraries > NI Modbus, but because I have no experiance with these I got lost.
If someone can explain to me (in very plain english) how to set this up or if you have a VI that I can easly modify I will be very thankful.
In addition to the steps below I also recommend running the two Modbus examples from the Example Finder (Help>>Find Examples) in LabVIEW. You need to run the two main examples together to get the full Modbus demo (see attached image).
1) Ensure that modbus communication is enabled on your PLC. Refer to the PLC documentation on how to do this. The program running on the PLC may need to explicitly export values to different Modbus registers. 2) Make sure you're using the right kind of serial cable. Most likely you need a straight-through cable, but you could need a null-modem cable. 3) Open LabVIEW and create a new project. 4) Right-click on My Computer and choose 'New IO Server'. Choose the 'Modbus' IO server type (not Modbus Slave). 5) Configure the Modbus IO server communications settings to match those on the PLC. 6) After accepting changes to the Modbus IO server configuration, save Untitled Library 1 with a new name. 7) Right-click on the library you just created and choose 'Create Variables'. For the count, enter the number of IO points on your PLC that you want to connect to, then click 'Create'. 8) (Now look at the attached image) When the multiple variable editor windows appears you can rename 'Variable1', 'Variable2', etc, with meaninful names. Also, select the values in "bind to source" and make the values 'on'. Now browse to the Modbus regsiter you want to bind each variable to in the Networkroject Path column. The dialog will always put the first register of any range so after you browse for the item you should manually edit the string in the cell to point to the precise register you need to communicate with. 9) Close the MVE after you've setup all the variables with the correct bindings. 10) Right-click the library and choose 'Deploy'. From LabVIEW, choose Tools>>DSC Module>>Monitor Variables. You should be able to browse to the variables you just created. When you add them to the watch window you should be able to see the values from your PLC. --If you don't, look at the quality of the tags in the watch window. This will help you debug any communications problems.