Monitor Pro (Factorylink) 'Forced Write' from VB

B

Thread Starter

Buzby

Hello,

Is there a way to implement the same functionality as the IML '==' operator, but from a VB script in the client project?

Why? The Alarms system can 'hide' alarms. The alarms are hidden from the CB Active-X, but are still logged to the SQL. This is exactly what we need, so far.

However, if the tag that causes the alarm is ON at the time the alarm is 'un-hidden', the Active-X does not see this.

I think this is because the change flags have been reset when the SQL log takes place, so when the alarm is un-hidden there is no refreshing of the Active-X.

My proposed solution is to do a 'Forced Write' on the tag related to the alarm which I've just un-hidden. This will hopefully cause the alarm server to refresh the Active-X.

Thanks.
 
G

Gustavo A. Valero P.

Hi friend,

In VBA, the same "=" operator carries out a Force operation always. e.g:

Do this in VBA:
[OPCCluster:MyDigTag] = 1
[OPCCluster:MyAnaTag] = 20

has the same result in M&L:

MyDigTag == 1
MyAnaTag == 20

Regarding alarms, if I undestood well your idea, you just need a trick to these aren't visible but still are logged to your DB:

Use the Alarm Hide Tag associated to any alarm and set it to a value of 2 ("Log to database, but do not put in active alarm list"). Of course, the Alarm Hide Tag must be an analog tag so you can set it to a value of 2.

With this, your FactoryLink clients will never see these alarms because of the alarm server will never report them.

I hope it helps you!

Regards.

Saludos

Gustavo A. Valero P.
BIConsulting C.A.
Valencia - Venezuela
gustavo. valero @ biconsulting. com
 
Hi Gustavo,

Thanks for that info.

I tried it.

Writing the same value repeatedly to a variable in VB sets the change flags!

This is not something I would expect to see.

I assumed that tags written by OPC would not set the change flags if there was no change in the value of the tag.

It also happens from the Bit Send animation in CB. ( Try it. Setup a few buttons all the same, with BitSend=1 to MyTag for the action. An IML proc counting from ?MyTag will show that the change flags are set each time a button is pressed, even though the tag does not change value.)

(It did not solve my problem, but that's a different story.)

Thanks again,

Buzby
 
Hi Gustavo,

Sorry, I forgot to reply about the alarms problem.

Yes, setting HIDE to 2 causes logging with no display. I have this working OK.

The problem occurs if an alarm condition exists at the time of un-hiding.

When this happens the alarm does not re-appear in the alarm list. The alarm condition exists, but the user can't see it.

I think this is a bug.

If you try with HIDE=1 the behaviour is as would be expected. Un-hiding an alarm causes it to show in the list.

Thanks again,

Buzby
 
Top