Here’s what we have now and what we do…
An electrical enclosure with 5 on/off toggle switches. Each switch is wired to a solenoid valve (attached on 5 different pipes) that open or close when the corresponding switch position is changed. We always have 1 switch open and 4 closed (never more than 1 open at a time). There is no automation whatsover – this is entirely manual. When a switch is open, the corresponding solenoid is open and allows gas to flow through the designated pipe and into a measurement device that we use to measure the dew point of the gas. That device has a 4-20mA output and which we can query using XML (more on this later). Right now, we flip a switch to let the gas flow for 30 min. at a time. For the last 10 min. of that 30-min window, we take the dew point measurement and write it down on paper.
Here’s what we want to do…
Use the OPTO-P1-40P, SNAP-D4M, and an appropriate SNAP module(s) to run Node-RED on a Raspberry Pi to do a simple program. We already maintain in a SQL database a ‘live’ list of which of the 5 pipes to measure. The pipes are labeled 301, 302, 303, 304, and 305. For example, if I run the SQL query on Monday, it might say to measure 301 and 302. If we run the query next Thursday, it might say to measure 302, 303 and 305. I have that flow already working! (for simplicity, just disregard the word GeneratorNumber and think of it as PipeNumber)
If the above SQL query shows, for example, 301 and 302, then we would need to first open the solenoid corresponding to 301 and keep it open for 30 minutes. Next, we need a node that will retrieve (say, every 1 minute) the XML data for each pipe being sampled, and only for the last 10 minutes of the 30 minute window. Once done, we should move on to the next pipe to be sampled (if there is one) and do the same thing. Keep going until the dataset (301 and 302, in this case) is done. Then the SQL query would run again and the cycle would repeat.
The measurement device we have is hooked up to this. Page 43 indicates we can use XML, for example:
Request the current state:
This will return the following:
In our case, we are only looking at one input (let’s say input3), so we would only care about the value 180.42037. Is there a suitable node or general approach to obtaining the desired value (input3) every minute for 10 minutes?
I may be able to figure this out on my own, but before I bought the Pi carrier board and Snap modules, I wanted to make sure I was not overlooking anything.