function ParameterCalculationFunc1(input, output, context)
{
	output.p5 = (input.p1 * 60 * 60 * 1000) + (input.p2 * 60 * 1000) + (input.p3 * 1000) + input.p4;
}

function ButtonHandlerFuncIncrement1(device, online, progress, context)
{
	var p = device.getParameterByName("int");
	p.Value++;
}

function ButtonHandlerFuncDecrement1(device, online, progress, context)
{
	var p = device.getParameterByName("int");
	p.Value--;
}

function ParameterValidationFunc1(input, changed, prevValue, context)
{
	if (input.min > input.max)
	{
		return ApplicationProgram.getMessage("ErrMsg1");
	}
	return true;
}

function ButtonHandlerDeviceRead1(device, online, progress, context)
{
	var p = device.getParameterByName("button");
	var v = [];

	online.connect();
	v = online.readMemory(0x1D1, 1);
	online.disconnect();

	p.Value = v[0];

}

function ButtonHandlerDeviceWrite1(device, online, progress, context)
{
	var p = device.getParameterByName("button");
	var v = [];
	
	v[0] = p.Value;

	online.connect();
	online.WriteMemory(0x1D1, v, 1);
	online.disconnect();
}

function ButtonHandlerReadMaskVersion1(device, online, progress, context)
{
	p = device.GetParameterByName("DD0");

	online.connect();
	p.Value = online.ReadDeviceDescriptor0();
	online.disconnect();
}