AdvancedHMI Software
General Category => Open Discussion => Topic started by: dcapps4140 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
-
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.
-
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
-
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.
-
Thanks for the help, it is appreciated!