This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = msg.payload.value/10 | |
if (a > 31.0) | |
{ | |
msg.payload.alarm = 1; | |
} | |
else | |
{ | |
msg.payload.alarm = 0; | |
} | |
return msg; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var a = msg.payload.value/10; | |
if (msg.payload.alarm == 1) | |
{ | |
msg.payload.text = "Critical Temperature Reached: " + a + "°C" | |
} | |
else | |
{ | |
msg.payload.text = "Critical Temperature Reduced: " + a + "°C" | |
} | |
msg.payload = msg.payload.text; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF #ControlValve1_Closed = true OR #ControlValve1_Open = False THEN | |
#Pump_Start := False; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF #ControlValve1_Closed = false AND #ControlValve1_Open = True THEN | |
#Pump_Start := True; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF #ControlValve1_Closed = false AND #ControlValve1_Open = True THEN | |
#Pump_Start := True; | |
ELSIF #ControlValve1_Closed = true OR #ControlValve1_Open = False THEN | |
#Pump_Start := False; | |
END_IF; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* This routine will start the pump when the control valve is open and stop the pump when the control valve is closed or not open*) | |
IF #ControlValve1_Closed = false AND #ControlValve1_Open = True THEN | |
#Pump_Start := True; | |
ELSIF #ControlValve1_Closed = true OR #ControlValve1_Open = False THEN | |
#Pump_Start := False; | |
END_IF; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Button2_Click() | |
rslinx = OpenRSlinx() | |
'Loop through reading the CLX Studio PLC array and put the values in the excel cells | |
'Cells(2, 1) = DDERequest(rslinx, "Real_array[0]") 'sample | |
'Cells(3, 1) = DDERequest(rslinx, "DINT_array[0]") 'sample | |
For i = 0 To 9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Button2_Click() | |
rslinx = OpenRSlinx() | |
'Loop through reading the CLX Studio PLC array and put the values in the excel cells | |
'Cells(2, 1) = DDERequest(rslinx, "Real_array[0]") 'sample | |
'Cells(3, 1) = DDERequest(rslinx, "DINT_array[0]") 'sample | |
For i = 0 To 9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub Button1_Click() | |
rslinx = OpenRSlinx() | |
'Loop through reading the CLX Studio PLC array and put the values in the excel cells | |
'DDEPoke rslinx, "DINT_array[0]", Cells(2, 8) | |
For i = 0 To 9 | |
If TypeName(Data) = "Error" Then | |
If MsgBox("Error reading tag Real_array[" & i & "]. " & _ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function OpenRSlinx() | |
On Error Resume Next | |
'Open the connection to RSLinx | |
OpenRSlinx = DDEInitiate("RSLinx", "RealParsExcel") | |
'Check to see if connection was opened | |
If Err.Number <> 0 Then | |
MsgBox "Error Connecting to topic", vbaExclamation, "Error" |
NewerOlder