96
Sensaphone
®
ISACC Instruction Manual
NETWORK
Summary:
int network(n1,n2);
int n1; Request number
int n2; Command, 0=turn off, 1=turn on, 2=return status
Description:
The network function will read a value or write a value to one of the predetermined
network requests (specified by n1). If the network request is an output function, then
the value of n2 is the value sent to that output. If the network request is an input
function, then n2 should have the value 2. For more information on the network
requests see NETWORK command - Chapter 7, page 72.
Return value:
If n2 is 2, then the network function returns the present value of that network request.
Otherwise it will return the value of n2.
Example:
This program will set network request number 2 (for output 7) to 1 (on) if network
request 1 (value of input 4) if greater than 85. Otherwise it sets request 2 to 0 (off). In
other words, if input number 4 on node 2 is greater then 85, then output 7 on node 3
is turned on. Otherwise output 7 on node 3 is turned off.
This program assumes these network requests:
NETWORK REQUESTS
Request #01: Node = 02, Input #04 = 0082
Request #02: Node = 03, Output #07 = 0000
main()
{
if (network(1,2) > 85)
{
network(2,1);
}
else
{
network(2,0);
}
}
PROGRAMMING NOTE: When using the NETWORK command, be sure to program n1 as the
network request number, NOT the input or output number that you want to manipulate.
For analog outputs, if n2 is 0 or 1, the output will be set to that value. Note that analog
outputs use incremental values. Therefore, the value 1 for an analog output is not the same as
"on" for a digital output.