- Code: Select all
if (This.CAN Bus neq This.CAN Bus.Not in Use)
{
local ok = true;
// Messsage 1
local h = DBC.Main Bus.ECU GPS1.TxOpen();
local lat = Convert.ToInteger(GPS.Latitude) * 10000000;
local long = Convert.ToInteger(GPS.Longitude) * 10000000;
DBC.Main Bus.ECU GPS1.TxInitialise(h);
DBC.Main Bus.ECU GPS1.GPS Latitude.SetInteger(h, lat);
DBC.Main Bus.ECU GPS1.GPS Longitude.SetInteger(h, long);
ok = DBC.Main Bus.ECU GPS1.Tx(h);
ok = ok;
}
I tried this too, but it throws errors trying to convert a constant integer to a 7dps.
- Code: Select all
local lat = Convert.ToInteger(GPS.Latitude * Convert.ToFixed7DP(10000000));
I would appreciate any suggestions. Thank you!
