Hello everyone,
I having some troubles for reading the serial of a L32E. I'm good in php programming and I'm using a serial class for opening and reading the serial port (not the first time, in the past i was able to "talk" to some mcus and other serial devices with any issue). The idea is to make a web application for "real-time" graphing for EOL F-15 40% / 60% and saving the data to MySQL db. My problem is that I'm new to PLC and I do not have any idea about the string format of the data. Header + data + End ? The people that want the program set a dummy program into de PLC with a random value. I was able to use RSLinx to copy the link of the DDE/OPC using the Ethernet Interface to Excel. The url is something like Program:MainProgram.VARIABLE_1.ACC
I tried using the hyperterminal to read the serial port and I get nothing, I read about something ASCII mode but not sure about that.
They gave to me a visualbasic program with any comment in order to figureout and the part of the program have a function ProcessChar that it may be part of the decoding function.
In other words how do I read the variables from the serial?
Does anyone have any suggestion about how to read from the serial or any link for reference?
Thanks in advance
I having some troubles for reading the serial of a L32E. I'm good in php programming and I'm using a serial class for opening and reading the serial port (not the first time, in the past i was able to "talk" to some mcus and other serial devices with any issue). The idea is to make a web application for "real-time" graphing for EOL F-15 40% / 60% and saving the data to MySQL db. My problem is that I'm new to PLC and I do not have any idea about the string format of the data. Header + data + End ? The people that want the program set a dummy program into de PLC with a random value. I was able to use RSLinx to copy the link of the DDE/OPC using the Ethernet Interface to Excel. The url is something like Program:MainProgram.VARIABLE_1.ACC
I tried using the hyperterminal to read the serial port and I get nothing, I read about something ASCII mode but not sure about that.
They gave to me a visualbasic program with any comment in order to figureout and the part of the program have a function ProcessChar that it may be part of the decoding function.
Code:
Private Function ProcessChar(ByVal c As Byte) As Integer
If c > 47 And c < 58 Then 'Digit
token = token & ChrW(c)
Return 1
End If
If c = 46 Then ' Dot
token = token & ChrW(c)
Return 3
End If
If c = 45 Then ' Minus
token = token & ChrW(c)
Return 4
End If
If c > 64 And c < 91 Then 'Alpha upper
currentType = TokenType.Text
token = token & ChrW(c)
Return 2
End If
If c > 96 And c < 123 Then 'Alpha lower
currentType = TokenType.Text
token = token & ChrW(c)
Return 2
End If
Return 0
End Function
In other words how do I read the variables from the serial?
Does anyone have any suggestion about how to read from the serial or any link for reference?
Thanks in advance
Last edited: