Control interaction between FSP and fsp

Source: Internet
Author: User

Control interaction between FSP and fsp

Today, when I encountered a task at work, I changed the code for communications between matlab and FSP spectrometer to VC ++. At that time, I was surprised that matlab could write communication programs, matlab is really cool.

At first, I thought it was UDP communication. I wrote a subprogram and found that the analyzer was not a bird at all...

Use TCP instead. The code snippet is as follows:

If (soc = socket (AF_INET, SOCK_STREAM, 0) <= 0) {printf ("create socket failed \ n"); return-1;} addr. sin_family = AF_INET; addr. sin_addr.S_un.S_addr = inet_addr ("192.168.0.19"); // ipaddr of the analyzer. sin_port = htons (5025); // The port number connect (soc, (struct sockaddr *) & addr, sizeof (addr); send (soc, ": INIT: cont off \ n ", strlen (": INIT: cont off \ n ") +); //: INIT: cont off command is used to capture the display interface of the analyzer, that is, the display screen closesocket (soc) is paused );


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.