Connecting OCS Checkweighers GmbH to Ignition

I have a checkweigher from OCS/Wipotec, the model is HC-A-2000-2 and they have enabled E/IP so that we can communicate with the machine and extract data out of it.

Does anyone know which driver I should be using to connect and retrieve the data?

I have the ip-address of the device but I do not know what else I might need. Has anyone gone through this process? I also I am a bit lost on how the addressing might look like.

All help is much appreciated, thank you all in advance!

If this is short for "EtherNet/IP", then you need my driver module. If you have a user manual and EDS file, I can review it to be sure (and offer advice on options to select).

Thank you very much for your fast response! Yes this is short for Ethernet/IP.

Please find attached the files that the supplier has provided me.

Thanks a lot!

EthernetIpExamples (1).pdf (1.4 MB)
TD Ethernet_IP_for checkweighers_gb (1).pdf (1.1 MB)

Yes, my module's Scanner+Adapter option combination can handle this device. If you have one to test, I can make a sample configuration for you (after the holiday...). The device will also need a gateway timer event to handle the handshake bits the device expects.

The "examples" file is not very helpful. The latter file is all that is needed for the comms setup. You'll need to pick registers from the lists in ยง7.2 to configure for communication.

Oh that is brilliant! I do have one to test if you have a sample for the gateway timer to handle the handshake I can get working on that and after the holidays just let me know and we can look at the sample configuration.

Once more thank you very much for the fast support!

No, that will need to be custom for this device, too. I can include it in the sample config next week.

Perfect, thank you very much. Until next week!

Sample XML configuration. Note the comment in the code block for setting up the gateway timer event.

<Controller>
  <DataTypes>
    <DataType Name="TD_DCF_t" Alignment="1" Handle="9fae">
      DCFW=BOOL[1..24]
      DCFR=BOOL[1..32]
      Flags=SINT
      DCFWA=HostedBy Flags.6
      STC=HostedBy Flags.7
      WSC=HostedBy Flags.7
    </DataType>
    <DataType Name="TD_In_t" Alignment="-4" Handle="8122">
      BO=LINT
      DCOI=TD_DCF_t
      RWR=TD_ParamValuePair_t[1..24]
      RR=TD_ParamValuePair_t[1..32]
    </DataType>
    <DataType Name="TD_Out_t" Alignment="-4" Handle="f35d">
      BI=LINT
      DCII=TD_DCF_t
      WR=TD_ParamValuePair_t[1..24]
      PNR=DINT[1..32]
    </DataType>
    <DataType Name="TD_ParamValuePair_t" Alignment="-4" Handle="26ca">
      Value=DINT
      Param=DINT
    </DataType>
  </DataTypes>
  <Tags>
    <Tag Name="FromTD" Definition="TD_In_t"/>
    <Tag Name="ToTD" Definition="TD_Out_t"/>
    <Tag Name="ToTD_Internal" Definition="TD_Out_t"/>
  </Tags>
  <Assemblies>
  </Assemblies>
  <Modules>
    <Module Name="Checkweigh1" CatalogNumber="" Inhibited="false" Direction="Client"
    InRPI="200000" UnicastIn="false" InRTMF="0" OutRPI="200000" UnicastOut="true" OutRTMF="4">
      <Route>port 2 10.20.30.40</Route>
      <Application>2004 2467 2c66 2c65</Application>
      <InputTag>FromTD</InputTag>
      <OutputTag>ToTD_Internal</OutputTag>
    </Module>
  </Modules>
  <Code><![CDATA[# Monitor ToTD parameter numbers and values to set
# appropriate Data Change Flags in ToTD_Internal, which is actually
# sent to the target.

from system.cip import *
logger = system.util.getLogger(__name__)

callCount = 0

# A gateway timer event should call the following function twice as
# often as the RPI defined in the module above.  A one liner is fine,
# something like this:
#
# system.cip.getDevice('hostDevName').TD_Handshake()
#
def TD_Handshake():
	global callCount

	if FromTD.WSC:
		if not callCount:
			logger.info("Checkweigher signals waiting for start")
		callCount += 1
		ToTD_Internal.DCII.STC = bool(callCount & 0x4)
		# Reset all values and parameter numbers and change flags
		# during startup.
		ToTD_Internal.DCII.DCFWA = False
		for idx in range(1,25):
			ToTD_Internal.WR[idx].Value = 0
			ToTD_Internal.WR[idx].Param = 0
			ToTD_Internal.DCII.DCFW[idx] = False
		for idx in range(1,33):
			ToTD_Internal.PNR[idx] = 0
			ToTD_Internal.DCII.DCFR[idx] = False

		# Bail early while in startup
		return
	else:
		callCount = 0
		ToTD_Internal.DCII.STC = False

	for idx in range(1,25):
		# Check each write register for change to value or param, but
		# ensure prior param and value have been echoed first.  Then copy
		# from ToTD to ToTD_Internal and toggle the change flag.
		if ToTD.WR[idx].Value == FromTD.RWR[idx].Value and ToTD.WR[idx].Param == FromTD.RWR[idx].Param:
			if ToTD.WR[idx].Value != ToTD_Internal.RWR[idx].Value or ToTD.WR[idx].Param != ToTD_Internal.RWR[idx].Param:
				ToTD_Internal.WR[idx].Value = ToTD.WR[idx].Value
				ToTD_Internal.WR[idx].Param = ToTD.WR[idx].Param
				ToTD_Internal.DCII.DCFW[idx] = not ToTD_Internal.DCII.DCFW[idx]
	for idx in range(1,33):
		# Check each read register parameter number for change, but ensure
		# the prior parameter number has been echoed first.  Then copy
		# from ToTD to ToTD_Internal and toggle the change flag.
		if ToTD.PNR[idx] != ToTD_Internal.PNR[idx] and ToTD_Internal.PNR[idx] == FromTD.RR[idx].Param:
			ToTD_Internal.PNR[idx] = ToTD.PNR[idx]
			ToTD_Internal.DCII.DCFR[idx] = not ToTD_Internal.DCII.DCFR[idx]

]]></Code>
  <Programs>
  </Programs>
</Controller>

You will need to adjust the IP address in the <Module> section's <Route> to match your checkweigher. Be sure to set the host device's Local Address setting to an IP address in the same subnet. Since the device doesn't support Unicast--multicast will not route.

After you choose the parameters you wish to read and write, you should save the running XML. Subscribe to the .Value items in the FromTD.RR array, and write as desired to the ToTD.WR array. Do not touch the ToTD_Internal data.