multi_asc

Purpose:

Perform initialization and then loop forever, waiting on incoming events. When a start_event is received (a 10 sec timer), a command is sent to the to the ASC handler to call the response function to decode the variable value when the ASC handler replies.

Enter:

multi_asc <spec_filename>

Where:

spec_filename

Specify the specification filename.

Example:

multi_asc /specs/RMYoung.cic

In this example, the multiple input asc collector application, multi_asc uses the spec file named RMYoung.cic, located in the /specs/ folder. The content of the spec file is of the format shown here:

    ===================== START OF SAMPLE RMYoung.cic spec file ============
    # device name timer(sec)   priority  
      RTD_CIC       5              16  
 
    #having a negative number for timer will not send out events to the device  
 
    #Request String is the data that gets sent to the device  
 
    #Response tag is what is sent back by the ASC handler  
 
    #device name must correlate to a .cfg in the /specs directory. For example  
    #there is a file called /specs/RTD_CIC.cfg within the /specs directory.  
    #It must be in the specs directory and have a .cfg extension.  
 
    #Validity Label must be a logical if it is desired, use a ‘-‘ if you do not  
    #want a validity variable. If the validity count has been reached, it will  
    #set the validity label to false.  
 
    # Output  Request Response   Input  Lower Limit   Upper Limit  Val Validity  
    # Label    String   Tag      Units  value units   value units  Cnt  Label  
    rtd1          1    01:        deg_F    0 deg_F     300 deg_F     2   rtd1V  
    rtd2          2    02:        deg_F    0 deg_F     300 deg_F     2   rtd2V  
    #rtd3         3    03:        deg_F    0 deg_F     300 deg_F     2   rtd3V  
    ========================= END OF RMYoung.cic file =========================  
 
    The RMYoung.cic and the RTD_CIC can be found in the cyflex/specs.def/ directory  
    The spec file contains the device name, which references the name of the  
    configuration file (in this case RTD_CIC.cfg) located in the same folder,  
    which contains the actual name of the device to communicate with.  The  
    format of the configuration file can be found in the file /specs/RTD_CIC.cfg  
    The content of the configuration file(*.cfg) is of the format shown here:  
 
   ===================== START OF SAMPLE RTD_CIC.cfg file ===============  
   #  
   # Note: Non-printing characters ( i.e. control characters ) are  
   # represented by <XXX> where XXX represents the numonic for the  
   # control character ( i.e. CR for carriage return ) or a numeric  
   # value for the ASCII character in decimal ( i.e. 127 for delete ).  
   #  
   #—————————————————————-  
   #  
   # DEVICE NAME, BAUD RATE, BYTE_LENGTH, PARITY, STOP_BITS  
   #  
   # To set up the RM Young Weather Station  
   #  
   RMY, 9600, 8, none, 1  
   #  
   #—————————————————————-  
   #  
   # ACKNOWLEDGE CHARACTER  
   #  
   # This is often a single ( i.e. ACK ) or pair of characters (i.e. CRLF )  
   # that the field unit returns to acknowledge correct receipt of a command.  
   #  
   # -1 = none  
   #  
   -1  
   #  
   #—————————————————————-  
   #  
   # COMMAND MESSAGE STRUCTURE  
   #  
   # This section defines the message structure elements used to control  
   # the field unit.  
   #  
   #  
   # Header String  
   # -1 = none  
   -1  
   #  
   # Station/Unit Identifier  
   # -1 = none  
   -1  
   #  
   # Trailer String  
   # -1 = none  
   <CR><LF>  
   #  
   # Checksum method  
   # -1 = none  
   #  
   #  1 = CCITT excludes last character uses 0x1021 XOR  
   #  2 = truncated byte sum of all characters  
   #  3 = byte-wise XOR of all previous bytes in package,  
   #      result in 2 ASCII chars, always after message – pierburg smoke meter.  
   -1  
   #  
   # Structure  
   #  
   # This section shows the sequence of message elements  
   # H = header string  
   # S = station identifier  
   # M = message  
   # T = trailer string  
   # C = crc  
   #  
   MT  
   #  
   #——————————————————————  
   #  
   # RESPONSE MESSAGE STRUCTURE  
   #  
   # This section defines the response message structure elements from  
   # the field unit.  
   #  
   #  
   # Header String  
   # -1 = none  
   # STX = 02h = 02 dec  
   -1  
   #  
   # Station/Unit Identifier  
   # -1 = none  
   -1  
   #  
   # Trailer String  
   # -1 = none  
   <CR><LF>  
   #  
   # CRC method  
   #  
   # -1 = none  
   #  1 = CCITT excludes last character uses 0x1021 XOR  
   #  2 = truncated byte sum of all characters  
   #  3 = byte-wise XOR or all previous bytes in package  
   -1  
   #  
   # Structure  
   #  
   # This section shows the sequence of message elements  
   # H = header string  
   # S = station identifier  
   # M = message  
   # T = trailer string  
   # C = crc  
   #  
   MT  
   #  
   #—————————————————————–  
   #  
   # COMMAND TABLE  
   #  
   # This table contains expected commands from the client task.  
   #  
   # Each command contains the following information  
   #  
   #  Identifier string   – passed by the requestor  
   #  Message string      – sent when the identifier string is received  
   #  Response identifier – successful response expected (* for none)  
   #  Number of retries   – number of retries to attempt if response is not a  
   #                         success  
   #  Timeout             – time in seconds after command is sent for response  
   #  
   #  NOTE: %xyz represents a passed parameter  
   #        where x = number of places  
   #              y = type using C printf formats  
   #              z = parameter number  
   #        Each entry is completed with !  
   #        The table is completed with !!  
   #  
   #  
   1  
   1  
   WS:NOW %9s1  
   1  
   5  
   !  
   2  
   2  
   WS:1MN %9s1  
   1  
   5  
   !  
   3  
   3  
   WS:1HR %9s1  
   1  
   5  
   !  
   4  
   4  
   WS:MAX %9s1  
   1  
   5  
   !  
   5  
   5  
   WD:NOW %9s1  
   1  
   5  
   !  
   6  
   6  
   WD:1MN %9s1  
   1  
   5  
   !  
   7  
   7  
   WD:1HR %9s1  
   1  
   5  
   !  
   8  
   8  
   TF:NOW %9s1  
   1  
   5  
   !  
   9  
   9  
   PR:NOW %9s1  
   1  
   5  
   !  
   10  
   10  
   PR:LAS %9s1  
   1  
   5  
   !  
   11  
   11  
   PR:24H %9s1  
   1  
   5  
   !  
   !!  
   #  
   #—————————————————————–  
   #  
   # RESPONSE TABLE  
   #  
   # This table contains the unsolicited responses from the device  
   #  
   # Each response contains the following information  
   #  
   #  Message string    – received from the device  
   #  Identifier string – sent to the requestor  
   #  
   #  NOTE: %xyz represents a passed parameter  
   #        where x = number of places  
   #              y = type using C printf formats  
   #              z = parameter number  
   #        Each entry is completed with !  
   #        The table is completed with !!  
   #  
   %9s1  
   WS:NOW  
   !  
   %9s1  
   WS:1MN  
   !  
   %9s1  
   WS:1HR %9s1  
   !  
   %9s1  
   WS:MAX %9s1  
   !  
   %9s1  
   WD:NOW %9s1  
   !  
   %9s1  
   WD:1MN %9s1  
   !  
   %9s1  
   WD:1HR %9s1  
   !  
   %9s1  
   TF:NOW %9s1  
   !  
   %9s1  
   PR:NOW %9s1  
   !  
   %9s1  
   PR:LAS %9s1  
   !  
   %9s1  
   PR:24H %9s1  
   !  
   !!  
   #  
   # AUX EVENT TABLE  
   #  
   # This table contains the command(s) to perform upon receipt  
   # of a an asynchronous event.  
   #  
   # This table is only active if a aux name is specified  
   # with the invocation of this instance of ASC and if the table is not empty.  
   #  
   # Each command contains the following information  
   #  
   #  Message string    – sent when the identifier string is received  
   #  Respose string    – sucessful response expected  
   #  Number of retries – number of retries to attempt if response is not sucess  
   #  Timeout           – time in seconds after command is sent for response  
   #  
   #  NOTE: %xyz represents a passed parameter  
   #        where x = number of places  
   #              y = type using C printf formats  
   #              z = parameter number  
   #        Each entry is completed with !  
   #        The table is completed with !!  
   #  
   !!  
   #  
   #  
   ============ END OF RTD_CIC.cfg file =============

 

Notes:

 

See Also:

ASC