get_asc

Purpose:

Communicate with an intelligent instrument which meets the following requirements:
1) There is a single type of response message from the instrument which needs to be placed into an CyFlex variable.
2) The response may be either a continuous broadcast or it may be a response to a command.
2a) If the response is to a ‘get’ command, the command must be timer-driven.
3) An optional ‘set’ command may be issued to the device. The ‘set’ command must be event driven and the value must come from a specified CyFlex real variable. An “ASC” configuration file must be built which defines the communication protocol and the command and response formats.

Enter:

get_asc <device> <output_label> <timer> <valid_label> <valid_count> [set_label] <evnt> &

Where:

device

Specify the root name of the device configuration file which must be located in the /specs directory and must have the ‘.cfg’ extender example: abc.cfg
(‘abc’ is the device).

output_label

Specify the variable where the response result value will be placed. It can be a real, integer, or a string variable

timer

Specify the value in milliseconds of a timer or a ‘-‘ (dash) if no ‘get’ command is required. Use the dash  if the device broadcasts continuously.

valid_label

Specify the CyFlex logical variable label which indicates that the response is valid.

valid_count

Specify an interval count for validity.

set_label

Optional. Specify the label of an CyFlex real variable whose value will be sent to the device as part of the ‘set’ operation.

evnt

Specify the event to trigger the ‘set’ operation. This event will be created by get_asc if it does not exist.

Example:

get_asc DW DW_temp – DW_valid 5 DW_set DW_setev &
This example is for a device called “DW” which broadcasts a temperature value. The temperature value will be placed in the variable ‘DW_temp’ whenever it is received. The DW_valid flag will remain TRUE unless no broadcast value is received for 5 seconds. If the ‘DW_setev’ event is received, the value of the DW_set variable will be sent to the DW device. See cyflex/specs.def/DW.cfg for the corresponding example configuration file.

Notes:

 

See Also: