Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - hayen

Pages: [1]
1
Support Questions / Re: write CLX tag from BasicDataLogger2
« on: December 08, 2022, 11:41:00 AM »
I had missed the "PLC related properties" region...
Thanks again for your help and also for this project.

2
Support Questions / Re: write CLX tag from BasicDataLogger2
« on: December 08, 2022, 11:32:20 AM »
That will compile.
Many thanks!

I was searching for such a property before posting and was unable to find it.
Where is it defined?

3
Support Questions / Re: write CLX tag from BasicDataLogger2
« on: December 08, 2022, 11:04:51 AM »
Archie,

I can see the m_ComComponent variable being used in the "DataSubscriber2" class and the "Datalogger2" inherits from it.
I assume it depend s on the following: "Imports System.ComponentModel" at the top of the "DataSubsriber2" class.

Below is what I have in the "Datalogger2" class, with the write statement below the comment   ' set the read flag complete on the PLC tag

Code: [Select]
Private Sub StoreValue()
        Try
            If Not m_PauseLogging Then
                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
                    If item.ScaleFactor = 1 Then
                        StringToWrite &= "," & item.LastValue '& item.Name & ":"
                    Else
                        Try
                            StringToWrite &= "," & item.LastValue * item.ScaleFactor ' & item.Name & ":"
                        Catch ex As Exception
                            StringToWrite &= "," & "INVALID-Check scale factor-" & item.LastValue
                        End Try
                    End If
                Next
                sw.WriteLine(StringToWrite)
                sw.Flush()
                ' set the read flag complete on the PLC tag
                If m_ComComponent IsNot Nothing Then
                    'MainForm.EthernetIPforCLXCom1.Write("EventReadConfirmation", "1")
                    'm_CommComponent.Write("EventReadConfirmation", "1")
                    m_ComComponent.Write("EventReadConfirmation", "1")
                End If
            End If
        Catch ex As Exception
        End Try
    End Sub

The "m_ComComponent" generates the following ompile error:
'AdvancedHMIControls.DataSubsriber2.m_ComComponent' is not accessible in this context because it is private

4
Support Questions / Re: write CLX tag from BasicDataLogger2
« on: December 08, 2022, 05:20:38 AM »
Hi Archie,
I did try lowering the polling rate, this was not sufficent to reliably capture the targetted events.
In particular, one of of them is an immediate output that stays on for a single scan time.
I sould add that the network load will increase with an upcoming project as different modules will become interconnected.

What I am looking for is a way to access the  EthernetIPforCLXCom component (placed on the main form as "EthernetIPforCLXCom1" from outside the main form (in this case either the datalogger2 of a function called from the datalogger2), in order to excecute the following write:
EthernetIPforCLXCom1.Write("EventReadConfirmation", "1").

Regards,

5
Support Questions / write CLX tag from BasicDataLogger2
« on: December 07, 2022, 06:00:29 AM »
I have been testing the software for logging events from a CLX PLC.
It works ell enough, but some of the targeted events are too quick to be captured.
I have setup buffering on the PLC side using FiFo instructions, and I am looking for a way to set a flag on the PLC after each logging event. This flag will allow the PLC to extract a buffered event and make it available for data polling.

I was thinking of setting up a public event on the main form and add an event trigger from the BasicDataLogger2.
(The trigger would be inserted in the "StoreValue" method below.
Is there a simpler method that I am missing?

Code: [Select]
Private Sub StoreValue()
        Try
            If Not m_PauseLogging Then
                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
                    If item.ScaleFactor = 1 Then
                        StringToWrite &= "," & item.LastValue '& item.Name & ":"
                    Else
                        Try
                            StringToWrite &= "," & item.LastValue * item.ScaleFactor ' & item.Name & ":"
                        Catch ex As Exception
                            StringToWrite &= "," & "INVALID-Check scale factor-" & item.LastValue
                        End Try
                    End If
                Next
                sw.WriteLine(StringToWrite)
                sw.Flush()
                ' set the read flag complete on the PLC tag

            End If
        Catch ex As Exception
        End Try
    End Sub

Pages: [1]