AMX I!-SCHEDULE Instruction Manual page 9

Integration!solutions
Table of Contents

Advertisement

how is the distinction made between event 14 and the next event, 15 (they don't do the same thing
right?). One word: Event Parameters.
Event parameters provide a way to allow dynamic events to be added and deleted during run-time.
The Send_Command to the scheduling virtual device allows you to add and delete events while
i!-Schedule is running. Parameters will allow you to add additional information to each event to be
stored by i!-Schedule and recalled at the time the event is fired.
Let's take a simple example: a VCR record timer. Now let's make it a bit more complicated: How
about a VCR record timer for 5 VCRs. Now, to program this in NetLinx is pretty easy, if you know
the VCR number and the channel number the user whishes to record. Consider this code:
BUTTON_EVENT[dcVCRRecordEvents]
{
PUSH:
{
(* Assume we are able to obtain the VCR Number and the Channel Number *)
(* And we store them in nVCRNumber and nChannelNumber *)
Switch (nVCRNumber)
{
}
Send_Command dvVCRDev,"'CH',ITOA(nChannelNumber)"
Send_Command dvVCRDev,"'SP',8" (* Record *)
}
RELEASE:
{
Switch (nVCRNumber)
{
}
Send_Command dvVCRDev,"'SP',2" (* Stop *)
}
}
Easy, right? If we have the VCR number and Channel number, we can easily write a
handler for any number of buttons to start recording a certain channel on any number of VCR's for
any channel number. Therefore, the VCR number and the Channel number will need to be event
parameters.
Now, i!-Schedule is written to be a universal scheduling engine which means it has no idea that you
are interested in a VCR and Channel number. If i!-Schedule were written to understand these
parameters, then it would not be very useful for automatically dialing a phone number, since the
phone number could not be stored in either the VCR number location or the Channel number
location. And, it would be confusing to the user to say the least! To solve this problem, i!-Schedule
can support 8 number or value parameters and 8 string parameters per event. You may use these
parameters in any way you see fit.
To implement a parameter for a given event, you will need to collect the information, such as the
VCR number and Channel number, from the user and tell i!-Schedule to store these values along
with the event. In order to integrate the editing of the event and the editing of the parameters, each
i!-Schedule
Case 1:
dvVCRDev = dvVCR1
Case 2:
dvVCRDev = dvVCR2
Case 3:
dvVCRDev = dvVCR3
Case 4:
dvVCRDev = dvVCR4
Case 5:
dvVCRDev = dvVCR5
Case 1:
dvVCRDev = dvVCR1
Case 2:
dvVCRDev = dvVCR2
Case 3:
dvVCRDev = dvVCR3
Case 4:
dvVCRDev = dvVCR4
Case 5:
dvVCRDev = dvVCR5
Using i!-Schedule
(* VCR Recording *)
BUTTON_EVENT
5

Advertisement

Table of Contents
loading

Table of Contents