예제 #1
0
파일: Form1.cs 프로젝트: djKim0828/GitHub
        private void btnOpen_Click(object sender, EventArgs e)
        {
            m_dwDevice    = PMAC.PmacSelect(0);
            m_bDriverOpen = PMAC.OpenPmacDevice(m_dwDevice);

            if (m_bDriverOpen == 0)
            {
                WriteLog("장치가 OPEN되지 않았습니다..");
                return;
            }

            WriteLog("장치가 OPEN되었습니다..");
        }
예제 #2
0
        public void command(string cmd, uint maxChar = 255)
        {
            StringBuilder strResponse = new StringBuilder();

            PMAC.PmacGetResponseA(_DeviceId, strResponse, maxChar,
                                  new StringBuilder(Convert.ToString(cmd)));

            WriteLog(cmd);

            if (strResponse.ToString() != "")
            {
                //int aaa = 0;
            }
        }
예제 #3
0
파일: Form1.cs 프로젝트: djKim0828/GitHub
        private void command(string cmd)
        {
            StringBuilder strResponse = new StringBuilder();

            PMAC.PmacGetResponseA(m_dwDevice, strResponse, 255,
                                  new StringBuilder(Convert.ToString(cmd)));

            WriteLog(cmd);

            if (strResponse.ToString() != "")
            {
                int aaa = 0;
            }
        }
예제 #4
0
        internal void GetMem(UInt32 offset, UInt32 length)
        {
            if (length <= 0)
            {
                return;
            } // else

            IntPtr ptrBuffer = System.Runtime.InteropServices.Marshal.AllocHGlobal((int)length);

            //PmacDPRGetMem 함수 호출
            PMAC.PmacDPRGetMem(_DeviceId, offset, length, ptrBuffer);

            //Managed 동적영역 할당
            byte[] bBuffer = new byte[(length)];

            //Copy
            Marshal.Copy(ptrBuffer, bBuffer, 0, (int)length);

            string str2 = BitConverter.ToString(bBuffer).Replace("-", " ");

            WriteLog(str2);
        }
예제 #5
0
        private void btnOpen_Click(object sender, EventArgs e)
        {
            // Todo : 테스트에 따라 아래를 사용
            //_deviceId = PMAC.PmacSelect(0);
            _deviceId = 0;

            _driverOpen = PMAC.OpenPmacDevice(_deviceId);


            if (_driverOpen == 0)
            {
                WriteLog("장치가 OPEN되지 않았습니다..");
                return;
            }

            _pmacCommand = new PmacCommnad(_deviceId);
            _pmacCommand.LoggerMessage += _pmacCommand_LoggerMessage;

            tslStatus.BackColor = Color.Green;


            WriteLog("장치가 OPEN되었습니다..");
        }