Home > Net >  About c # PC: including interface control, logic processing, data acquisition, including sending and
About c # PC: including interface control, logic processing, data acquisition, including sending and

Time:09-28

Problem: building a c # PC, data reception, but how to create the background data (both threads in real time), the received data and interface logic control input data, and after the treatment, send data, using UDP protocol to send and receive data, the current will be receiving data alone, but always want to send and receive two tasks at the same time there are a lot of mistakes, there are a great god can help me with the framework of how to set up the program?

CodePudding user response:

This kind of problem with LabVIEW processing is simple, because the LabVIEW naturally multithreading and relatively easy to use,

, in c # what, if anything, can draw lessons from the thinking of LabVIEW, "producers, consumers mode", to open a thread dedicated to collect data, a thread to handle data, a thread handle UI,

Hope useful to you, it is not can be outsourced, [email protected]

CodePudding user response:

I want to ask: threads for data acquisition, is to open a accept data and a thread to send data? When open the two threads at the same time, there will be conflicts, how the two threads can let each run their own, for real-time acquisition, must always open

CodePudding user response:

Why someone with this thread, the thread,

I ask you, that your UI interface, can let you input, can let you move, can let you enter, why,
Why is easily thread here, this is the background, and every background that, one the one that,

Sent and received where points illustrate the background, the background,

Send and receive are inherently asynchronous parallel originally, no two threads, a run that a run that statement
Whether you're a serial port or TCP, the somebody else is inherently send is to send, receive is receiving, born to be send buffer, the receive buffer, natural design is parallel

CodePudding user response:

Multi-thread asynchronous parallel, not to take the same resources should not have conflicts, even receive real-time to send, but as the upstairs said have receive buffer and send buffer, the call right there would be no conflict
  •  Tags:  
  • C#
  • Related