Author Topic: Writing app to trooubleshoot machine issue, need help/ideas.  (Read 105 times)

dcapps4140

  • Newbie
  • *
  • Posts: 5
    • View Profile
Writing app to trooubleshoot machine issue, need help/ideas.
« on: October 09, 2017, 02:04:30 AM »
AdvancedHMI is awesome!

I have an older machine that is experiencing an issue at random times for no clear reason.

There are three carts that must move in sequence with each other, positioning is tracked via proximity switch.

The carts will, without warning, lose position and crash into each other. The frequency is random as well, from not at all to a couple times an hour.

So far we have identified no problem that will stop the issue from occurring.

There is no error log on the machine, and even if there was the error message are too vague to amount to much.

Motor drives check out fine. Visual inspection of wiring uncovers no problems. Any mechanical issue related to the carts has been corrected. Validation of prox adjustments found no problems.

At this point I am stumped. I feel like it is either a short in a wire or a timing issue. So, I am writing an app to track the prox activation's vs time. There are 24 prox switches of immediate interest and 32 of secondary interest, plus some other braking and drive functions I would like to keep track of vs time.

A simple datalog that I can then import into excel for analysis is my goal.

The processor is an SLC5/04 and its RS232 port is in use. I have the DH+ and DF1 port available. I also have a card, Prosoft I think, to convert from DH+ to Ethernet.

With about 75 values I need to get out of the processor, what is the best route to take? I have been looking at the simple datalog example and like the concept, just not sure how to apply it to the SLC. Would I use the bit address in place of the tagname when writing data to the file? Should I use a ...? A little prod in the right direction would be great!

TIA!

I am fairly familiar with VB having used it off and on for years. Most of my AdvancedHMI is on compact logic processors though.

DC
It is not necessary to change. Survival is not mandatory. WE Deming

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 3585
    • View Profile
    • AdvancedHMI
Re: Writing app to trooubleshoot machine issue, need help/ideas.
« Reply #1 on: October 09, 2017, 07:52:05 AM »
If you have a DH+ to Ethernet converter, you should be able to use the EthernetIPtoDHRIOforSLCMicroCom which will give you better speed than DF1. For addressing, you can use the same addressing as you would in the PLC program, such as N7:0, B3/0, T4:0.ACC, etc. One thing to note is the latest version of AdvancedHMI has a known issue with directly reading IO from a SLC. If you need to watch IO points, you will need to move them to a register such as N7:0 then read that register with AdvancedHMI.

dcapps4140

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Writing app to trooubleshoot machine issue, need help/ideas.
« Reply #2 on: October 09, 2017, 12:13:51 PM »
So, taking this code:

"""
    Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
        '* Retreive the value from the PLC
        Dim Value1 As String
        Try
            Value1 = EthernetIPforCLXCom1.Read("MyTag")
        Catch ex As Exception
            MsgBox("Failed to read")
            Exit Sub
        End Try

        '* Create a file writer that will append
        Using sw As New System.IO.StreamWriter("LogFile.txt", True)
            '* Write the data with a time stamp
            sw.WriteLine(Now & " - " & Value1)

            sw.Close()
        End Using
    End Sub
"""
I would edit this line - Value1 = EthernetIPforCLXCom1.Read("MyTag") - with the proper driver name and use the (bit address) instead of ("MyTag")?
-or-
I would edit this line - Value1 = EthernetIPforCLXCom1.Read("MyTag") - with the proper driver name and use the ("bit address") instead of ("MyTag")?

DC
It is not necessary to change. Survival is not mandatory. WE Deming

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 3585
    • View Profile
    • AdvancedHMI
Re: Writing app to trooubleshoot machine issue, need help/ideas.
« Reply #3 on: October 09, 2017, 02:25:28 PM »
The address is a string, therefore will need to be enclosed in quotes.

If you are only logging to a text file, the BasicDataLogger could save you the need of writing code.

dcapps4140

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Writing app to trooubleshoot machine issue, need help/ideas.
« Reply #4 on: October 10, 2017, 08:46:53 AM »
Thanks for the help, it is appreciated!
It is not necessary to change. Survival is not mandatory. WE Deming