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.


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



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).


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


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.


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


Specify an interval count for validity.


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


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


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.



See Also: