예제 #1
0
        public static void sendWord(byte subAd, string word, int usbDevId)
        {
            Int32 wrByte;

            byte[] tempTx = new byte[1];
            tempTx[0] = Convert.ToByte(Convert.ToUInt32(word, 2));
            wrByte    = USB.UsbWrt(usbDevId, subAd, tempTx, 1);
        }
예제 #2
0
 public static byte[] readWord(byte subAd, int nbRead, int usbDevId)
 {
     byte[] rdAdd = new byte[nbRead];
     unsafe
     {
         fixed(byte *arrayRd = rdAdd)
         {
             int rdByte = USB.UsbRd(usbDevId, subAd, arrayRd, nbRead);
         }
     }
     return(rdAdd);
 }
예제 #3
0
        public static string readWord(byte subAd, int usbDevId)
        {
            byte[] tempRx = new byte[1];
            byte   rdAdd  = 0;

            unsafe
            {
                fixed(byte *arrayRd = tempRx)
                {
                    Int32 rdByte = USB.UsbRd(usbDevId, subAd, arrayRd, 1);
                }

                rdAdd = tempRx[0];
            }

            return(IntToBin(Convert.ToInt32(rdAdd), 8));
        }
예제 #4
0
 public static void sendWord(byte subAd, byte[] stream, int nbSend, int usbDevId)
 {
     USB.UsbWrt(usbDevId, subAd, stream, nbSend);
 }