WIM Controller SPP Guide
WIM Controller SPP Guide
WIM Controller SPP Guide
RevA,August2013
IntercompWIMSPPAPIProgramming
Guide
3839 County Road 116
Medina, MN 55340
763-476-2531
WIMSPPAPIProgrammingGuide
RevA,August2013
TableofContents
Using the WIM Controller ........................................................................................................................... 3
Add the File Reference..........................................................................................................................3
Creating the WIM Controller.................................................................................................................3
Subscribing to the Controller Events...................................................................................................3
Implementing Each Event Handler Routine:......................................................................................4
myWIMController_StaggeredWeight_received.............................................................................4
myWIMController_Static_Weight_Received..................................................................................4
myWIMController_Dynamic_Weight_Received.............................................................................4
myWIMController_Inputs_Received................................................................................................5
myWIMController_Jitter_Received..................................................................................................5
myWIMController_Firmware_Settings_Received.........................................................................5
myWIMController_Connection_Lost................................................................................................5
myWIMController_Dynamic_Vehicle_Complete...........................................................................6
Starting the Connection.........................................................................................................................6
Stopping the Connection.......................................................................................................................6
Setting the Weighing Mode...................................................................................................................6
Setting the Trigger Mode for Vehicle Detection.................................................................................6
Zeroing the Scales.................................................................................................................................6
Updating the Scale Size........................................................................................................................6
Updating the complete vehicle Interval...............................................................................................6
Calibration...............................................................................................................................................7
Checking for Errors................................................................................................................................7
Setting the Outputs................................................................................................................................7
Setting the Number of Scales...............................................................................................................7
Updating the Loop to Scale Distance..................................................................................................7
Updating the Stagger Distance............................................................................................................7
Setting the Address................................................................................................................................7
Setting the Port.......................................................................................................................................7
Request Firmware Settings..................................................................................................................7
WIMSPPAPIProgrammingGuide
RevA,August2013
Using the WIM Controller
Add the File Reference
//ImportthenamespaceWIM_Controller_SPPasshownbelow
UsingWIM_Controller_SPP;
//hookingupthejitterreceivedeventhandler
myWIMController.Jitter_Received+=new
SPPController.Jitter_Event_Handler(myWIMController_Jitter_Received);
//hookingupthestaggeredweighteventhandler
myWIMController.StaggeredWeight_received+=new
SPPController.StaggeredWeight_Handler(myWIMController_StaggeredWeight_received);
//hookinguptheconnectionlosteventhandler
myWIMController.Connection_Lost+=new
SPPController.Connection_Lost_Handler(myWIMController_Connection_Lost);
//hookingupthestaticweightreceivedeventhandler
myWIMController.Static_Weight_Received+=new
SPPController.Static_Weight_Received_Event_Handler(myWIMController_Static_Weight_Received
);
//hookingupthedynamicweightreceivedeventhandler
myWIMController.Dynamic_Weight_Received+=new
SPPController.Dynamic_Weight_Received_Event_Handler(myWIMController_Dynamic_Weight_Receiv
ed);
//hookingupthevehicleeventhandler
myWIMController.Dynamic_Vehicle_Complete+=new
SPPController.Dynamic_Vehicle_Complete_Handler(myWIMController_Dynamic_Vehicle_Complete);
//hookingupthefirmwaresettingseventhandler
myWIMController.Firmware_Settings_Received+=new
SPPController.Firmware_Event_Handler(myWIMController_Firmware_Settings_Received);
WIMSPPAPIProgrammingGuide
RevA,August2013
});
}
catch
{}
}
myWIMController_Dynamic_Weight_Received
//DisplaythedynamicdatasuchasScalenumber,WheelWeight,Errors,andJitter
voidmyWIMController_Dynamic_Weight_Received(SPPDynamicWeightMessageMessage,EventArgse)
{
try
{
this.Invoke((MethodInvoker)delegate
{
});
}
catch
{}
}
WIMSPPAPIProgrammingGuide
RevA,August2013
myWIMController_Inputs_Received
//Displaymessageregardinginputchangesuchaschangeinthelooporbeaminputs
voidmyWIMController_Inputs_Received(SPPInputsMessageMessage,EventArgse)
{
this.Invoke((MethodInvoker)delegate
{
});
}
myWIMController_Jitter_Received
//DisplayJitter,BadPowerstatusandScaleErrorthatoccurredduringDynamicWeighing
voidmyWIMController_Jitter_Received(SPPJitterMessageMessage,EventArgse)
{
this.Invoke((MethodInvoker)delegate
{
});
}
myWIMController_Firmware_Settings_Received
//DisplaytheFirmwaresettingssuchasFirmware,LoadCellType,Mode,
//DynamicConversionFactor,StaggerConversionFactor,Threshold,andSpeedLimit
voidmyWIMController_Firmware_Settings_Received(SPPFirmwareMessageMessage,EventArgse)
{
try
{
this.Invoke((MethodInvoker)delegate
{
});
}
catch
{}
}
myWIMController_Connection_Lost
//DisplaytheerrormessagesendbytheConnection_Lostevent.
voidmyWIMController_Connection_Lost(StringErrorMessage,EventArgse)
{
try
{
this.Invoke((MethodInvoker)delegate
{
MessageBox.Show(ErrorMessage);
});
}
catch
{}
}
WIMSPPAPIProgrammingGuide
RevA,August2013
myWIMController_Dynamic_Vehicle_Complete
//DisplaythecompletevehicledatasuchasTotalWeight,Speed,ScaleAxleIdWeight,
//AxleCountPerScale,AxleSpacing,AxleWeight
voidmyWIMController_Dynamic_Vehicle_Complete(VehicleMessage,EventArgse)
{
try
{
//Clearcurrentdata
ClearCompleteVehicle();
this.Invoke((MethodInvoker)delegate
{
});
}
}
myWIMController.ScaleSize=20;
myWIMController.VehicleInterval=10000;
WIMSPPAPIProgrammingGuide
RevA,August2013
Calibration
CalibrationofthescalescannotbedonethroughuseoftheAPI.Aseparatesoftwaretoolisusedfor
scalecalibration.