3/09/2013

SICK LMS511 sensor data acquisition interface (source code, C++/MFC)

This is data acquisition source code of LMS511(SICK co.)



Source code is made by MFC(vs 2008).
The sensor is communicated by TCP/IP.
You can set sensor ip and test running by  sopas program.
The sopas program is included in the manual CD.



This movie is running test video.






LMS511 communication sample code (tcp/ip)

reference here
http://study.marearts.com/2013/03/sick-lms511-sensor-data-acquisition.html

Source code is here(github)
https://github.com/MareArts/LMS511-SICK-Laser-sensor-communication-tcp-ip

youtube
https://www.youtube.com/watch?v=2LTpaDGus1Y


Thank you.

3/04/2013

CString to char *



- CString to char*

1. memcpy
CString str = "test";
unsigned char st[30];
memcpy(st, (unsigned char*)(LPCTSTR)str,str.GetLength());

2. strcpy
CString strData = "test";
int length = strData.GetLength();
char* st = new char[length];
strcpy(st, strData.GetBuffer(0));

3. Type convert
CString str;
str = "test";
char* st = LPSTR(LPCTSTR(str));


- char* to CString
Using Format function in CString class
char st[] = "test";
CString str;
str.Format("%s", st);