C++ Winform에서 OpenCV Mat 영상을 Picture box에 출력하기 위한 Image(=Bitmap)으로 변환하는 코드

 

cv::Mat img = cv::imread(path);

Bitmap^ bmp = gcnew System::Drawing::Bitmap(

   img.cols, img.rows, img.steps,
   System::Drawing::Imaging::PixelFormat::Format24bppRgb,

   (System::IntPtr)img.ptr());

'UI > C++ CLR' 카테고리의 다른 글

C++ CLR 에서 비동기 작업 생성하기  (0) 2021.05.12

비동기로 처리해야할 함수가 필요한 경우 다음과 같이 작업을 생성할 수 있다.

 

System::Threading::Tasks::TaskFactory^ tf = gcnew System::Threading::Tasks::TaskFactory();
System::Threading::Tasks::Task^ myTask = tf->StartNew(gcnew System::Action(this, &MainForm::RunCalibration));

'UI > C++ CLR' 카테고리의 다른 글

C++ CLR에서 cv::Mat -> Bitmap 변경하기  (0) 2021.05.12

Modbus

자동화 디바이스간 통신을 위해 개발된 산업용 프로토콜, Master/Slave 구조

 

1) 종류

- Modbus RTU : RS-232/485/422 등의 시리얼 통신용, 이진 데이터 전송

- Modbus ASCII : RS-232/485/422 등의 시리얼 통신용, ASCII 데이터 전송

- Modbus TCP/IP : 이더넷 기반의 TCP 통신용

 

2) Modbus RTU

- 주요 기능 및 코드

  여러 가지 기능 코드가 있는데, 16비트 단위의 04(Read Input Register), 03(Read Holding Register), 06(Write Single Register), 16(Write Multiple Register) 기능을 주로 사용 함.

 

- 프로토콜 Fuction 코드

 

- 프로토콜 메시지 구조

 

- 프로토콜 Fuction의 종류

 

+ Recent posts