Communication between TwinCAT and Bus Terminal Controller
来源:互联网 发布:sql server nt 编辑:程序博客网 时间:2024/06/05 16:33
Communication between TwinCAT and Bus Terminal Controller
Communication between TwinCAT and Bus Terminal Controller
It makes sense to define a data structure for transferring data between TwinCAT and Bus Terminal Controller. Please note the following to account for the differences in data management on the two systems.
- If two different data types are sent in sequence (e.g. byte and INT), the following variable is set to the next even address offset
- Boolean variables should never be allocated individually within a structure, since they would invariably occupy 1 byte. Boolean expressions should always be masked in a byte or word.
Example 1: Structure on the BX and on the PC
Because the first byte is followed by a different variable type (INT), it was set to the next free even address in the BX/BCxx50. In order to achieve the same data structure on both systems, a dummy byte has to be inserted in the PC project (see example 2).
Example 2: Structure on the BX and on the PC with identical memory allocation
(Dummy) %..B1 (not necessarily required, since the system deals with this itself if the variable does not exist) %..B1 INT (1) %..B2 %..B2 INT (2) %..B4 %..B4
Data structure
Type PB_Data
STRUCT
wVar_1:WORD;
iValue_1:INT;
iValue_2:INT;
iValue_3:INT;
END_STRUCT
END_TYPE
Creating a variable structure
VAR_Global
strData_Out AT %QB1000:PB_Data; (*PLC Variables *)
bInput_01 AT %IX0.0:BOOL; (* Input from a terminal *)
END_VAR
Small programming example
strData_Out.wVar_1.0:=bInput_01;
Note A mixed data structure should not contain any Real values. If it does, the High and Low word must be swapped in the BX/BCxx50or in the TwinCAT master project. It is better to use an array of Real values or to transfer the Real values individually. Note It is also possible to transfer larger fieldbus data blocks, in order to leave a reserve for your structure. Disadvantage: These reserves are then transferred with each fieldbus telegram, causing additional load for the fieldbus communication.
- Communication between TwinCAT and Bus Terminal Controller
- Communication Protocols between SMSC and ESME
- netlink - Communication between kernel and userspace (PF_NETLINK)
- Securing MQTT communication between Ardruino and Mosquitto
- Difference between Controller and Model in MVC
- Implement of Asynchronous Communication between ADSP2106x Series DSP and PC
- Necessitas: convenient solution for communication between Qt application and Java
- Communication Between Hosting System and Its Plugin Applications(Cross Domains)
- Example: Communication between Activity and Service using Messaging
- Handle inter-process communication between PhantomJS and Golang processes via hixie-76 websockets
- 对Communication between native and React Native官方例子的纠正
- Bi-directional communication between Client and Server, using ServerSocket, Socket, DataInputStream
- Android communication between different Component
- Communication between Processes in Python
- What is the difference between Terminal, Console, Shell, and Command Line?
- Angular-Parent/Child Controller Communication
- between...and
- between ..... and ..........
- 简单几招教您玩转客服营销,提高宝贝转化率!
- 日期的排序
- PowerDesigner 16.5版本显示工具箱
- Invalid project description..\AW1ip116 overlaps the locat问题
- php yum升级 centos 6.5
- Communication between TwinCAT and Bus Terminal Controller
- 十五周项目一——验证哈希表相关算法
- Go1.7.3简单的ftp协议交互
- css伪类
- 生活:不努力也是一种生活方式
- 学期总结
- 垃圾回收算法
- fiddler无法抓取chrome
- node npm pm2 安装