public static VehicleScapeAPI.Result Generate(GenerateParameters parameters, uint daqHandle, uint deviceHandle)
        {
            if (daqHandle == 0 || deviceHandle == 0)
            {
                return(VehicleScapeAPI.Result.ResultInvalidHandle);
            }
            // Set up our DAQ
            VehicleScapeAPI.DAQ daq = GetDAQByHandle(daqHandle);
            VehicleScapeAPI.SetDAQProperties(ref daq);

            // Set up our collection
            List <VehicleScapeAPI.DAQCollection> cols = GetDAQCollections(daqHandle);

            if (cols.Count == 0)
            {
                return(VehicleScapeAPI.Result.ResultUnableToSetupForCompile);
            }
            VehicleScapeAPI.DAQCollection col = cols[0];
            col.fileName = parameters.Name;
            col.stopNumMessages.numMessages = parameters.NumberOfMessagesToCollect;
            col.collectionType = VehicleScapeAPI.CollectionType.StartImmediatelyStopNumMessage;
            VehicleScapeAPI.SetDAQCollectionProperties(ref col);

            List <uint> channelHandles = new List <uint>();

            channelHandles.AddRange(parameters.MessageHandles);
            channelHandles.AddRange(parameters.SignalHandles);
            List <VehicleScapeAPI.DAQChannel> channels = new List <VehicleScapeAPI.DAQChannel>();

            // Set up our channels
            foreach (uint handle in channelHandles)
            {
                VehicleScapeAPI.DAQChannel channel = new VehicleScapeAPI.DAQChannel();
                channel.signalHandle = handle;
                VehicleScapeAPI.AddDAQChannel(daqHandle, handle, ref channel);
                VehicleScapeAPI.SetAlwaysCollectDAQChannel(handle);
                channels.Add(channel);
            }

            VehicleScapeAPI.Result retv = VehicleScapeAPI.GenerateCoreMini(daqHandle, deviceHandle);

            // Clear out the channels
            foreach (VehicleScapeAPI.DAQChannel channel in channels)
            {
                VehicleScapeAPI.RemoveDAQChannel(channel.signalHandle);
            }

            return(retv);
        }