Hello Everyone,
I have been testing my graph code using a timer on my development machine and it worked perfect.
I have since copied the code to the EthernetIPforCLXCom1.DataReceived event and i am getting strange results on a virtual machine.
(1) Does the EthernetIPforCLXCom1.DataReceived event fire only on the poll rate override interval of the driver, regardless of whether it is reading from 1 tag or 5 tags? i.e. will it fire once only for all 5 tags together, or will it fire 5 times one for each tag?
(2) I am experiencing weird behaviour using a virtual machine over a network - my code worked perfect locally using a timer to fire the plotting of the lines, but since i changed the plotting to the DataReceived event, weird stuff is happening that i can't explain - would you recommend using my analysis program for short term monitoring on a VM? It may very well be a bug in my code somewhere also, but it's pretty much the same code in the timer tick event as in the DataReceived event.
(3) See my 2 starred (*****) comments below in the code. Can you do this in each case:
Private Sub EthernetIPforCLXCom1_DataReceived(sender As Object, e As PlcComEventArgs) Handles EthernetIPforCLXCom1.DataReceived
If Recording Then
TimeNowAsDate = Now
Dim TimeNow As String = TimeNowAsDate.ToString("HH:mm:ss")
‘Currently reading value from SevenSegments
Chart1.Series(0).Points.AddXY(TimeNow, SevenSegment1.Value)
Chart1.Series(1).Points.AddXY(TimeNow, SevenSegment2.Value)
Chart1.Series(2).Points.AddXY(TimeNow, SevenSegment3.Value)
Chart1.Series(3).Points.AddXY(TimeNow, SevenSegment4.Value)
Chart1.Series(4).Points.AddXY(TimeNow, SevenSegment5.Value)
‘*****Can you do this, i.e. is e.values() an array?
Chart1.Series(0).Points.AddXY(TimeNow, e.values(0))
Chart1.Series(1).Points.AddXY(TimeNow, e.values(1))
Chart1.Series(2).Points.AddXY(TimeNow, e.values(2))
Chart1.Series(3).Points.AddXY(TimeNow, e.values(3))
Chart1.Series(4).Points.AddXY(TimeNow, e.values(4))
‘*****Or this?
Chart1.Series(0).Points.AddXY(TimeNow, EthernetIPforCLXCom1.Read(“Tag Address 1”))
Chart1.Series(1).Points.AddXY(TimeNow, EthernetIPforCLXCom1.Read(“Tag Address 2”))
Chart1.Series(2).Points.AddXY(TimeNow, EthernetIPforCLXCom1.Read(“Tag Address 3”))
Chart1.Series(3).Points.AddXY(TimeNow, EthernetIPforCLXCom1.Read(“Tag Address 4”))
Chart1.Series(4).Points.AddXY(TimeNow, EthernetIPforCLXCom1.Read(“Tag Address 5”))
End If
End Sub
Thanks Folks,
Regards,
Conor