AC Drive China Forum
Forum » PLC - Programmable Logic Controller » PLC setting
Topics: PLC setting on PLC - Programmable Logic Controller
Start by
06-10-2012 08:33 AM

PLC setting


I have a small HVAC application with temperature and fan speed controlled by a PLC (Siemens PLC). There are start/stop buttons and a variable pot for the temperature set point locally, but I would also like to be able to view and control the system on Labview.
The PLC has a serial port and will support Modbus but I have no experience with Modbus or setting of it.
I am using Labview 8.2 with the DSC Module, so I think I have all I need to set it up. (if you help)
I tried to set up one of the inputs as a shared variable but it didn't work, not sure if it is the right way.
I also tried some of the VI's from User Libraries > NI Modbus, but because I have no luck with these I got lost.
If someone can explain to me how to set this up or if you have a VI that I can easily modify I will be very thankful.
06-10-2012 08:36 AM
Top #2
06-10-2012 08:36 AM
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 Network:smileytongue:roject 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.

Hope it helps
Reply to Thread