Example #1
0
        static uint Send(bool b, int index, uint value)
        {
            BitArray baWrite = Int32ToBitArray(value);

            baWrite[index] = b;
            value          = BitArrayToInt32(baWrite);
            DASK.DO_WritePort(m_Number, 0, value);

            return(value);
        }
Example #2
0
        public static void Write(uint data)
        {
            short ret;


            ret = DASK.DO_WritePort((ushort)m_dev, 0, data);
            if (ret < 0)
            {
                // MessageBox.Show("DO_WritePort error!");
                return;
            }
        }
Example #3
0
 /* Write Port */
 public static void WritePort(byte port, uint value, out short code, out string message)
 {
     code = DASK.DO_WritePort((ushort)m_device, port, (uint)value);
     if (code < 0)
     {
         message = "เขียนเอาท์พุท DIO7432 ผิดพลาด";
         logText = "Write Port [" + port.ToString() + " = " + value.ToString() + "]: " + message;
         log.AppendText(logText);
         System.Diagnostics.Debug.WriteLine(logText);
     }
     else
     {
         message = "";
         logText = "Write Port [" + port.ToString() + " = " + value.ToString() + "]: OK";
         log.AppendText(logText);
         System.Diagnostics.Debug.WriteLine(logText);
     }
 }
Example #4
0
        public static void trigger(byte port)
        {
            uint value = 1;

            DASK.DO_WritePort(m_Number, port, value);
        }