LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use shared variables to address multiple Watlow controllers on the same COM port

Solved!
Go to solution

Hello,

 

I am trying to use LabVIEW 2010 to control 4 Watlow temperature controllers on one COM port. 3 are Model 96 and 1 is an EZ zone controller. Each controller has a unique modbus address, and I am trying to read from and write to individual registers (such as closed loop setpoint) using shared variables. I am getting return data when reading (although the data appears to be invalid), but am unable to change the value in the register by writing. How can I be sure that the Modbus server is sending commands to the correct controller?

 

Chuck

0 Kudos
Message 1 of 5
(2,543 Views)

Hi Chuck,

 

I'd like to get a little more information about what you are seeing.

 

What kind of invalid data are you seeing? Also, are you able to communicate with just one of the controllers if it is the only one connected? Since you don't seem to be getting the correct information sent in either direction it sounds like there may be a problem with the setup of the serial network.

 

Are you using RS-485? If not then this would be highly recommended so that you can have multiple drivers and receivers on the network. Are you going through a hub or connecting the controllers in series?

 

You asked about whether the command is going to the correct controller, do you see the commands going through and just aren't sure where they end up?

 

Lastly, if you could post a screenshot of the code (or the code itself if a screenshot wouldn't do it justice) that would help to understand the way you have everything set up.

 

Regards,

Peter W.

0 Kudos
Message 2 of 5
(2,525 Views)

Peter,

 

Thanks for the reply. I have actually solved that problem. I realized that the Modbus server address has to be the same as the controller's Modbus address.

 

I have, however, run into another problem. Perhaps you could help me with that. I have a system with 4 Watlow controllers, 3 are series 96 controllers, one is PID only and 2 are ramping. The 4th controller is an EZ zone. I am using RS485 for communications and the controllers are all wired in parallel for communications and power.

I have set up 2 Modbus servers for 2 of the controllers.

 

This is the first I have ever worked with Modbus based communications. I have successfully programmed using the Modbus read/write VIs, and am wanting to move to shared variables. My questions right now revolve around addressing, Modbus I/O servers and COM ports. Specifically, at this point, I know the addresses need to match up between the server and the slave device (Watlow controller in my case), how many servers can I create and use on one COM port? If the number is limited, is there a way I can specify an address that I want the server to talk to? Will the broadcast mode work to request data values from the controllers?

 

I'd appreciate any information you can help me with, or if you could point me to some sort of concise 'How-To' for Modbus communication.

 

Thanks.

 

Chuck

0 Kudos
Message 3 of 5
(2,503 Views)
Solution
Accepted by Chuck60148

Hi Chuck,

 

Sorry for the delay in responding, I was out of office last week. You can create as many Modbus servers on a single COM port as you would like, the only trouble you would end up seeing is if you tried to simultaneously call the port from different locations. As far as documentation to go through, I would start with the tutorial below for an overall how-to of Modbus. There are also quite a few help topics listed under the Datalogging and Supervisory Control Module that may be of use if you are troubleshooting specific issues.

 

Introduction to MODBUS

 

Regards,

Peter W.

0 Kudos
Message 4 of 5
(2,471 Views)

Peter,

 

Thanks for the reply. I was able to make some progress last week. I had already read through most of the material you linked for me. It helps to know that I can create as many servers as I need. The one key piece of information about creating multiple servers / shared variables that I needed was that it is necessary to deploy all of the variables manually when more than one server is created. In fact, I discovered that the best method is to create the all of the servers needed and then deploy them. After that, all of the shared variables created for those servers will auto-deploy when the vi is started. Of course, it never hurts to deploy all once the variables are all created.

 

May I suggest that NI add a section to the help files for Modbus that deals with using shared variables with Modbus servers?  I found plenty of information about servers, both master and slave, and Modbus in general. Including the actual Modbus spec. However, there isn't much information on using shared variables with Modbus.

 

Thanks.

Chuck

0 Kudos
Message 5 of 5
(2,462 Views)