Monday, February 13, 2017

Layered Process Audit Application


I want to make a quality audit application - Layered process audit - think survey app.

Along these lines:

https://github.com/williej/rails-nested-survey

    This one is quite simple and uses cocoon nested forms.
    I want to add question types (like harley/surveyor),  drop down list of questions to choose from, sort order for questions, answers should have and issues field and corrections field.
    Questions could have correct answers.

https://github.com/harley/surveyor

  •     This is close to what I want. BUT.. I don't understand the code he uses. I more understand cocoon nested forms like williej uses.
  •    Proposed changes..
  •     I want to add drop-down question type,  drop down list of questions to choose from, sort order for questions, 
  •             answers should have and issues field and corrections  field.
  •     Questions could have correct answers.

This is what I have built so far..

https://github.com/dgleba/lpa338


Notes:
- I want to use devise with devise-ldap-authenticable, to use our active directory for user/pass like I am using on other apps.

Other examples..


https://github.com/runtimerevolution/survey  ( has online demo )

https://github.com/code-mancers/rapidfire  ( has online demo, see demo app code and link there )

Sign in. Pick an audit. 7-20 questions are presented based on who you are. Answer the questions and provide comments regarding issues and corrective actions taken.

I have written many apps, but I can't get my head around this one.


_____________

As I think about this more, I have hacked on the williej schema by taking inspriation from harley/surveyor.

These are the scaffolds to create it.


----

rails generate scaffold Answer body:text choice:references question:references response:references  issue:string action:text -f

rails generate scaffold Choice name:string question:references -f

rails generate scaffold Question name question_list:references sort:integer qtype:integer survey:references -f

rails generate scaffold QuestionList name:string sort:integer active_status:integer -f

rails generate scaffold Survey name:string  -f

rails generate scaffold Response survey:references user:references ip:string -f


----



Previously, I had hacked on this...



Harley schema with proposed changes..

See > symbols below..


ActiveRecord::Schema.define(version: 20160728042324) do

  create_table "answers", force: :cascade do |t|
    t.integer  "choice_id"
    t.integer  "question_id"
    t.integer  "response_id"
    t.string   "content"

>    text issue
>    text correction
    
    t.datetime "created_at",  null: false
    t.datetime "updated_at",  null: false
    t.index ["choice_id"], name: "index_answers_on_choice_id"
    t.index ["question_id"], name: "index_answers_on_question_id"
    t.index ["response_id"], name: "index_answers_on_response_id"
  end

  create_table "choices", force: :cascade do |t|
    t.integer  "question_id"
    t.string   "content"
    t.datetime "created_at",  null: false
    t.datetime "updated_at",  null: false
    t.index ["question_id"], name: "index_choices_on_question_id"
  end

  create_table "collaborations", force: :cascade do |t|
    t.integer  "survey_id"
    t.integer  "user_id"
    t.integer  "role"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["survey_id"], name: "index_collaborations_on_survey_id"
    t.index ["user_id"], name: "index_collaborations_on_user_id"
  end

  create_table "questions", force: :cascade do |t|
    t.string   "title"
    t.integer  "survey_id"
    t.integer  "type"
    
>    integer sort
>    integer active
    
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["survey_id"], name: "index_questions_on_survey_id"
  end

  create_table "responses", force: :cascade do |t|
    t.integer  "survey_id"
    t.string   "ip"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.index ["survey_id"], name: "index_responses_on_survey_id"
  end

  create_table "surveys", force: :cascade do |t|
    t.string   "title"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  create_table "users", force: :cascade do |t|
    t.string   "email"
    t.string   "password_digest"
    t.datetime "created_at",                      null: false
    t.datetime "updated_at",                      null: false
    t.boolean  "admin",           default: false
  end

end


Thursday, February 9, 2017

Test to get data from PLC to influxDB


Installing Ignition Server


Conditions:
  • ubuntu 14.04 server with LXDE running in virtualbox VM


https://inductiveautomation.com/downloads/ignition

install:

If Java 8 is not already installed, run the following commands to install it:  
sudo add-apt-repository ppa:webupd8team/javasudo apt-get updatesudo apt-get install oracle-java8-installer

  • Ignition-7.9.1-linux-x64-installer.run 



https://docs.inductiveautomation.com:8443/display/DOC/Installing+Ignition+on+Linux

start the gateway

  • sudo /etc/init.d/ignition start


Error:
albe@v206c:~/Downloads$ sudo /etc/init.d/ignition start
Starting Ignition Gateway...
Waiting for Ignition Gateway......................
WARNING: Ignition Gateway may have failed to start.



_____________

https://www.influxdata.com/

wget https://dl.influxdata.com/influxdb/releases/influxdb_1.2.0_amd64.deb
sudo dpkg -i influxdb_1.2.0_amd64.deb

Installed OK.

_____________


https://github.com/coussej/node-opcua-logger

_____________


http://www.osboxes.org/ubuntu-mate/


Ubuntu Mate 16.04 Xenial

VirtualBox
VirtualBox (VDI) 64bit Download Size: 1.1GB
MD5: 7f0eb37bfa12d3e7570e2175f4141dc0
Username: osboxes
Password: osboxes.org

VB Guest Additions & VMware Tools: Not Installed

_____________


https://rodandfly.ca/ignition-with-simulated-plc-to-influxdb-with-via-opc-ua/

_____________




Friday, February 3, 2017

Multivariate Analysis - Collecting the Data

Open source Industrial data collection with OPC server:
Or maybe not..


Updated: 2017-02-13 11:49 AM


1.
http://coussej.github.io/2016/04/18/Building-An-Open-Source-Process-Historian/

I’m currently testing this on a production system for monitoring some values in a Siemens S7 PLC, using a Simatic NET v12 server.

2.
OPC to InfluxDB plugin

https://github.com/coussej/node-opcua-logger


3.
I think this is OPC server..

https://en.wikipedia.org/wiki/OPC_Unified_Architecture

https://en.wikipedia.org/wiki/Open_Platform_Communications


4.
Python OPC UA communication to Allen Bradley Modbus

https://github.com/FreeOpcUa/python-opcua/issues/116

https://github.com/zerox1212/python-opcua-modbus-driver


5.
Links:

http://industrial.softing.com/en/news/news-details/article/opc-ua-gateway-for-siemens-s7-plc-connection.html

6.
OPC UA made easy

https://github.com/uaf/uaf



7.
Ignition:

2017-02-06:
We are looking at the Ignition server product.

Example: SQL bridge module, Allen-Bradley Driver Suite, Siemens Driver Suite. This should get the data from PLC to OPC UA server.

https://inductiveautomation.com/

https://inductiveautomation.com/pricing/ignition
  • Scroll to the bottom and see the individual item prices.
Have a question? We'd love to help! Get in touch by calling us at 1-800-266-7798.

11.
OPC - UA -- Chris has done some testing.

2017-02-13
https://rodandfly.ca/ignition-with-simulated-plc-to-influxdb-with-via-opc-ua/


15.
How to connect to ignition opc-ua anonymous

https://support.inductiveautomation.com/usermanuals/ignition/index.html?connecting_to_opc_ua.htm

  • see - Message Security Mode
  • see - Authentication

https://support.inductiveautomation.com/usermanuals/ignition/index.html?troubleshooting_opc_com_connec.htm

  • see  - Allow Anonymous Access


http://www.opcconnect.com/uafree.php


41.
MVA:

ProSensus Inc.: Overview | LinkedIn
Sold to Aspen Technologies


https://en.wikipedia.org/wiki/Multivariate_analysis




Notes:


IOT  -  protocol is MQTT


plc reading ref...
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=81551
Most of the PLCs support the Modbus protocol (TCP or RTU).

https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=81551

http://stackoverflow.com/questions/39006884/pymodbus-failed-to-connect-with-plc-slave-and-raspberry-pi-master