DOT-MATRIX PRINTER / ALARMS

Hello to all,

I want to pass to a dot-matrix printer, in every change of a alarm. for example, when it gets active, when acknowledged and when normalized, needs to sent to a dot-matrix printer, which will record the change of alarm state.

I have used the print functions inside alarm/event object but this functions prints all the alarms are in the object at the time toggling the function.

Is this possible? Can I have some help?

Elias Doukas
  • Hi Elia
    You are describing 2 different problems
    The first problem is how to print line by line in a DM printer.
    Here is an example code in VB:
    Sub PrintAlarmActive(strmessage)
    Dim objFS, objWSHNet, objPrinter
    Set objFS = CreateObject("Scripting.FileSystemObject")
    Set objWSHNet = CreateObject("WScript.Network")
    ' Open Print device as a file using the File System Object
    Set objPrinter = objFS.CreateTextFile("LPT1:", True)
    ' Send text to print device using the File System Object
    objPrinter.Writeline(strMessage)
    ' Close the print device object and trap for errors
    On Error Resume Next
    objPrinter.Close
    objWSHNet=nothing
    objFS=nothing
    EndSub

    The second problem is how to raise the event of the recent alarm - acknowlegment etc
    I would stored the alarm log in an SQL related database and:
    1. Quering the database every 10 seconds for changes (or making a script to identify the tag->AlrStatus, ->Ack, UnAck properties and finaly pass it to the scheduler for quering the database)
    2. Pass the needed data from the new record in the subroutine above