mmd604

MrPLC Member
  • Content count

    25
  • Joined

  • Last visited

Community Reputation

0 Neutral

About mmd604

  • Rank
    Sparky

Profile Information

  • Country Canada
  1. Data Collection and Display

    Download and install node red and then install this pallet "node-red-contrib-opcua-server"   
  2. Data Collection and Display

    function constructAlarmAddressSpace(server, addressSpace, eventObjects, done) {   // server = the created node-opcua server   // addressSpace = address space of the node-opcua server   // eventObjects = add event variables here to hold them in memory from this script   // internal sandbox objects are:   // node = the compact server node,   // coreServer = core compact server object for debug and access to NodeOPCUA   // this.sandboxNodeContext = node context node-red   // this.sandboxFlowContext = flow context node-red   // this.sandboxGlobalContext = global context node-red   // this.sandboxEnv = env variables   // timeout and interval functions as expected from nodejs   const opcua = coreServer.choreCompact.opcua;   const LocalizedText = opcua.LocalizedText;   const namespace = addressSpace.getOwnNamespace();   const Variant = opcua.Variant;   const DataType = opcua.DataType;   const DataValue = opcua.DataValue;   var flexServerInternals = this;   this.sandboxFlowContext.set("isoInput1", 0);   this.setInterval(() => {     flexServerInternals.sandboxFlowContext.set(       "isoInput1",       Math.random() + 50.0     );   }, 500);   this.sandboxFlowContext.set("isoInput2", 0);   this.sandboxFlowContext.set("isoInput3", 0);   this.sandboxFlowContext.set("isoInput4", 0);   this.sandboxFlowContext.set("isoInput5", 0);   this.sandboxFlowContext.set("isoInput6", 0);   this.sandboxFlowContext.set("isoInput7", 0);   this.sandboxFlowContext.set("isoInput8", 0);   this.sandboxFlowContext.set("isoInput9", 0);   this.sandboxFlowContext.set("isoOutput1", 0);   this.setInterval(() => {     flexServerInternals.sandboxFlowContext.set(       "isoOutput1",       Math.random() + 10.0     );   }, 500);   this.sandboxFlowContext.set("isoOutput2", 0);   this.sandboxFlowContext.set("isoOutput3", 0);   this.sandboxFlowContext.set("isoOutput4", 0);   this.sandboxFlowContext.set("isoOutput5", 0);   this.sandboxFlowContext.set("isoOutput6", 0);   this.sandboxFlowContext.set("isoOutput7", 0);   this.sandboxFlowContext.set("isoOutput8", 0);   this.sandboxFlowContext.set("isoOutput9", 0);   coreServer.debugLog("init dynamic address space");   const rootFolder = addressSpace.findNode("RootFolder");   node.warn("construct new address space for OPC UA");   const myDevice = namespace.addFolder(rootFolder.objects, {     "browseName": "RaspberryPI-Zero-WLAN"   });   const gpioFolder = namespace.addFolder(myDevice, { "browseName": "GPIO" });   const isoInputs = namespace.addFolder(gpioFolder, {     "browseName": "Inputs"   });   const isoOutputs = namespace.addFolder(gpioFolder, {     "browseName": "Outputs"   });   const gpioDI1 = namespace.addVariable({     "organizedBy": isoInputs,     "browseName": "I1",     "nodeId": "ns=1;s=Isolated_Input1",     "dataType": "Double",     "value": {       "get": function() {         return new Variant({           "dataType": DataType.Double,           "value": flexServerInternals.sandboxFlowContext.get("isoInput1")         });       },       "set": function(variant) {         flexServerInternals.sandboxFlowContext.set(           "isoInput1",           parseFloat(variant.value)         );         return opcua.StatusCodes.Good;       }     }   });   const gpioDI2 = namespace.addVariable({     "organizedBy": isoInputs,     "browseName": "I2",     "nodeId": "ns=1;s=Isolated_Input2",     "dataType": "Double",     "value": {       "get": function() {         return new Variant({           "dataType": DataType.Double,           "value": flexServerInternals.sandboxFlowContext.get("isoInput2")         });       },       "set": function(variant) {         flexServerInternals.sandboxFlowContext.set(           "isoInput2",           parseFloat(variant.value)         );         return opcua.StatusCodes.Good;       }     }   });   const gpioDI3 = namespace.addVariable({     "organizedBy": isoInputs,     "browseName": "I3",     "nodeId": "ns=1;s=Isolated_Input3",     "dataType": "Double",     "value": {       "get": function() {         return new Variant({           "dataType": DataType.Double,           "value": flexServerInternals.sandboxFlowContext.get("isoInput3")         });       },       "set": function(variant) {         flexServerInternals.sandboxFlowContext.set(           "isoInput3",           parseFloat(variant.value)         );         return opcua.StatusCodes.Good;       }     }   });   const gpioDI4 = namespace.addVariable({     "organizedBy": isoInputs,     "browseName": "I4",     "nodeId": "ns=1;s=Isolated_Input4",     "dataType": "Double",     "value": {       "get": function() {         return new Variant({           "dataType": DataType.Double,           "value": flexServerInternals.sandboxFlowContext.get("isoInput4")         });       },       "set": function(variant) {         flexServerInternals.sandboxFlowContext.set(           "isoInput4",           parseFloat(variant.value)         );         return opcua.StatusCodes.Good;       }     }   });   const gpioDI5 = namespace.addVariable({     "organizedBy": isoInputs,     "browseName": "I5",     "nodeId": "ns=1;s=Isolated_Input5",     "dataType": "Double",     "value": {       "get": function() {         return new Variant({           "dataType": DataType.Double,           "value": flexServerInternals.sandboxFlowContext.get("isoInput5")         });       },       "set": function(variant) {         flexServerInternals.sandboxFlowContext.set(           "isoInput5",           parseFloat(variant.value)         );         return opcua.StatusCodes.Good;       }     }   });   const gpioDI6 = namespace.addVariable({     "organizedBy": isoInputs,     "browseName": "I6",     "nodeId": "ns=1;s=Isolated_Input6",     "dataType": "Double",     "value": {       "get": function() {         return new Variant({           "dataType": DataType.Double,           "value": flexServerInternals.sandboxFlowContext.get("isoInput6")         });       },       "set": function(variant) {         flexServerInternals.sandboxFlowContext.set(           "isoInput6",           parseFloat(variant.value)         );         return opcua.StatusCodes.Good;       }     }   });   const gpioDI7 = namespace.addVariable({     "organizedBy": isoInputs,     "browseName": "I7",     "nodeId": "ns=1;s=Isolated_Input7",     "dataType": "Double",     "value": {       "get": function() {         return new Variant({           "dataType": DataType.Double,           "value": flexServerInternals.sandboxFlowContext.get("isoInput7")         });       },       "set": function(variant) {         flexServerInternals.sandboxFlowContext.set(           "isoInput7",           parseFloat(variant.value)         );         return opcua.StatusCodes.Good;       }     }   });   const gpioDI8 = namespace.addVariable({     "organizedBy": isoInputs,     "browseName": "I8",     "nodeId": "ns=1;s=Isolated_Input8",     "dataType": "Double",     "value": {       "get": function() {         return new Variant({           "dataType": DataType.Double,           "value": flexServerInternals.sandboxFlowContext.get("isoInput8")         });       },       "set": function(variant) {         flexServerInternals.sandboxFlowContext.set(           "isoInput8",           parseFloat(variant.value)         );         return opcua.StatusCodes.Good;       }     }   });     const gpioDI9 = namespace.addVariable({     "organizedBy": isoInputs,     "browseName": "I9",     "nodeId": "ns=1;s=Isolated_Input9",     "dataType": "Double",     "value": {       "get": function() {         return new Variant({           "dataType": DataType.Double,           "value": flexServerInternals.sandboxFlowContext.get("isoInput9")         });       },       "set": function(variant) {         flexServerInternals.sandboxFlowContext.set(           "isoInput9",           parseFloat(variant.value)         );         return opcua.StatusCodes.Good;       }     }   });   const gpioDO1 = namespace.addVariable({     "organizedBy": isoOutputs,     "browseName": "O1",     "nodeId": "ns=1;s=Isolated_Output1",     "dataType": "Double",     "value": {       "get": function() {         return new Variant({           "dataType": DataType.Double,           "value": flexServerInternals.sandboxFlowContext.get("isoOutput1")         });       },       "set": function(variant) {         flexServerInternals.sandboxFlowContext.set(           "isoOutput1",           parseFloat(variant.value)         );         return opcua.StatusCodes.Good;       }     }   });   const gpioDO2 = namespace.addVariable({     "organizedBy": isoOutputs,     "browseName": "O2",     "nodeId": "ns=1;s=Isolated_Output2",     "dataType": "Double",     "value": {       "get": function() {         return new Variant({           "dataType": DataType.Double,           "value": flexServerInternals.sandboxFlowContext.get("isoOutput2")         });       },       "set": function(variant) {         flexServerInternals.sandboxFlowContext.set(           "isoOutput2",           parseFloat(variant.value)         );         return opcua.StatusCodes.Good;       }     }   });   const gpioDO3 = namespace.addVariable({     "organizedBy": isoOutputs,     "browseName": "O3",     "nodeId": "ns=1;s=Isolated_Output3",     "dataType": "Double",     "value": {       "get": function() {         return new Variant({           "dataType": DataType.Double,           "value": flexServerInternals.sandboxFlowContext.get("isoOutput3")         });       },       "set": function(variant) {         flexServerInternals.sandboxFlowContext.set(           "isoOutput3",           parseFloat(variant.value)         );         return opcua.StatusCodes.Good;       }     }   });   const gpioDO4 = namespace.addVariable({     "organizedBy": isoOutputs,     "browseName": "O4",     "nodeId": "ns=1;s=Isolated_Output4",     "dataType": "Double",     "value": {       "get": function() {         return new Variant({           "dataType": DataType.Double,           "value": flexServerInternals.sandboxFlowContext.get("isoOutput4")         });       },       "set": function(variant) {         flexServerInternals.sandboxFlowContext.set(           "isoOutput4",           parseFloat(variant.value)         );         return opcua.StatusCodes.Good;       }     }   });   const gpioDO5 = namespace.addVariable({     "organizedBy": isoOutputs,     "browseName": "O5",     "nodeId": "ns=1;s=Isolated_Output5",     "dataType": "Double",     "value": {       "get": function() {         return new Variant({           "dataType": DataType.Double,           "value": flexServerInternals.sandboxFlowContext.get("isoOutput5")         });       },       "set": function(variant) {         flexServerInternals.sandboxFlowContext.set(           "isoOutput5",           parseFloat(variant.value)         );         return opcua.StatusCodes.Good;       }     }   });   const gpioDO6 = namespace.addVariable({     "organizedBy": isoOutputs,     "browseName": "O6",     "nodeId": "ns=1;s=Isolated_Output6",     "dataType": "Double",     "value": {       "get": function() {         return new Variant({           "dataType": DataType.Double,           "value": flexServerInternals.sandboxFlowContext.get("isoOutput6")         });       },       "set": function(variant) {         flexServerInternals.sandboxFlowContext.set(           "isoOutput6",           parseFloat(variant.value)         );         return opcua.StatusCodes.Good;       }     }   });   const gpioDO7 = namespace.addVariable({     "organizedBy": isoOutputs,     "browseName": "O7",     "nodeId": "ns=1;s=Isolated_Output7",     "dataType": "Double",     "value": {       "get": function() {         return new Variant({           "dataType": DataType.Double,           "value": flexServerInternals.sandboxFlowContext.get("isoOutput7")         });       },       "set": function(variant) {         flexServerInternals.sandboxFlowContext.set(           "isoOutput7",           parseFloat(variant.value)         );         return opcua.StatusCodes.Good;       }     }   });   const gpioDO8 = namespace.addVariable({     "organizedBy": isoOutputs,     "browseName": "O8",     "nodeId": "ns=1;s=Isolated_Output8",     "dataType": "Double",     "value": {       "get": function() {         return new Variant({           "dataType": DataType.Double,           "value": flexServerInternals.sandboxFlowContext.get("isoOutput8")         });       },       "set": function(variant) {         flexServerInternals.sandboxFlowContext.set(           "isoOutput8",           parseFloat(variant.value)         );         return opcua.StatusCodes.Good;       }     }   });   const gpioDO9 = namespace.addVariable({     "organizedBy": isoOutputs,     "browseName": "O9",     "nodeId": "ns=1;s=Isolated_Output9",     "dataType": "Double",     "value": {       "get": function() {         return new Variant({           "dataType": DataType.Double,           "value": flexServerInternals.sandboxFlowContext.get("isoOutput9")         });       },       "set": function(variant) {         flexServerInternals.sandboxFlowContext.set(           "isoOutput9",           parseFloat(variant.value)         );         return opcua.StatusCodes.Good;       }     }   });   //------------------------------------------------------------------------------   // Add a view   //------------------------------------------------------------------------------   const viewDI = namespace.addView({     "organizedBy": rootFolder.views,     "browseName": "RPIW0-Digital-Ins"   });   const viewDO = namespace.addView({     "organizedBy": rootFolder.views,     "browseName": "RPIW0-Digital-Outs"   });   viewDI.addReference({     "referenceType": "Organizes",     "nodeId": gpioDI1.nodeId   });   viewDI.addReference({     "referenceType": "Organizes",     "nodeId": gpioDI2.nodeId   });   viewDI.addReference({     "referenceType": "Organizes",     "nodeId": gpioDI3.nodeId   });   viewDI.addReference({     "referenceType": "Organizes",     "nodeId": gpioDI4.nodeId   });   viewDI.addReference({     "referenceType": "Organizes",     "nodeId": gpioDI5.nodeId   });   viewDI.addReference({     "referenceType": "Organizes",     "nodeId": gpioDI6.nodeId   });   viewDI.addReference({     "referenceType": "Organizes",     "nodeId": gpioDI7.nodeId   });   viewDI.addReference({     "referenceType": "Organizes",     "nodeId": gpioDI8.nodeId   });          viewDI.addReference({     "referenceType": "Organizes",     "nodeId": gpioDI9.nodeId   });     viewDO.addReference({     "referenceType": "Organizes",     "nodeId": gpioDO1.nodeId   });   viewDO.addReference({     "referenceType": "Organizes",     "nodeId": gpioDO2.nodeId   });   viewDO.addReference({     "referenceType": "Organizes",     "nodeId": gpioDO3.nodeId   });   viewDO.addReference({     "referenceType": "Organizes",     "nodeId": gpioDO4.nodeId   });   viewDO.addReference({     "referenceType": "Organizes",     "nodeId": gpioDO5.nodeId   });   viewDO.addReference({     "referenceType": "Organizes",     "nodeId": gpioDO6.nodeId   });   viewDO.addReference({     "referenceType": "Organizes",     "nodeId": gpioDO7.nodeId   });   viewDO.addReference({     "referenceType": "Organizes",     "nodeId": gpioDO8.nodeId   });    viewDO.addReference({     "referenceType": "Organizes",     "nodeId": gpioDO9.nodeId   });   coreServer.debugLog("create dynamic address space done");   node.warn("construction of new address space for OPC UA done");   done(); }  
  3. Data Collection and Display

    Boblfoot I sucessfully done this If anybody wants my opc server code let me know.  You could also Cip message into allen bradley from node red
  4. OTE instruction

    I knew it would something simply.  I am confident you are right with clarify tomorrow thanks !
  5. OTE instruction

    yes Armadillo852 I was in remote program
  6. OTE instruction

    1756(5571)  5000 suite.   I have been trying to force a solenoid valve and when I force it from the controller tags nothing happens it say ON and I apply forces but nothing happens.  I go back and look at the controller tags and the force mask says 1 but the value remains 0........ I know its gonna be some thing so simple
  7. OTE instruction

    Can you not force a OTE instuction when you are in remote program mode?
  8. Contrologix 5771 and Point I/O

    Thanks appreciate the quick response as you said I have a number of faults on the 5771 after the download.  How would I inhibit these faults? Also I will have to change ip of the drive and the remote i/o now that I changed the 5771 ip. can I do this in the i/o tree and I would guess I would also have to do that locally at the drive as well.  Thanks  again
  9. I have a couple of questions regarding a system I have been tasked to commission the I/O. I have a 5771 controller with ethernet card and 2 remote i/o(Point i/o) via ethernet and a vfd (powerflex) via ethernet.  My question is do I have to power up and establish communciations between every device to download to the 5771 controller.  Or can I just establish comms between the 5771 and Point i/o and download.  The reason I ask is the Drive has not been wired by the contractor and is 2 weeks away from completion. Drive is also been controlled via ethernet 5000 suite.  Also if I have to change a IP on the 5771 is a download required to make the Change?
  10. Thanks for the reply.  So I end up using concept convertor to make a back up and exported it to a usb thumb drive.  You can then use concept converter to import your backup.  Concept converter is a tool that comes with Concept 2.6 
  11. I have a 3 processors all Modicon 984 I would like to do a full back up of the 3 processors.  I am using concept 2.6.  Should i export via concept converter for all 3 processors. 
  12. So further research I have found someone made a minor change to a input well online but did not download to the processor.  So if I download from concept this should fix the error? or do you recommend I upload ?
  13. I have a ladder logic mismatch error on a modicon 984 using concept 2.6.  It also says not equal in right corner.  I am guessing it means the logic in the file doesnt match the processor?  Any easy fixes to this problem and is it a major problem?  
  14. I am doing maintenance on a older line and we have had a power failures and a instrument failed.  The instrument in question Micro motion corelios apparently this has happen before with another instrument on another power failure.  Anybody out there have any experiences like this and if you did any remedies
  15. Modicon 984

    Its A I believe  and to be honest it scares me haha.  That being said these things last!! 20 years no problems