Changing IP Address of an I/O unit references without using PAC Control GUI


#1

.The only way I have found to change the reference IP Address for an I/O Unit (in a PAC Control Strategy) is through the ADD or EDIT I/O Unit dialog in PAC Control:
image
Is there any other way?


#2

PAC Manager


#3

That still involves a GUI.

Is there any way to do this in a strategy (such as a power-up chart), or a program that can be run from a command prompt or a shell script?

From a chart:

Mythical Chart Command to Set IP Address for an I/O Unit
  From	StringVariableContainingIPAddressAndPort
  To	SMC_HA_01_Sim
 
Enable Communication to I/O Unit
  	SMC_HA_01_Sim

#4

Does this post answer your question?

If not, come back and let us know.


#5

That is interesting information to know, but not the information I am looking for.

I am trying to change the IP address inside a strategy running on a groov controller.

I can enable and disable the I/O Unit, but I cannot see how to change the IP address the strategy uses to access that I/O Unit.


#6

How many address do you need?
I would just put as many I/O units that you need in the strategy tree and have each with the IP address you are wanting to change to, just make sure the tick box ‘enable IO unit’ is cleared.
Then you just enable the I/O unit you want when you want (to change its address).

This way, the strategy can talk to any I/O unit with the address you have established… I think there is a forum post on doing this, let me see if I can find it…


#7

The problem with that is that the I/O names will be different.

Here is the scenario –

We have a simulator that emulates 6 B3000 E-NET devices. This simulator can be run by our developers and testers on their laptops or PCs. Our current procedure for starting up a simulator is –

  1. Determine what IP the DNS has decided you should be using.
  2. Run PAC Control.
  3. Open each I/O Unit and modify the IP Address to match the address you determined in step 1 above.
  4. Compile and run the strategy.

We would like to eliminate the steps where our developers open the strategy in PAC Control.

What we would like to do:

  1. Determine what IP the DNS has decided you should be using
  2. Go to a groov view simulation page
  3. Enter the IP address from Step 1 in a string variable value
  4. Click a check box to switch to “simulation” mode.

Ideally, step 4 would trigger a chart action that stops most of the active charts, disables the real I/O devices, sets the IP addresses of the simulation devices, enables the simulation devices, and restarts the charts in a “simulation” mode.

We can do everything above, except for modifying the IP addresses of the I/O devices.


#8

Do you mean DHCP instead of DNS?
Most if the DNS servers I work with have to be told what IP to resolve to.


#9

I don’t have the gear on hand to setup a test, but I am still unsure why you feel Marys solution wont work.
She clearly states that you can use the method to change your own IP address or that of another unit.
If you call the 6 B3000’s with logical names, you can have a list of them that you just refer to and thus programmatically change their IP address from groov using her method.

No, it wont work if you assign random names to the 6 units, but at some point you will need to standardize on the naming of the units?
Once you do that, I suspect you can change their IP address just as you describe. Just replace the ‘self’ in her command with the unit name you want to change.


#10

DNS (Domain Name System) is the system that assigns IP addresses. DHCP is the protocol that a client computer & the DHCP server use to accomplish the assignment.


#11

I think jay wants to change the IO Unit reference in PAC Project, not the IP address of a physical IO Unit. I don’t think there is a way to do that, other than to have all possible IO Units already in the strategy, which you alluded to before.

DNS maps hostnames to IP addresses, it doesn’t assign IP addresses. DHCP is responsible for assigning and keeping track of assigned IP addresses. Most DHCP servers can optionally update the DNS server as well.

This is a bit outside the box by creating a proxy service inside your strategy. You would setup all your IO units as localhost with different ports. The strategy would open listening comm handles on those ports and proxy those requests using an outbound comm handle to the actual IO unit or to your simulation unit depending if you are simulating or not. Since you can change the communication handle, this will allow you to change IP addresses dynamically.


#12

Philip – thanks for the clarification.

Yes, I would was asking how to change the IP Address that the I/O Unit in the strategy uses to access the actual I/O Unit.

The proxy service is a bit of a hack :-(. Would using a string variable as the packet buffer work with the binary data transferred vi OptoMMP (which is a binary protocol)?


#13

Yep, it is a hack, but I can’t think of another way to get what you desire, other than to implement OptoMMP in your strategy and not use any of the built-in IO commands.

Yes, a string var will work just fine as a buffer, they don’t care if it is binary.