FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

OPC and Field Point communication failure detection, Help

I use Field Point modules and Visual Measurement Tools For Visual Basic.
I use the binding property of Component Works Button tool to read and write to the differents I/O modules. The watchdogs are enabled on the Field Point Communication module FP-1001 (PowerUp and Network).

I want to know how to detect that a communication failure has occured.

Both PowerUp and Network watchdog works fine, but i want to detect the communication failure between the PC and the FP-1001, because some buttons after the communication failure do not reflect the real value.

Since in my program, i read at each second some I/O points, i have used the CWBinding.LastMessage to monitor the reading.
The message for a normal readin
g is = Active: Connected to OPC Server
While the communication cable is not connected or the FP-1001 is not energized the message is = Active: Can't read data.

Is there a more elegant way to detect the communication failure ?

Thanks,

Jacques
0 Kudos
Message 1 of 2
(3,387 Views)
Jacques,

Your method of checking for communication failure will certainly work. There are also a few other options that will give you the status of the connection, but the actual error message is stored in the CWBinding.LastMessage field anyway.

I posted some example code that shows one of the best ways to check for errors. If you have Measurement Studio 6.0, the Measurement Studio Reference has good documentation on what properties of the Binding method have error conditions

Example Code:
'Display the current status in the form
'[status:error] Message

'Create a reference to a CWBinding object
'on CWGraph1
Dim Binding As CWBinding
Set Binding = CWGraph1.CWBindings.Item(1)

Dim str As String
If (Binding.StatusUpdated) Then
str = "[" & CW
Binding.Status & ":" & _
CWBinding.LastError & "]" & _
CWBinding.LastMessage
MsgBox str
End If

Hope that helps!
Shannon Rariden
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,387 Views)