请大佬予以指教,谢谢:
Step 1:
比如PC C++ 软件 结构
struct
{
BYTE myBytes[4]; // 4字节
int32 myInt32[2]; // 8字节
float32 myFloat[2]; // 8字节
}
如上,将step 1 的值通过profinet传给下边step 2 数据块。
Step 2:
PLC 数据块为
DB_my
myBytes byte[0..19]
step 3:
然后PLC里自己定义了一个数据类型
PLC data types -> 自定义数据类型为 ->
{
myBit_0 bit <= DB_my.myBytes[0].0;
myBit_1 bit <= DB_my.myBytes[0].1;
..
..
iInt32_1 int <=DB_my.myBytes[4] ..[7]
iInt32_2 int <=DB_my.myBytes[8] ..[11]
fFloat32_1 real <=DB_my.myBytes[12]..[15]
fFloat32_2 real <=DB_my.myBytes[16]..[19]
}
请问如何将step 2的数据转换为 step 3的数据? 谢谢。用的梯形图