beautypg.com

Wavetronix Click 500 (programmable controller) (CLK-500) - Developer Guide User Manual

Page 123

background image

122

CHAPTER 11 • CLICK SUPERVISOR SUPPORT

ClickLedHold(YELLOW1,200);
}
}
break;

default:
}
}

void SetupMainMode(void)
{
OutputState = STATE_INACTIVE;
VirtualSpeed = 1.0;
ClickSerialPortDisconnectAll();

// Setup ports for communications from Click! Supervisor
ClickSerialPortConnect(V3, _485TOP);
//ClickSerialPortConnect(V1, _485TBUS);
ClickSerialPortConfigureVirtual(V3, BAUD_RATE_BPS,
DATABIT_8, PARITY_N);

// Setup port for data forwarding
ClickSerialPortConnect(V2, _232TOP);
//ClickSerialPortConnect(V2, _232FRONT);
ClickSerialPortConfigureVirtual(V2, BAUD_RATE_BPS,
DATABIT_8, PARITY_N);

ClickMsgRemoveAllReceiveTask();
ClickSupervisorMsgPortInit(V3);
}

void GenerateVirtualVehicleSpeed()
{
VirtualSpeed += 10.5;
if (VirtualSpeed > 90.0)
{
VirtualSpeed = 1.0;
}
}

void GenerateEventMessage()
{