What is a Process image(Understanding the process image)

本文详细解释了ProcessImage的概念及其在Modbus协议中的实现方式,包括数字输入、数字输出、输入寄存器和寄存器等元素,以及如何通过ProcessImageCollection抽象过程图像。介绍了如何使用简单的接口实现Modbus从站,并提供了实现RandomDigitalIn的例子。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://www.steinhoff.de/process_image.htm

Process Image

 

the single unified interface for all applications and all process IO resources
in the RTOS based DACHS-Product-line from STEINHOFF

 

PROCESS IMAGE

 

The process image is the single unique IO interface for all applications to the IO resources of an external process. It consists of a shared memory segment splitted into an input and output section containing an un-interpreted bit stream of IO bits. That IO section is read and written using a pair of pointers.

The process image is completely independent to the different fieldbus controllers and other IO controllers ... that means also the applications are independent of the different fieldbuses and other IO resources.

 

The IO information in DACHS are provided by optimized specific fieldbus drivers or non-fieldbus drivers dealing with other IOs .. e.g. Multi-IO boards. That concept makes sure that every fieldbus will be handled regarding its specific requirements ...  therefore no specific functionalities are lost in complete implementations.

The IO data are provided with a standard time resolution of one millisecond.

A higher time resolution is archived by PCI fieldbus controllers which are providing already a process image in its dual ported memory (1MB or more). After mapping of that DPM no driver actions and no DMA transfer are necessary to transfer the IO data to the process image !



About

This document should help the reader to understand the ideas behind the abstraction of a process image suited for the Modbus basic data types.

What is a Process Image?

Lets assume we have a continuous ongoing process and we are using measurements to observe the process. The measurements will be made at certain points in time, representing a discretization of the actual measured functions into a sequence of sets f(ti), g(ti), h(ti), .... Each set of values should be homogenous in relation to time, i.e. the values should correspond to one and the same point in time ti to be meaningful for observations (or control) of the process.

Especially if we have multiple "users" (i.e. corresponding control programs, network data acquisition, visualization etc.) accessing the data concurrently, we want to ensure this property. Thus requests are not directly made to corresponding I/O modules, but rather to a set corresponding to a certain point in time, that is stored cyclically in a block of memory (usually deploying some kind of synchronization mechanism for sequential access). This memory stored set of process measurements (or I/O states) is often called "process image", as it represents the state of a process at a certain point of time (respectively in terms of what we can measure).

A Process Image for Modbus

As described in Understanding the Protocol - Modbus Data Model, a set of simple data types is defined by the Modbus specification. The following list presents the abstract models for the different corresponding types of the data model:

  1. a Digital Input(for a discrete input)
  2. a Digital Output (for a discrete output or coil)
  3. an Input Register (for an input register)
  4. a Register (for a holding register)/li

The accessible and modifiable collection of elements which are instances of 1-4 is an abstraction of the idea of a process image, like presented before. All of these elements are discussed in the following subsections.

DI - Digital Input

Basically represents an abstraction for an input that is fed by a digital sensor (i.e. 1 or 0, respectively true/false or on/off etc.). Figure 1 presents a possible symbolic notation and the interface representing the corresponding software model (DigitalIn).

Figure 1.a: Digital Input Model Figure 1.b: Discrete Input

It consists of isSet() and isValid(), latter for checking whether the returned state of the input is valid.

DO - Digital Output

Basically represents an abstraction for an I/O connected to a digital actor. It can be in, as well as switched into, the states on/off (respectively true/false or 1/0 etc.). Figure 2 presents a possible symbolic notation of the input states and the interface representing the corresponding software model (DigitalOut).

Figure 2.a: Digital Output Model Figure 2.b: Discrete Output

It consists of isSet(), set(boolean) and isValid(), latter for checking whether the returned state of the output is valid.

IR - Input Register

Represents an abstraction for an analog input that is fed by an analog sensor. It can take a range of values, which is basically limited by the number of possible values for a 16 bit Integer. Figure 3presents a possible symbolic notation and the interface representing the corresponding software model (InputRegister).

Figure 3.a: Input Register Model Figure 3.b: Input Register

It consists of getValue() and isValid(), latter for checking whether the returned value of the input is valid.

RE - Register

Represents an abstraction for an analog I/O connected to an analog actor. It can take and be set a range of values, which is limited by the number of possible values for a 16 bit Integer. Figure 4 presents a possible symbolic notation and the interface representing the corresponding software model (Register).

Figure 4.a: Register Model Figure 4.b: Register

It consists of getValue(), setValue(int) and isValid(), latter for checking whether the returned value of the I/O is valid.

PIC - ProcessImage Collection

Represents the actual process image, a collection of all instances of the formerly presented elements (DigitalIn, DigitalOut, InputRegister, and Register).

According to the Modbus specification, the simplest organization of this data in "memory" for a virtual device which has no real memory limits, are separate blocks for each data type. The resulting software model (ProcessImage, and ProcessImageImplementation) are presented in Figure 5.

Figure 5: Process Image Model

Implementation - Example Implementation and Extensibility

The presented model is definitely kept very simple, but it is extremely powerful. First, it is possible to simply swap references of two ProcessImage instances cyclically (sequential access can be ensured easily). Alternating, one presents the snapshot of a given moment in time, while the other is refreshed with new data. However, if this is not necessary, synchronization mechanisms can be still deployed at the level of element instances (respectively their implementations).

Second, the generic interface allows generic slave access to the standard Modbus data types; in a few lines of code you can have your Modbus slave (or server) up and running.

jamod comes with a very simple demonstration implementation. All related classes are prefixed with Simple:

The set methods of these classes are synchronized, which will ensure atomic access, but not a specific access order. If you are interested in specialized implementations and concurrency properties, we recommend to take a look at:

    Lea, Doug: "Concurrent Programming in Java: Design Principles and Patterns", 
    Second Edition, Addison-Wesley, ISBN 0-201-31009-0, November 1999.
    
    Goetz, Brian; et al. : "Java Concurrency in Practice", 
    Addison Wesley, ISBN 0-321-34960-1, November 2006.
How to make use of the Model

The basic idea behind the set of interfaces is to make the developers life more simple. The following example source will show how to implement a DigitalIn that returns a random value. From this example, you can hopefully infer a more sense making implementation, probably based on the Java Native Interface (JNI).

package net.wimpi.example;

import net.wimpi.modbus.procimg.*;
import java.util.Random;

public final class RandomDigitalIn
    implements DigitalIn {

 //instance variables
 private Random m_Random;

  /**
   * Constructs a new <tt>RandomDigitalIn</tt>.
   */
  public RandomDigitalIn() {
    m_Random = new Random();
  }//constructor

  /**
   * Constructs a new <tt>RandomDigitalIn</tt>;
   * with a given <tt>Random</tt> instance.
   */
  public RandomDigitalIn(Random rnd) {
    m_Random = rnd;
  }//cinstructor(Random)

  public final boolean isSet() {
    return m_Random.nextBoolean();
  }//isSet

  public final boolean isValid() {
    return true;
  }//isValid

}//RandomDigitalIn

You can use instances of RandomDigitalIn in the examples of the Slave How-To's to complete the picture of the process image model idea.



内容概要:本文深入探讨了软件项目配置管理在汽车开发领域的应用及其重要性,强调配置管理不仅是版本控制,更是涵盖标识、追溯、结构化等多方面的深度管控。文章通过对比机械产品和软件产品的标签管理,揭示了软件配置管理的独特挑战。配置管理构建了一个“网”状体系,确保软件产品在复杂多变的开发环境中保持稳定和有序。文中还讨论了配置管理在实际工作中的困境,如命名混乱、文档更新不及时、发布流程冗长等问题,并提出了通过结构可视化、信息同源化、痕迹自动化和基线灵活化等手段优化配置管理的具体方法。 适合人群:具备一定软件开发和项目管理经验的工程师及项目经理,尤其是从事汽车电子软件开发的相关人员。 使用场景及目标:①理解配置管理在汽车软件项目中的核心作用;②学习如何通过工具链(如Polarion、JIRA、飞书等)优化配置管理流程;③掌握结构可视化、信息同源化、痕迹自动化和基线灵活化等关键技术手段,提升项目管理水平。 其他说明:配置管理不仅是技术问题,更涉及到项目管理和团队协作。文中强调了工具链的应用和优化的重要性,但同时也指出,工具本身并不能解决所有问题,关键在于如何合理使用工具并不断优化管理流程。文章呼吁读者成为长期主义者,相信时间的力量,持续改进配置管理工作。
翻译并改写为符合中文习惯的表达 Similarly, you can use this model for semantic segmentation as well. Semantic segmentation is the process of labeling each pixel and assigning them to the classes. While object detection deals with objects in bounding boxes, semantic segmentation creates a selection of the objects in a pixel-wise manner. Follow these steps: 1. T he first thing you need to do is to load your model: 2. The next step is to download the image that we want to perform segmentation on: Now that we have the image, we can use processor and model to get the output: Afterwards, you need to use the following functions to extract the result: However, in order to see the image, you can execute the following code: 3. T his code will convert the output of the model into the proper format to be visualized. Finally, you can see the image as shown in Figure 16.7, which is the identical semantically segmented image of the original image: Up to this point, you have learned how to use ViT models for image classification, object detection, and semantic segmentation. In the next section, you will learn about visual prompt models and how to use them. Visual prompt models Prompt-based models have been an attractive part of artificial intelligence in many aspects. These kinds of models can take guidance in the form of a pattern and create the respective output by understanding it. The prompt can be in many forms or data formats. Textual prompt-based models or visual prompt-based models are also available. A textual prompt is a free text that indicates what the model should do or provide as output. Similarly, a visual prompt is a visual guidance that helps the model understand the task or the instruction itself. Models such as CLIP are capable of understanding images and text at the same time and mapping them to a single vector space. In this vector space, text with similar semantic meaning to images (that visually present the same described objects or scenes
03-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值