OPC UA alternatives (aka Kepserver)?

This script will parse your CSV and enter it into the ignition historian with your RTU timestamp.

#convert the csv into an ignition dataset
import csv
path = system.file.openFile("csv")
if path != None:
	f = open(path,'rb')
	reader = csv.reader(f)
	csvlist = list(reader)
	ds=[]
	row = 0
	for x in csvlist:
		if row == 0:
			headers = x
		if row > 0:
			ds.append(x)
		row += 1
csvdataset = system.dataset.toDataSet(headers, ds)

#parse the dataset and enter the data into the historian
for row in range(csvdataset.rowCount):
	tagname = csvdataset.getValueAt(row,'tag')
	tagvalue = int(csvdataset.getValueAt(row, 'intvalue'))
	tagtimestamp = system.date.fromMillis(long(csvdataset.getValueAt(row, 't_stamp')))
	tagquality = 192
	system.tag.storeTagHistory("ign_historical","default",[tagname],[tagvalue],[tagquality],[tagtimestamp])
1 Like

The values for tagnames , values, etc. are lists, so you could set the lists up in one loop and just call system.tag.storeTagHistory() once.

import csv
path = system.file.openFile("csv")
if path != None:
  f = open(path,'rb')
  reader = csv.reader(f)
  csvlist = list(reader)

  #initialize lists
  tagname = []
  tagvalue = []
  tagtimestamp = []
  tagquality = []
  headerFlag = 0

  for line in csvlist:
    # ignore first line
    if headerFlag == 0:
      headerFlag = 1
    else:
      tagname.append(line[1])
      tagvalue.append(line[2])
      tagtimestamp.append(system.date.fromMillis(long(line[3])))
      tagquality.append[192]

system.tag.storeTagHistory("ign_historical","default",[tagname],[tagvalue],[tagquality],[tagtimestamp])

2 Likes

How to Create a Node-Red MQTT Dashboard:

I think, this will use MQTT and eventually replace OPC UA.

With all of your data passing through Microsoft’s servers. I think not.

4 Likes

Agreed. Whom can you trust?. Police(aka NSA) is the thief here. Threat is the feeder for security business like virus is the lifeline for anti-virus and so on. All Governments collect data. Weaker and corrupt Governments happily export their people and data to USA. Privacy is the biggest joke in social media. No more holy cows. Mark Zuckerberg must be ROFLing :smile:

Privacy and Data security is an excellent opportunity for Government authorities of slave nations to make some fast bucks. Data is for the people. When they are eagerly waiting with a broad smile to export their people to USA, what are they going to do with their private data?. Throw few more bones, they will sell 2 for 1. They will happily sell the remaining surplus useless population, dime a dozen, to big pharmaceutical giants for Bio research, develop drugs and Health care services for mankind :smile:

Did anyone test this OPC UA server?. Do you think, this can become a multiplatform alternative for Kepserver?.

Kepware is working on a Linux image that can be Dockerized.

3 Likes

I only looked at it quickly, but I didn’t see any mention of drivers. Will it publish tags from my AB and Siemens PLCs?

I suggest, ask your team to dig deeper and build your own driver for AB and SIEMENS. All PLC drivers communicate on the basis of request/response cycle. MODBUS is the mother of all PLC/RTU protocols. You can build your driver framework for MODBUS TCP and use it to build other drivers.

For a OPC UA and MQTT on Linux check this out:

It runs on ARM architectures too. I’m using it to send data from renewable plants to the Cloud and it works fine. The neat feature is not just it runs on Linux, but also the GUI is Web (HTTPS => bye, bye RDP).

Not as many protocols as Kepserver but enough for my projects.

I have developed with FreeOpcUa. It creates an OPC server endpoint and contains all the methods to create the folders, objects, and nodes. The challenge is to develop the driver for the target device (i.e. the plc), obtain the data from the device, then leverage the methods provides by FreeOpcUa to share the data with the server’s clients. In my project, I created an OPC server with FreeOpcUa that converted restful APIs to OPC-UA resulting in the client skipping all the API calls and instead connecting to the OPC-UA server and subscribing to the tags for the data.