Multiple charts and multiple E/IP devices

I am programming a test system that runs a strategy that runs 4 charts in parallel (there are 4 identical test stations that run simultaneously). Each chart at various times commands sets of solenoids that are on E/IP devices (SMC EX600 E/IP). Comms are via AnyBus slave to slave MODBUS gateway.

  1. Can the EB1/S1 talk to/send coil commands to 4 different IPs at the same time?
  2. My program is simple. I either command solenoids on, or off. No reading of states, no conditions, just absolute commands. Can a simple 1 line of code using the MODBUS command 15 (multiple coils) be used in place of the subroutines that OPTO22 has examples of?
  3. Am I correct in thinking that an optoscript block with a comm handle open line, a MODBUS 15 line, and a comm handle closed line will perform my on/off operation?

Last week our OptoForums had a little hiccup so we lost a couple replies.

Summarizing ben’s reply:

Hello and welcome to the forums!..yes, the EB1 and PAC-S brains and controllers can talk to many IP addresses at the same time. They have a pretty solid TCP/IP stack so can easily handle 32+ connections (ie, 32 different IP addresses).
They can be different IP’s and different protocols as well, so mixing IP’s, E/IP and Modbus all at once will be no problem.

Also, philip wrote:

—Quote (Originally by pschultheis)—

  1. My program is simple. I either command solenoids on, or off. No reading of states, no conditions, just absolute commands. Can a simple 1 line of code using the MODBUS command 15 (multiple coils) be used in place of the subroutines that OPTO22 has examples of?

Any reason why you don’t want to use the subroutine? You would only need the one subroutine if that is the only command you need.

—Quote (Originally by pschultheis)—

  1. Am I correct in thinking that an optoscript block with a comm handle open line, a MODBUS 15 line, and a comm handle closed line will perform my on/off operation?

You probably would need more comm handle management as you want to leave TCP connections open if you are going to continue to use them, not open and close them repeatedly. Also, building the modbus command will take multiple lines. All these things are taken care of for you in the modbus kit subroutines.

Using the kit, I would initialize the comm handle and the parameters table one time:

//Set these up one time
SetCommunicationHandleValue("tcp:127.0.0.1:502", chModbus);
 
ntParameters[0]=2; //TCP
ntParameters[1]=255; //Slave address
ntParameters[2]=1000; //Timeout ms
ntParameters[3]=0; //Big endian
ntParameters[4]=0;
//Done with setup

Then you can do something like this to turn on coils:

//Increment this before each call
ntParameters[5]=ntParameters[5]+1; //Transaction ID 
//Turn coils on 
MoveToNumTableElements(1, 0, 9, ntValues); //Set 10 values to on 

//Turn on coil 1 through 10.
O22Modbus15ForceMultipleCoils(chModbus, ntParameters, 1, ntValues, 10, nStatus);

Thanks for your time guys. This has been very helpful for me in figuring out what I’m doing. (I’m an electrical/mechanical guy, software is an interesting twist to me)