Pelco Developer Network (PDN)

MonitorConfiguration Troubleshooting

How do users set the active channel?

Refer to the Pelco Device Control URL section below for important details about the code sample.
  1. If you have not already done so, refer to the C++ programming language's 'Getting Started' section.
  2. Initialize an instance of the web service proxy class.
  3. Make a request to MonitorConfiguration's SetActiveChannel action along with the desired channel number to make active.
#include "PelcoAPI/Trace.h"#include "PelcoAPI/soapH.h"#include "PelcoAPI/Endura.nsmap"#include int main(){	int result = 0;	std::string m_sEndPoint;	m_sEndPoint.clear();	m_sEndPoint = "http://" + "decoderIPAddress" + ":" + "decoderPort" + "/control/" + "MonitorConfiguration-" + "monitorNumber";		struct soap soap;  // gSOAP runtime environment	soap_init(&soap);		try{	    _MonitorConfiguration__SetActiveChannel setChanReq;		_MonitorConfiguration__SetActiveChannelResponse setChanResp;		setChanReq.activeChannel = 2;		result = soap_call___MonitorConfiguration__SetActiveChannel(&soap, m_sEndPoint.c_str(),			 "urn:schemas-pelco-com:service:MonitorConfiguration:1#SetActiveChannel",			 &setChanReq, &setChanResp);		if(result != SOAP_OK){			soap_print_fault(&soap, stderr); 			throw false;		}	}	catch(...){	    TRACE_ERROR("Error when setting an active channel\n");   		return -1;	}	return 1;}



How do users clear the active channel?

  1. If you have not already done so, refer to the C++ programming language's 'Getting Started' section.
  2. Initialize an instance of the web service proxy class.
  3. Make a request to the MonitorConfiguration's SetActiveChannel action along with a -1.

#include "PelcoAPI/Trace.h"#include "PelcoAPI/soapH.h"#include "PelcoAPI/Endura.nsmap"#include int main(){	int result = 0;	std::string m_sEndPoint;	m_sEndPoint.clear();	m_sEndPoint = "http://" + "decoderIPAddress" + ":" + "decoderPort" + "/control/" + "MonitorConfiguration-" + "monitorNumber";		struct soap soap;  // gSOAP runtime environment	soap_init(&soap);		try{	    _MonitorConfiguration__SetActiveChannel setChanReq;		_MonitorConfiguration__SetActiveChannelResponse setChanResp;		setChanReq.activeChannel = 2;		result = soap_call___MonitorConfiguration__SetActiveChannel(&soap, m_sEndPoint.c_str(),			 "urn:schemas-pelco-com:service:MonitorConfiguration:1#SetActiveChannel",			 &setChanReq, &setChanResp);		if(result != SOAP_OK){			soap_print_fault(&soap, stderr); 			throw false;		}	}	catch(...){	    TRACE_ERROR("Error when setting an active channel\n");   		return -1;	}	return 1;}



How do users configure the monitor layout?

  1. If you have not already done so, refer to the C++ programming language's 'Getting Started' section.
  2. Initialize an instance of the web service proxy class.
  3. Make a request to the MonitorConfiguration's SetLayout action along with the desired layout value.

#include "PelcoAPI/Trace.h"#include "PelcoAPI/soapH.h"#include "PelcoAPI/Endura.nsmap"#include int main(){	int result = 0;	std::string m_sEndPoint;	m_sEndPoint.clear();	m_sEndPoint = "http://" + "decoderIPAddress" + ":" + "decoderPort" + "/control/" + "MonitorConfiguration-" + "monitorNumber";		struct soap soap;  // gSOAP runtime environment	soap_init(&soap);		try{	    _MonitorConfiguration__SetActiveChannel setChanReq;		_MonitorConfiguration__SetActiveChannelResponse setChanResp;		setChanReq.activeChannel = 2;		result = soap_call___MonitorConfiguration__SetActiveChannel(&soap, m_sEndPoint.c_str(),			 "urn:schemas-pelco-com:service:MonitorConfiguration:1#SetActiveChannel",			 &setChanReq, &setChanResp);		if(result != SOAP_OK){			soap_print_fault(&soap, stderr); 			throw false;		}	}	catch(...){	    TRACE_ERROR("Error when setting an active channel\n");   		return -1;	}	return 1;}



How do users retrieve the current monitor layout?

Refer to the Pelco Device Control URL entry below for important details about the code sample.
  1. If you have not already done so, refer to the C++ programming language's 'Getting Started' section.
  2. Initialize an instance of the web service proxy class.
  3. Make a request to the MonitorConfiguration's GetLayout action.

#include "PelcoAPI/Trace.h"#include "PelcoAPI/soapH.h"#include "PelcoAPI/Endura.nsmap"#include int main(){	int result = 0;	std::string m_sEndPoint;	m_sEndPoint.clear();	m_sEndPoint = "http://" + "decoderIPAddress" + ":" + "decoderPort" + "/control/" + "MonitorConfiguration-" + "monitorNumber";		struct soap soap;  // gSOAP runtime environment	soap_init(&soap);		try{	    _MonitorConfiguration__SetActiveChannel setChanReq;		_MonitorConfiguration__SetActiveChannelResponse setChanResp;		setChanReq.activeChannel = 2;		result = soap_call___MonitorConfiguration__SetActiveChannel(&soap, m_sEndPoint.c_str(),			 "urn:schemas-pelco-com:service:MonitorConfiguration:1#SetActiveChannel",			 &setChanReq, &setChanResp);		if(result != SOAP_OK){			soap_print_fault(&soap, stderr); 			throw false;		}	}	catch(...){	    TRACE_ERROR("Error when setting an active channel\n");   		return -1;	}	return 1;}



Appendix

Pelco Device Control URL

Note that all examples utilize a method of determining the device's control URL that is not suitable for production. This was done to keep our example code simple and focused on the main task being demonstrated.

To properly determine the device's control URL, refer to "Is there a programmatic way to determine an Endura device's control URL?" in Endura TroubleshootingRetrieving a Specific Web Service's Control URL, or the Pelco SDK 2.1 Programmers Guide.

C# Notes

For the C# code examples, you should have either already generated proxy classes from the WSDLs or have access to generated proxy classes.

If for some reason you want to generate the classes that represent the web services yourself, you should use MS Visual Studio (2005 or up) for WSDL stub/proxy class generation.

Make use of our XML related convenience classes found in the program.cs file in the samples directory. For the samples directory location, refer to Installation and Configuration for details.

It is not recommended that you utilize Mono, an open source alternative CLR for .NET.

C++ Notes

These examples require both gSOAP for SOAP web service calls and the PelcoAPI SDK. Moreover, these samples have only been tested on MS VS2005.

Assuming that you have installed the PelcoAPI SDK software to C:\Program Files, you must do the following to ensure that the sample code functions properly):

  • Create an environment variable EVEREST_ROOT, and set its value to C:\Program Files\Pelco\API\Include\C++
  • Create an environment variable EVEREST_BIN and set its value to C:\Program Files\Pelco\API\Libs