string_to_data_event

	status.i4.v = string_to_data_event(string.i1a.r, data_event.s.r
					   [,allow_extended.i4.v])

	This routine converts a string to DATA_EVENT_DATA data event.

	string		data event string to convert
			(up to DATA_EVENT_MAX_LEN characters)

	The string format should be as follows:

	Clock Event: Request on Tevatron clock event
	"e,##,h,###"
	 ^ ^  ^ ^
	 | |  | |
	 | |  | |
	 | |  | delay (if software event) in milliseconds
	 | |  h = hardware event, s = software event, e = either soft or hard 
	 | clock event number in hex
	 Clock Event

	Example:
	  For Tevatron clock event $29 with a 1 second delay
	  "e,29,s,1000"

	Default Event: "u"

	Once Immediate: "i"

	Periodic Event: Request at a specific time interval
	"p,delay,true"
	 ^ ^     ^ 
	 | |     | 
	 | |     |
	 | |     immediate notification flag (true,false)
	 | delay in milliseconds between consecutive notifications
	 periodic request

	Example:
	  For a periodic event with a 1 second delay and immediate notification
	  "p,1000,true"

	State Event: Request upon a state transition
	"s,DI,value,###,flags (=, !=, *, <, <=, >, >=)"
	 ^ ^  ^     ^   ^
	 | |  |     |   |
	 | |  |     |   special flags
	 | |  |     delay in milliseconds
	 | |  special state value for notification
	 | State Event device index or name
	 State Event

	Example:
	  For a State Event using device V:ALIVE with a 100
	  millisecond delay after the event.
	  "s,v:alive,0,100,*"

	Snap Event: Request upon a snapshot
	"f,type=snp,rate=ddd,dur=fffff,npts=dddd,pref=sss,smpl=s;"
	 ^ ^    ^   ^    ^   ^   ^     ^    ^    ^    ^   ^    ^
	 | |    |   |    |   |   |     |    |    |    |   |    |
	 | |    |   |    |   |   |     |    |    |    |   |    e- sample on evt
	 | |    |   |    |   |   |     |    |    |    |   |    (e,{upto 4 comma
	 | |    |   |    |   |   |     |    |    |    |   |    separated evts},
	 | |    |   |    |   |   |     |    |    |    |   |    {delay})
	 | |    |   |    |   |   |     |    |    |    |   |    (ex. e,02,10,0)
	 | |    |   |    |   |   |     |    |    |    |   |    p- sample 
	 | |    |   |    |   |   |     |    |    |    |   |       periodically
	 | |    |   |    |   |   |     |    |    |    |   |    (ex. p)
	 | |    |   |    |   |   |     |    |    |    |   |    x- sample on
	 | |    |   |    |   |   |     |    |    |    |   |    external source
	 | |    |   |    |   |   |     |    |    |    |   |    (ex. x,mod=1)
	 | |    |   |    |   |   |     |    |    |    |   |
	 | |    |   |    |   |   |     |    |    |    |   sample type (string)
	 | |    |   |    |   |   |     |    |    |    rate- rate preferred   
	 | |    |   |    |   |   |     |    |    |    dur - duration preferred
	 | |    |   |    |   |   |     |    |    |    both- honor both rate
	 | |    |   |    |   |   |     |    |    |          and duration
	 | |    |   |    |   |   |     |    |    plot preference (string)
	 | |    |   |    |   |   |     |    (integer)
	 | |    |   |    |   |   |     number of points        
	 | |    |   |    |   |   (floating point)
	 | |    |   |    |   plot duration     
	 | |    |   |    (integer)
	 | |    |   plot rate    
	 | |    snapshot (only one for now)
	 | plot type
	 |
	 first character indicating FTP/SNP
	(ex. f,type=snp,rate=1000,dur=2.48,npts=2048,pref=rate,smpl=e,02,10,0;)

	"trig=string;"
	 |    |
	 |    e- trigger on event (up to 8)
	 |       (e,{up to 8 comma separated events},{delay})
	 |       (ex. e,02,10,0)
	 |    s- trigger on state (standard state event)
	 |    d- trigger on device reading
	 |       (d,{device},mask=xx,val=xxxxxxxx,dly=dd)
	 |       (ex. d,t:fweaam>3,mask=0,val=20,dly=100)
	 |       (Note: mask may be optional;mask and val is in hex,
	 |	 dly in decimal)
	 |
	 trig specifier (string)    
	(ex. trig=d,t:fweaam>3,mask=0,val=20,dly=100;)

	"rearm=logical,dly=string,nmhr=dd"
	 |     |       |   |      |    |
	 |     |       |   |      |    integer
	 |     |       |   |      number/hour
	 |     |       |   (periodic, event, or state data event string) 
	 |     |       delay
	 |     (true or false)
	 rearm flag 
	(ex. rearm=true,dly=p,360000,false,nmhr=3)

       Total example of snapshot data event:
	"f,type=snp,rate=1000,dur=2.48,npts=2048,pref=rate,smpl=e,02,10,0;\
	trig=d,t:fweaam>3,mask=0,val=20,dly=100;\
	rearm=true,dly=p,360000,false,nmhr=3"

	FTP Event: Request upon a fast time plot
	"f,type=ftp,rate=fff,dur=fffff,smpl=s;"
	 ^ ^    ^   ^    ^   ^   ^     ^    ^ 
	 | |    |   |    |   |   |     |    |
	 | |    |   |    |   |   |     |    e- sample on evt
	 | |    |   |    |   |   |     |       (e,{upto 4 comma separated evts},
	 | |    |   |    |   |   |     |       {delay})
	 | |    |   |    |   |   |     |       (ex. e,02,10,0)
	 | |    |   |    |   |   |     |        
	 | |    |   |    |   |   |     |    p- sample periodically
	 | |    |   |    |   |   |     |       (ex. p)
	 | |    |   |    |   |   |     |      
	 | |    |   |    |   |   |     |    x- sample on external source
	 | |    |   |    |   |   |     |       (ex. x,mod=1)
	 | |    |   |    |   |   |     |    
	 | |    |   |    |   |   |     |
	 | |    |   |    |   |   |     |
	 | |    |   |    |   |   |     sample type (string)
	 | |    |   |    |   |   |     
	 | |    |   |    |   |   |     
	 | |    |   |    |   |   |     
	 | |    |   |    |   |   |     
	 | |    |   |    |   |   |     
	 | |    |   |    |   |   |     
	 | |    |   |    |   |   (floating point)
	 | |    |   |    |   plot duration     
	 | |    |   |    (double)
	 | |    |   plot rate    
	 | |    fast time plot 
	 | plot type
	 |
	 first character indicating FTP/SNP
	(ex. f,type=ftp,rate=1000.00,dur=2.48,smpl=e,02,10,0;)

	"trig=string;"
	 |    |
	 |    e- trigger on event (up to 8)
	 |       (e,{up to 8 comma separated events},{delay})
	 |       (ex. e,02,10,0)
	 |    s- trigger on state (standard state event)
	 |    d- trigger on device reading
	 |       (d,{device},mask=xx,val=xxxxxxxx,dly=dd)
	 |       (ex. d,t:fweaam>3,mask=0,val=20,dly=100)
	 |       (Note: mask may be optional;mask and val is in hex,
	 |	 dly in decimal)
	 |
	 trig specifier (string)    
	(ex. trig=d,t:fweaam>3,mask=0,val=20,dly=100;)

	"rearm=logical,dly=string,nmhr=dd"
	 |     |       |   |      |    |
	 |     |       |   |      |    integer
	 |     |       |   |      number/hour
	 |     |       |   (periodic, event, or state data event string) 
	 |     |       delay
	 |     (true or false)
	 rearm flag 
	(ex. rearm=true,dly=p,360000,false,nmhr=3)

       Total example of ftp data event:
	"f,type=ftp,rate=1000.00,dur=2.48,smpl=e,02,10,0;\
	trig=d,t:fweaam>3,mask=0,val=20,dly=100;\
	rearm=true,dly=p,360000,false,nmhr=3"

	Client event: "client[_{node}]"

vvvvvvvvvvvvvvvvvvvvvvv extended data events vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

	Alarm Event: Request on the occurrence of an alarm
	"a,d:dddddd,a,b,###"
	 ^    ^     ^ ^  ^
        |    |     | |  |
        |    |     | |  delay in milliseconds
        |    |     | |
        |    |     | b=bad, g=good, e=either
        |    |     |
        |    |     a=analog, d=digital, *=any
        |    |
        |    alarm device
        |
	 alarm request

	Example:
	  For monitoring an alarm from M:OUTTMP
	  "a,M:OUTTMP,a,b,0"

	Alarm Bypass Event: Request on the bypassing or enabling of an alarm
	"bypass,d:dddddd,a,b,###"
	 ^         ^     ^ ^  ^
        |         |     | |  |
        |         |     | |  delay in milliseconds
        |         |     | |
        |         |     | b=bypassed, e=enabled, *=either
        |         |     |
        |         |     a=analog, d=digital
        |         |
        |         alarm device
        |
	 alarm bypass

	Example:
	  For monitoring M:OUTTMP's alarm being bypassed
	  "bypass,M:OUTTMP,a,b,0"

	Time of Day Event: Request on the occurrence of a specific time of day
	"tod,hh:mm:ss,false"
	  ^     ^       ^
         |     |       |
         |     |       false=repetitive, true=do once
         |     |
         |     time of day
         |
         time of day

	Example:
	  For requesting noon
	  "t,12:00:00,false"

	Setting Event: Request on the occurrence of a device setting
	"setting,d:dddddd,s,###"
	    ^       ^     ^  ^
           |       |     |  |
           |       |     |  delay in milliseconds
           |       |     |
           |       |     s=setting, c=control, a=analog alarm, d=digital, *=any
           |       |
           |       setting device
           |
	    setting request

	Example:
	  For monitoring a setting of Z:ACLTST
	  "setting,Z:ACLTST,s,0"

	Dbnews Event: Request on the occurrence of a device database modification
	"dbnews,d:dddddd,mmm,###"
	   ^       ^      ^   ^
          |       |      |   |
          |       |      |   delay in milliseconds
          |       |      |
          |       |      modification type (* (all),scaling,struct,...)
          |       |
          |       modified device or * for all modified devices
          |
	   device database modification

	Example:
	  For monitoring a database modification of Z:ACLTST
	  "dbnews,Z:ACLTST,*,0"

	Date Event: Request on a specific date
	"date,dd-mmm-yyyy hh:mm:ss"
	  ^            ^
         |            |
         |            |
         |            |
         |            date value
         |
         date

	Example:
	  For requesting September 16, 2014 12:00
	  "date,16-Sep-2014 12:00:00"

	data_event	returned data event structure
			(structure of type DATA_EVENT_DATA)
	[allow_extended] flag indicating whether or not allow extended
			 data event strings
			 (TRUE -> allow extended data event strings
				  (Note: Extended data events are currently
				   only supported by higher level software,
				   not by front ends.),
			  FALSE -> don't allow extended data event strings
				   (default))

	This function returns ACNET status values as follows:

	OK			successful conversion
	CLIB_INVARG		invalid data event string

	This function requires the following include files:

	cbslib_h, cns_data_structs_h, clib_h, tclk_events_h, acnet_errors_h

	Related functions:

	data_event_to_string, numeric_to_ascii(_c), ascii_to_numeric(_c),
	data_event_string_to_ftd, data_event_to_ftd, ftd_to_data_event_c,
	ftd_to_data_event_string_c, clib_sprintf, clib_sscanf,
	window_display_value_c, window_input_value_c, winput(_c),
	input_array_values_c, array_edit_c

	C/C++ usage:

	static const char	string[] = "e,29,s,1000";
	int	status;
	int	allow_extended = FALSE;
	DATA_EVENT_DATA data_event;

	status = string_to_data_event(string,&data_event,allow_extended);

	data_event will be filled out as follows for a clock event:
	data_event.event_type <-- DATA_EVENT_TYPE_CLOCK;
	data_event.num_terms <-- 1;
	data_event.terms[0].data.clock_event.clock_type <-- CLOCK_TCLK; 
	data_event.terms[0].data.clock_event.event_number <-- 0x29;
	data_event.terms[0].data.clock_event.detection_type <-- 
    					DATA_EVENT_SOFT_CLOCK_EVENT;
	data_event.terms[0].data.clock_event.delay <-- 1000;