11.5 programming

Teacher guidance:

  • In the framework of the operator, the real physical objects (where data is stored) and only an operator message queue simply place a logical structure (logical abstract), there is a data storage VI display control, so a total of only three place to store data.
  • Consider priority
    • Three priorities, if simple priority, that would result in starvation ( starvation ) or infinite blocking ( infinitive blocking ) problem
    • solution:
      • Aging ( aging ), increasing system latency of a long process
      • Dynamically changing priority. That is a high priority message is not always the highest priority, but the highest priority in most of the time, the low-priority messages are not always a low priority, but also a small portion of the event is the priority High.
    • Final Thoughts
      • Priority is not set, the number of elements in the queue is detected, when the number increases, deleted from a queue, to ensure real-time.

In-depth understanding of the operator framework -TASK function design

  • Each operator only receiver module, the module does not send, send receiver module module by calling others to achieve, understand that there is help to build message.
  • That is, you want one operator which receives the message and what kind of action is completed,
  • Note: The following class operator TASK function is "used to access data members VI " (permissions: read), you can right-class name, then create a new can. (If you are designing class, dynamic allocation, if it is not static allocation)
  • In the VI Properties - Disable embedded sub-execution tab VI , select non-reentrant execution
  • End this new VI Thereafter, the Toolbar - operator message frame maker - Select the operator class following the TASK function, click generation, i.e., it generates a complete message.
  • Next, change the class and VI of the name can be, for all VI add identifying information frame.
  • To use a reference value change event referenced nodes must be selected in the attribute value (sgnl) [ value (signal) ] , rather than value [ value ]

The main operator automatically forwarded message (if the operator also has a sub-function of receiving and sending messages, it is also applicable to this criterion)

  • Implement behavior: Sub operator repeatedly transmits a message to the primary coordinate operator, the operator is automatically sent to the main map operator
  • Two ways
    • First, the main structure of the operator upon detection of an event using the received message, the detected data is sent automatically when the value changes to the map operator (where a transmission operator specified by the designer, the temporary help automatically control, in order to automatically controlled by a program, you can use a table)
    • Use the second, that the teacher thought. Or the use of a cyclic structure, first of all the data is detected, analyzed, and then determines to perform message transmission.
  • What methods of detection and analysis needs?
  • How to determine the executive does not perform quasi-hair action.
    • Note that these two things are executed in the main operator in it?
  • no.
    • Upon receiving the message class of the main operator DO receiving function and processed data to form a decision, the decision write control cluster (designated control_cluster ), which is similar to the microcontroller enable bit.
      • To increase performance, it should enable the use of bit registers, instead of using LV cluster data types. Each operator may be a "register." For example, on setting the bit map operator, includes not only allows map updates, you should also use more bits to register setting function map operator.
      • Since the control cluster stored in the main operator's message class, changing the content of the control cluster, some functions need to be changed, first clusters of data message classes, then the send function, then the task function.
      • Modified accordingly also the main operator class data referenced in the cluster
    • The establishment of parallel circulation in the core function
      • Parallel circulation stops, the use of the notifier, does not work , because the loop will not continue to run.
      • Will wait notifier timeout to 0 , the cycle can continue to run, but after clicking Stop All button, the front panel process will be blocked, no response, because I do not know.
      • Later in the cycle immediately set a timeout event structure before we can solve this problem.

The definition of environmental model operator

  • The core functions: the environmental model is initialized, and then recycled to provide environmental information to other operators, maintenance model
  • Receiving a message: receiving another model information provided by the operator
  • DO function: read messages received over, and change the existing environment model

See all information pages inside.

finish watching. It contains various introductory information and extensions.


Guess you like

Origin www.cnblogs.com/lizhensheng/p/11241961.html