Archie/Godra,
In my test for OPC I got now data coming, it is a very simple test, just two BasicLabel, one Barlevel, one label to see when the Timer occurs and one ProgressBarEx that need to be handle manually.
This is the code, with some MsgBox for my test:
Imports System.IO 'System library to import so StreamReader could be use
Public Class test
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
OpcDaCom1.BeginRead("M20943_A1_Scaled_Value", 1)
Label1.Text = Now
End Sub
Private Sub OpcDaCom1_DataReceived(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles OpcDaCom1.DataReceived
If e.ErrorId <> 0 Then ' no good data received.
MsgBox(e.ErrorId)
Exit Sub
End If
MsgBox(e.Values(0))
ProgressBarEx1.Value = CInt(e.Values(0))
End Sub
Private Sub test_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Now for some reason the BeginRead command is giving me the error “Parameter count mismatch.” Then if I change the # of elements of the BeginRead to 2 the error goes away but the DataReceived event never gets trigger, I also try with a OpcDaCom1.read but it also is giving me error.
Once again thank you guys