So, it is relatively easy to use this system to get your values into Ignition without the PLC.
As you have seen, the UDTs from IFM work really well for the IO-Link sensors.
The reason that they don't have one for the hub (AL2301) is because the hub has "dumb" devices on it.
When you get the data from the a device on the master using the IFM UDTs, you will see a PDIN
tag that is a memory tag under the nested UDT Poll
.
This is the process data input from the device, and it is described in the IODD file that explains the data format that the device is outputting into PDIN
.
For a TDXXXX temperature sensor this data contains the temperature in degrees in the first four characters of the PDIN
.
This is easy to write a script for, as every temperature sensor in that series sends the data in exactly the same way.
The problem with the hub is that you can configure the inputs and outputs individually and that changes how you need to interpret the PDIN
data.
If you know exactly what the inputs and outputs are set up for on all your hubs, you can make your own device UDT by copying one of the IFM ones, and just edit the tag change script that is on the PDIN
tag. In this script you access the process data with currentValue.value
and you do your transformations before writing it to the top level memory tags that you create to match the tags you want to see.
This is the tag change script from the TDXXXX device for reference:
def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
topTagPath = "/".join(tagPath.split("/")[:-2])
dataValue = currentValue.value
temperature = int(dataValue[0:4], 16) * 0.1
if int(dataValue[0], 16) >= 8:
rawValue = int(dataValue[0:4], 16) - 65536
temperature = (rawValue * 0.1)
tempC = (temperature -32) * 5/9
tempF = temperature
system.tag.writeBlocking(["%s/TemperatureC" % topTagPath, "%s/TemperatureF" % topTagPath], [tempC, tempF])
As you can see, it is pretty simple.
The data format for the AL2301 is described in here:
Essentially it has a 240 bit long register that contains not only space for 8 digital inputs, 8 digital outputs and 8 analog inputs, but also configuration status indicators to show what each port has been configured to do.
If I had a hub in front of me, I would write a device UDT for this, but I do not have hardware.