Category Archives: TechNotes

Rotronic Monitoring System integration. Pulling data into your systems

Data Integration is Key

Data integration is one of the primary requirements for many of our customers. I have previously discussed how RMS easily supports the integration of external data, but this posts takes a look at how RMS allows you the export data.

https___www.rotronic.com_media_events_images_1495454818_RMS_ML_GW

Of course RMS provides excellent graphing, statics and reporting as part of its core functionality, however here we are discussing the tools that will more likely be used for Machine to Machine (M2M) integration.

m2m

Machine to Machine (M2M) integration is absolutely key as data is increasingly being used for different purposes through businesses. So whilst RMS provides a highly secure and configurable platform for monitoring and alarming there are many weird and wonderful functions that it cannot provide. In this case we need to pull the data out and use it elsewhere.

Getting Data out of RMS

RMS is an SQL based system so we could of course query the SQL directly however there are many limitations with this approach especially security. Also via our RMS cloud platform absolutely no direct SQL access is available to end users.

Instead RMS supports a RESTful API, we’ll use a simple example to go through the basic steps.

RMS GET API

As before I’ll use some Python scripts in this example but if you prefer, POSTMAN is a great tool for testing these types of APIs.

Let’s breakdown the steps.

  1. Request API token using your username and password
  2. Use Token to request specific data
  3. Use data as required

Step 1 – Request a Token.

For security reasons you cannot simply send a request and get whatever data you desire. First you must request a token from RMS. The token is linked to a user account and will only allow the data that is visible by that user to be accessed. When requesting a token you can also specify how long it is valid for. The maximum length is 30 days.

import json
import requests

url = ‘https://rms.rotronic.com/RMS/API/RequestToken.ashx’
headers = {‘Content-Type’ : ‘Application/json’, ‘Expect’ : ‘100-continue’, ‘Connnection’ : ‘Close’, ‘Host’ : ‘rms.rotronic.com’}

UsrID = “1”
User= “Jeremy”
PW = “########”
Exp = “30”

get_payload = {‘UserId’:UsrID,’Username’:User,’Password’:PW,’RequestType’:’ DataHistory’,’ExpirationDays’: Exp}
api_get = requests.post(url, headers=headers, data =json.dumps (get_payload))
token = json.loads(api_get.content)
token = token.get(‘Token’)

The above request with suitable credentials will return something along these lines.

{‘UserId’: 1, ‘RequestType’: ‘DataHistory’, ‘Token’: ‘jUsTaNeXaMpLe_HRwOi8vd3d3LnczLm9yZy8yMDAxLzA0L3htbGRzaWctbW9yZSNobWFjLXNoYTI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOjM5MzEsIlJlcXVlc3RUeXBlIjoiRGF0YUhpc3RvcnkiLCJFeHBpcmF0aW9uIjoiMjAxOS0wNC0wM1QxNToyMzoyMC44MTgwODM4WiJ9.rtHHKvrE-7jnMNHUGazso_jUsTaNeXaMpLe’, ‘Status’: ‘OK’}

The API token being the jumble of text above. With the token in hand we can proceed with requesting our data.

Step 2 – Request Data

To request data we need the measuring point ID for the data we need which can be obtained from the RMS interface (every measured parameter has a unique ID within RMS that will not change and cannot be reused). We also define the From and To ranges as well as the number of values we wish to obtain (Count).

import json
import requests

url = ‘https://rms.rotronic.com/RMS/API/DataHistory.ashx’
headers = {‘Content-Type’ : ‘Application/json’, ‘Expect’ : ‘100-continue’, ‘Connnection’ : ‘Close’, ‘Host’ : ‘rms.rotronic.com’}

MPTID = “20”
From = “2019-03-04T08:00:00”
To = “2019-03-04T09:00:00”
Count = “10”
Token = “token from step 1”

post_payload = {‘ID’: MPTID,’From’: From,’To’:To,’Count’:Count,’Order’:’Asc’,’Token’: Token}
api_get = requests.post(url, headers=headers, data =json.dumps (post_payload))
data = json.loads(api_get.content)
print (data)

The above request with suitable details will return something along these lines.

{‘Status’: ‘OK’, ‘ID’: 20, ‘Name’: ‘Humidity-18071604′, ‘Parameter’: ‘Humidity‘, ‘Unit’: ‘%rh‘, ‘Data’: [{‘Time’: ‘2019-03-04T08:00:14+01:00′, ‘Value’: ‘29.45%rh‘}, {‘Time’: ‘2019-03-04T08:05:14+01:00’, ‘Value’: ‘29.80%rh’}, {‘Time’: ‘2019-03-04T08:10:14+01:00’, ‘Value’: ‘29.61%rh’}, {‘Time’: ‘2019-03-04T08:15:14+01:00’, ‘Value’: ‘29.29%rh’}, {‘Time’: ‘2019-03-04T08:20:14+01:00’, ‘Value’: ‘29.80%rh’}]}

Step 3 – Use the data

So we have our data in JSON format from here it’s an easy step to chopping out the specific values and handing them over to some other code, machine or simply displaying them for yourself.

The flexibility of RMS is an important requirement for our customers especially those with existing systems. Using RMS as the central platform ensures precision measurements, secure and reliable data collection and easy access to data. Using our  APIs then allows this data to be utilised in wider business operations.

integration examples

Customer examples using the API include

  • Live temperature data included in packaging labels
  • Automated calibration certificate generation using reference values from RMS
  • Visualisation of RMS data on 3rd party software for building efficiency displays

Conclusion

This article focuses on our RESTful API however we have many other options for integration of data including relay output modules, analogue output modules, direct SQL connection. In addition our RMS-Integrator hardware offers direct communication with devices via MODBUS, SNMP and MySQL.

So the message is simple; if you have requirements RMS can usually deliver what you need. Please contact us and we will be happy to discuss your project be it large or small.

Dr Jeremy Wingate
Rotronic UK

RMS integration with Met Office DataPoint. An experiment with APIs…

The latest Rotronic Monitoring System software has been designed specifically for the IoT and IIoT world. We have a wide and growing range of sensors, loggers as well as input and output modules but we will never keep up with the unique demands of our customers. That’s where integration is key for any successful continuous monitoring system!

iot

Hardware can already be integrated via analogue input modules such as our 8ADC and digital devices can be integrated via our RMS-Convertor that can be programmed with custom protocols and functions operate with virtually any device.

Want to cut out the waffle… login and see the live data now using the details below:

https://rms.rotronic.com/rms/
Company Name: rms demo cloud
User: guest
Password: guest1234

In addition to hardware, software integration is a must, and not easy when we consider RMS is a fully Gamp6 compliant system and therefore security and traceability is key.

Why not access the SQL DB?

All data on RMS is stored within an SQL database which with suitable rights can be queried easily to pull data out. However injecting data whilst possible triggers our system to report data manipulation. Also direct access to the database presents a security risk and uncontrolled changes to the system, and of course its not possible on shared systems.

That is why we also offer a Restful API through which data can be posted only when configured by users with appropriate permissions and each data stream is securely linked to a onetime token, by no means the best security but suitable for many applications (and of course the whole API function can be disabled if preferred). We of course have software wizards at our HQ that can develop professional integration solutions but as a hobbyist I wanted to see what I could achieve.

Example API Report

So my plan was to use Python and pull data from the Met Office DataPoint service and inject it directly into our RMS server software so it could visualised, reported and analysed accordingly. Just a few simple steps…

  • Step 1 Get the data from Met Office API
  • Step 2 Create API device in RMS and send your data
  • Step 3 Enjoy graphs, reports and custom alarms

Step 1 – Get the data from Met Office API.

The Met Office API is great you simply need to register to get an api key then get your head around the commands. Once you have that you can request the data you need via a simple url and the information is returned in xml or json format.

API Example
Met Office Datapoint API Response in XML

In Python requesting the last 24 hours of hourly data from location 3212 (Keswick) looks something like this…

Import json, requests
url = ‘http://datapoint.metoffice.gov.uk/public/data/val/wxobs/all/json/3212?res=hourly&key=YOURKEY’ #replace with your Met Office API key!
r = requests.get(url)
metoffice_data = json.loads(r.text)

This gives a Python dictionary with all the json data from which we can request specific values easily for example the latest conditions (no doubt there are more elegant solutions but this works for me).

Hum = (metoffice_data[‘SiteRep’][‘DV’][‘Location’][‘Period’][1][‘Rep’][-1][‘H’])
Temp = (metoffice_data[‘SiteRep’][‘DV’][‘Location’][‘Period’][1][‘Rep’][-1][‘T’])
Pres = (metoffice_data[‘SiteRep’][‘DV’][‘Location’][‘Period’][1][‘Rep’][-1][‘P’])
DewP = (metoffice_data[‘SiteRep’][‘DV’][‘Location’][‘Period’][1][‘Rep’][-1][‘Dp’])

Next we need to create our API device within RMS so it will accept our data

Step 2 – Create API device in RMS

Adding new API device in RMS is simple process, we create the device and define the Name and Serial number.

At this point RMS awaits an Post command in which the additional details are included. Using the Python code below I am able to create a device with 4 measurement points (measured values); Humidity, Temp; Pressure and Dew Point.

import json, requests

url = ‘http://rms.rotronic.com/wService/wService3.DeviceService.svc/UpdateDataJson’
headers = {‘Content-Type’ : ‘Application/json’, ‘Expect’ : ‘100-continue’, ‘Connnection’ : ‘Close’, ‘Host’ : ‘rms.rotronic.com’}

payload = {‘Name’:’API_Test’,’Serial’:’12345′,’Values’:[{‘Index’:’1′,’Typ’:’1′,’Value’:’50’},{‘Index’:’2′,’Typ’:’2′,’Value’:’23’},\
{‘Index’:’3′,’Typ’:’16’,’Value’:’5′},{‘Index’:’4′,’Typ’:’48’,’Value’:’1000′}]}
print (payload)
r = requests.post(url, headers=headers, data =json.dumps (payload))

Finally RMS gives us the device ID and API token which must be included in any future post commands.

Combining Step 1 and Step 2 allows us to simply replace my example values above with the real Met Office API data! Run the script hourly or permanently with an hour delay and we have a simple tool proving live data weather data!

Step 3 – Enjoy graphs, reports and custom alarms

With the data in RMS we can easily graph values and create email, sms or phone alarms. Taking the API further I it is possible download live satellite imagery and dynamically update the layouts in RMS!

Example Report

So it turns-out getting data into RMS via the API is simple with a bit of basic code. Of course Met Office data is just an example in modern industrial applications there is so much unique data from devices or software that might be of use and RMS aims to offer a complete monitoring solution not simply for our products!

Be sure to get in touch if you have any questions on the above or have any monitoring requirements. Use the demo login above or visit out RMS website for more details.

Dr Jeremy Wingate
Rotronic UK

 

What is the latest monitoring system from Rotronic? A practical answer and a technical answer.

The Rotronic Monitoring System (RMS) has now been officially launched globally for 12 months and in use at some key clients for over two years.

RMS is a modern continuous monitoring system that embraces open architecture and interoperability as well as providing a compliant system for validated applications.

But how is this achieved and what exactly is RMS. There are two ways I find myself answering this…

  • The technical answer – for IT project managers, system integrators and cyber security managers.
  • The practical answer – for end users, project managers and smaller organisations.

What is RMS – The Practical Answer…

The practical answer is more visible via our online demonstration (request guest access here) and via the details on our RMS satellite website.

In short RMS provides a modern and complete monitoring system with a detailed web interface. The system provides users with ease of access to data, reliable and manageable alarms and extensive reporting. Importantly RMS can support existing hardware and interact with other software/hardware platforms.

RMS can be provided as a hosted cloud service or using a traditional licence whereby the client installs the system on their servers (local or cloud).

In summary RMS provides amongst other things…

  • Live interactive charts
  • Full reporting and automated/scheduled report generation
  • Complete event logging in line with GxP requirements
  • Full alarming with logic and time schedules
  • Email, phone, sms, relay and custom protocol alarm outputs
  • Auto back fill and retrospective alarms (ideal for transport logging)
  • Interactive layouts
  • Complete user rights management
  • Compliant to GxP designed around ease of validation

This slideshow requires JavaScript.

Core RMS hardware includes Ethernet, WiFi, industrial wireless and RS485 devices as well as full support for existing Rotronic devices, 3rd party analogue devices and 3rd party digital devices using any of the above interfaces. The below graphic outlines the wide range of options available.

06 RMS Graphic

Contact us for further information or visit our website

What is RMS – The Technical Answer…

Let’s now go a bit deeper. For many organisations once end-users approve of a system the challenge is getting the system approved and installed in line with wider corporate policies and security. So far we have found that in discussions with IT project managers and cyber security managers, RMS has met their requirements – usually much to the surprise of the end users who perhaps initially expect a protracted battle! Typically for larger more secure organisations software is required to be installed within their network rather than using the Rotronic Cloud service. Below we discuss the main elements of this type of RMS installation.

RMS has two core elements.

1. Webservice; This is software aspect of RMS. The webservice provides the interactive webpage to present data for end users and allow system configuration. The webservice also works in the background to interact with hardware and the database. Typically the webpage will be part of the local intranet with an address like rms.yourorganisation.com, optionally the webpage can also be made accessible from the internet outside your organisation (like our cloud service which is available at http://rms.rotronic.com/rms – request guest access to the demo system here). For the clients (end users) no special software or plugins are required just a standard web-browser.

More technically the RMS webservice is built around ASP.Net framework and runs under Windows IIS (internet information services). The webservice therefore requires a Windows Server (2008, 2012 or 2016). The RMS software can be run on a standard PC with IIS enabled but this is not usually advised except for specific applications.

A note on RMS hardware; All Rotronic hardware initiates communication with the webservice via port 80. For cloud applications this means only port 80 must be opened outbound to allow the devices to initiate outbound communications to the server. All gateways have standard IP configurations (DHCP or fixed).

2. SQL Database; The second part of the RMS is its database. All device, configuration, user and measured data is stored within a standard MS-SQL database. The database is accessed by the webservice to store and read data as required. An existing SQL server can be used if available otherwise SQL-Express is free to install.

More technically the RMS database requires Microsoft-SQL Express or higher, the database can be on the same server as the webservice or a separate machine.

As RMS is built around standard server based systems, there is full support for load balancing and failover, as such should a webserver or sql server fail a redundant/spare can take over. This is standard procedure for larger IT systems.

Some other technical points about RMS.

  • Supports LDAP (so you can use windows login and password)
  • No personal data stored outside SQL database (hardware only stores unique serial code, date, time and measured values – as such no private data passes between hardware and software).
  • Webpage data is binary coded and authentication uses AES128 encryption.
  • Key exchange uses diffie-hellman key alogrithm.
  • 3rd party data / device support is possible via RESTful API or direct interaction with SQL database.

An overview of the RMS communication can be seen here.

08 RMS Communication

For many projects clearly we go much deeper but hopefully this provides an overview. Our experience to date has shown that RMS is closely inline with what our clients expect in terms of operations and security. Further developments are always underway, lead by our customers and their requirements.

Please contact us if you wish to discuss a project or gather further information.

Dr Jeremy Wingate
Rotronic UK

What is Dew Point Temperature

Our state side colleagues have put together a great FAQ technical note explaining dew point temperature in more detail!

chilled mirror / dew point mirror
chilled mirror / dew point mirror

The FAQ technical note can be accessed here and answers the following key questions!

  1. What is dew point temperature?
  2. What is frost  point?
  3. When should I choose dew point as the parameter I measure?
  4. What are the pros and cons of measuring dew point versus relative humidity?
  5. Does dew point change as the ambient temperature changes?
  6. How does pressure affect dew point measurement?
  7. What are the common technologies for measuring dew point?
  8. Isn’t dew point temperature the same thing as wet bulb temperature?
  9. How do I know which technology is best for my application?
  10. Where can I buy a dew point instrument?

Rotronic produce precision low dew point sensors for low moisture applications in addition Rotronic UK is the UK distributor for world class MBW chilled mirrors, please contact us for additional information!

Dr Jeremy Wingate
Rotronic UK

Energy Efficiency and Reliability in Modern Data Centres

Introduction

Data centres are rapidly becoming the power houses of the modern world. Combined with the rise of digital industries, virtually all business operations now rely in some way on the transfer of data. As data transfer rates increase in tandem with an explosion in mobile communication the demands on data centre infra-structure are ever increasing.

It is estimated that by 2018 global data traffic will exceed 8500 exabytes (32% compound annual growth rate).

Data centres provide the infra-structure to support the transfer and hosting of data. They are often classified into 4 tiers. Tier 4 provides highest levels of redundancy, security and efficiency. For example, a Tier 4 data centre is required to have an uptime of 99.995% equivalent to less than 27 minutes downtime per year! Tier 4 sites have fully redundant systems, power supplies and biometric security. Zero downtime is the ideal as the costs incurred via end user penalties can be huge.

data centre tiers

Why the need to measure temperature, humidity and differential pressure?

Data centres must be maintained to specific environmental conditions to ensure the performance and longevity of the hardware installed. As standard, temperature must be 18-27 °C, dew point 5-15 °C dp and humidity no higher than 60 %rh. This ensures the hardware is at a suitable temperature, condensation is avoided and the chance of static build up is reduced (caused by low humidity).

A control range of ±9 °C may seem relatively broad, however 100% of the energy supplied to server hardware is converted to heat. In most data centres if the cooling system fails and servers are not shut down, heat levels will rise above a critical 35 °C within minutes or even seconds. If unchecked, temperature levels will rise causing hardware damage and can result in electrical fires.

Achieving the specified control range requires precision sensors and advanced control systems. Typically modern data centres are designed using computational fluid dynamics to ensure the very highest efficiency. Despite this it is estimated around 5% of US electrical energy used is for data centre cooling.

pue power usage effectiveness

Since 100% of electricity utilised by servers is converted to heat, theoretically a 100% efficient cooling system would require an equal amount of energy. Efficiency is measured by comparing total facility energy use, with IT equipment energy use. This is called Power Usage Effectiveness (PUE). Theoretically PUE can be 1 but typically reported values are above 2. By utilising precision measurements and design, modern data centres achieve PUEs of ~1.1!

An improvement of 0.5 in a data centre’s PUE  equates to a energy saving of ~£2.2 M & ~12,000 tonnes CO2 over 5 years (for a site with 1 MW load).

 

What solutions can Rotronic offer?

Rotronic provides a range of instruments for environmental monitoring and control. Reliable and precise outside air sensors and weather shields enable natural cooling to be utilised where possible.

Inside the data centres, Rotronic interchangeable HC2-S probes can provide a combination of precise, fast response temperature and humidity measurements with ease of calibration. Our latest PF4 differential pressure transmitters provide precision low drift measurements.

With both digital and a range of analogue outputs available as well as several probe mounting options, products can be selected for all applications.

Importantly though we aim to understand your needs and build a relationship with the goal of providing an appropriate solution, combining instruments, training, calibration and ongoing support.

Dr Jeremy WIngate
Rotronic UK

 

Technical Note 1 – Digital Integration of Rotronic devices

The Rotronic HygroClip2 was launched around four years ago and is used as standard with most of our devices. Underpinning the HygroClip2’s performance beyond the Rotronic sensor element is some impressive technology.

The Airchip3000 is the chip that provides high resolution measurement of the raw sensor outputs, temperature compensation and calibration correction tables which ultimately provides the high accuracy measurements our customers demand.  In addition, the Airchip provides digital and analogue communications. All the Rotronic instrumentation communicates digitally to these probes but these interface methods are possible without using a Rotronic handheld/logger/transmitter etc.

Lets explore what is possible…

Connections

Devices can be connected to your software or systems via USB, Ethernet, Serial or Wireless depending on the physical connections available. The AirChip itself has a simple RS232 output so additional hardware will be required for for anything but direct RS232 interface (to a Raspberry Pi GPIO for example).

Rotronic DLL

The Rotronic DLL provides a link between Rotronic devices and your software program (as well as our HW4 software). The DLL allows you to call up all functions within our devices that are accessible via our software. We have several example packages to make developing your own systems easier including;

– C++
– Visual Basic
– LabView
– Excel

The DLL can be integrated into wider software systems, if you have sufficient technical know-how. For example using using ctypes in Python allows the integration of Windows DLL. Python programs can then be used cross platform (Windows, Mac and Linux etc).

This approach is typically used when integrating our HC2 range of probes via our AC3001 Probe-USB converter cable. This way you can utilise our highest accuracy probes in a simple and efficient manor without any loss of accuracy due to digital-analogue conversions. It is also possible to quickly add the measured values into your existing projects. This is how our HygroGen2’s Autocal system communicates to the Rotronic probes during automated calibration and adjustment runs.

Example programs and DLL itself can be downloaded here

If you require support integrating our sensors into your systems please do not hesitate to contact us!

Direct Device Interface

In certain situations utilsing our DLL may not be appropriate for your project. So it is also possible to directly communicate with the Airchip3000 devices avoiding the DLL and using direct protocol commands. This is often a far simpler method and more commonly used when integrating to industrial systems.

With Ethernet and Serial devices communication if very easy using a terminal program (eg Putty) or direct from your Linux terminal (For USB some extra step are required explained at the end of this article).

1. Connecting to Rotronic devices via Putty (!!! USING USB? READ THE NOTE AT THE BOTTOM OF THIS POST !!!

Firstly, you simply need to connect to the relevant comm port or IP Address and send your commands. Serial interface settings are detailed below. For Ethernet simply use RAW connection and select port 2101 or use Telnet with Port 2001 (you will need your devices IP address)

Step 1 – Setup Serial Settings in Putty

Putty Setup

Step 2 – Force Echo On / Line Editing
I strongly recommend changing the Terminal settings to Force Echo (so you can see what you type and edit it)…

Putty Setting Echo

Step 3 – Connect
Now simply open your session…

Putty Open

All Airchip devices will respond to the command below, an example response is shown from a HC2-S probe.

Sent Command
{ 99rdd}

Return String
{F00rdd 001; 36.30;%rh;000;=; 24.30;°C;000;=;nc;—.- ;°C;000; ;001;V2.0-2;0061176056;HC2 ;000;C

Explaination ( “;” separated values)
{
F = Device Type
00 = RS485 address
rdd = command
001 = Device type

36.30 = value 1
%rh = value 1 units
000 = value 1 alarm condition
= = trend

24.30 = value 2
°C = value 2 units
000 = value 2 alarm condition
= = trend

nc = calculated value selected
—.- = calculated value
°C = calculated value units
000 = calculated value alarm condition
= calculated value trend

001 = hardware version
V2.0-2 = firmware version
0061176056 = serial number
HC2 = device name
000 = sensor alarm
C = checksum

Important Note! Using USB interface with Putty

By default all Rotronic USB interface cables will link to the Rotronic driver and try to use the DLL. However if you configure the cable to be a Virtual Comm Port you can use the simple serial connection method described above! So you can see every device  connection type can be interfaced using this method 🙂

To do this you need to force windows to use the standard FTDI driver and setup the Virtual Comm Port.

Step 1 Install FTDI Drives

Select the relevant drivers from this page for you OS http://www.ftdichip.com/Drivers/D2XX.htm

Step 2 – Force Windows to use new driver

Go to device manager (Control Panel, System, Device Manager)

1 – Click Update Driver
2 – Select Browse my computer for Driver
3 – Choose ‘Let my pick from a list’
4 – Click Have Disk
5 – Go to the FTDI folder and click  ftdibus.ini
6 – Select the USB Serial Port

Now you will see a new USB Serial Port in Device Manager under Ports (COMM AND LPT) – right click and select properties. Ensure the Port Settings are as below.

Baud rate : 19200
Data bits : 8
Parity : none
Stop bits : 1
Flow Control : none

You can now use the Virtual Comm Port in putty or other projects.

In my experience with bespoke software packages for a single device type the terminal connection is very simple.

For example a simple Python code to communicate with an Ethernet device is below…

try:
session = telnetlib.Telnet(192.168.1.1, 2001, 0.5)
except socket.timeout:
print (“socket timeout”)
else:
session.write(“{ 99RDD}”.encode(‘ascii’) + b”\r”)
output = session.read_until(b”/r/n/r/n#>”, timeout )
session.close()
print(output)

We will look at direct interface to the AirChip and available protocol options next time!

Comments or queries – let us know!!

Dr. Jeremy Wingate
Rotronic UK