Пример #1
0
        // Not being used since single transmission does not need threading at this time

        /*public void KvaserWrite(CanData can)
         * {
         * // Canlib.canWrite(can.handle, can.id, can.msg, can.dlc, can.flags);
         * // Canlib.canWriteSync(can.handle, 10000);
         * Canlib.canWriteWait(can.handle, can.id, can.msg, can.dlc, can.flags,1000);
         * }*/

        public void KvaserWriteMultiple(CanData can)
        {
            for (int x = 0; x < can.number; x++)
            {
                // MainWindow.ErrorDisplayString("can message: " + CommonUtils.DisplayMsg(can));
                can.status = Canlib.canWrite(can.handle, can.id, can.msg, can.dlc, can.flags);
                // MainWindow.ErrorDisplayString("can status: " + can.status);
                can.status1 = Canlib.canWriteSync(can.handle, 10000);
                //CheckFlags(can);
                System.Threading.Thread.Sleep(can.timeBtw);

                if (can.increment == true)
                {
                    can.id++;
                }
            }
        }