AdvancedHMI Software
General Category => Support Questions => Topic started by: kyleriege on November 19, 2019, 06:46:18 PM
-
Can I 'trick' the data logger into believing there is a successful subscription the the PLC so that I can troubleshoot without being next to the PLC?
-
Is there a simulator you could possibly use instead (what PLC are you connecting to)?
-
I can look into that. I am using a AB ControlLogix
-
If you have emulate you can create a topic in Linx and use OPC driver to test. I find this clunky but doable if you don't have a PLC.
-
Unfortunately I am new to this, and don't really understand what a 'topic in linx' is or an OPC driver. Do you have a link to another forum thread, or a writeup that goes into more detail on that?
-
Since you are new it's best to start this post over again. What exactly are you wanting to test without a PLC? If you plop buttons on a form and want to see those work, you need something to talk to, whether it's a PLC or simulator. Being new, you NEED a PLC. If you are wanting to test code, there are ways, but you have to be specific as Archie turned off ESP mode on this forum.
-
Specifically, I am trying to troubleshoot the DataLogging Functionality, and the creation of the file. I am using DataLogger2.
I have found where the file is created, and modified it slightly to write a header row based on the PLCAddressValueItems Collection. I have to create two datalog files as I have two PLCs I am connecting to, and I cannot figure out how to merge them - a problem for another time. I have added controls on my main HMI screen to update the Log Interval and Save Path for the log files, and that is what I want to test.
I basically want the datalogger to think it has connected to a PLC so that it creates the log files.
'* When the subscription with the PLC succeeded, setup for logging
Protected Overrides Sub OnSuccessfulSubscription(e As MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs)
MyBase.OnSuccessfulSubscription(e)
'* create the timer to log the data
If m_LogTriggerType = TriggerType.TimeInterval Then
If LogTimer Is Nothing Then
LogTimer = New Timer
If m_LogInterval > 0 Then
LogTimer.Interval = m_LogInterval
Else
LogTimer.Interval = 1000
End If
AddHandler LogTimer.Tick, AddressOf LogInterval_Tick
LogTimer.Enabled = True
End If
End If
'* Create the file for logging data
Try
If sw Is Nothing Then
sw = New System.IO.StreamWriter(m_FileFolder & "\" & m_FileName, True)
'sw.WriteLine("TIME, KW, KVAR, VAB, VBC, VCA, IA, IB, IC, HZ, ") 'write header column
Try
Dim StringToWrite As String = m_Prefix
If m_TimeStampFormat IsNot Nothing AndAlso (String.Compare(m_TimeStampFormat, "") <> 0) Then StringToWrite &= Date.Now.ToString(m_TimeStampFormat)
For Each item In PLCAddressValueItems
StringToWrite &= "," & item.Name
Next
sw.WriteLine(StringToWrite)
sw.Flush()
Catch ex As Exception
End Try
End If
Catch ex As Exception
OnComError(New MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs(-101, ex.Message))
End Try
End Sub
-
Since that's all you want to do, here is what you can try:
1) Consider using updated BasiDataLogger2 from this topic:
https://www.advancedhmi.com/forum/index.php?topic=2519.0
2) Download MODRSsim2 simulator from the Internet or possibly use the one from this topic:
https://www.advancedhmi.com/forum/index.php?topic=765.msg15122#msg15122
3) Use a fresh AdvancedHMI project, add a ModbusTCP driver and set its IPAddress to 127.0.0.1, add a BasiDataLogger2 and set the logging options as you wish and also add a few BasicLabel controls which you can point to Modbus addresses like 00001, 00002, 40001, 40002 ... (put the same address in PLCAddressValue and PLCAddressKeypad)
4) Start the simulator and make sure it is using TCP connection and then start the AHMI.
The simulator will allow you to change values just by clicking the BasicLabel controls and using the keypad.
-
Thank you for your help!