New project: MakeConfig
This project can generate SysVar definitions and CANdbs depending on IP addresses
This commit is contained in:
parent
df4813e33d
commit
087453d5c3
7 changed files with 5621 additions and 0 deletions
297
Modbus/MakeConfig.can
Normal file
297
Modbus/MakeConfig.can
Normal file
|
@ -0,0 +1,297 @@
|
|||
/*@!Encoding:1252*/
|
||||
includes
|
||||
{
|
||||
#include "include/ModbusUdpClientCommon.cin"
|
||||
}
|
||||
|
||||
variables
|
||||
{
|
||||
char[16] gIps[long];
|
||||
char gScanFirstIp[16];
|
||||
char gScanLastIp[16];
|
||||
word gScanPort = 502;
|
||||
|
||||
char fnSysvar[20]; // Filename of Sysvars
|
||||
char fnDbc[20]; // Filename of DBC
|
||||
char name[20]; // Name of project
|
||||
|
||||
file f;
|
||||
byte gIpNets[long];
|
||||
char[16] gIpsSorted[long];
|
||||
|
||||
dword gScanFirst, gScanLast;
|
||||
//long i, ipN;
|
||||
}
|
||||
|
||||
on preStart
|
||||
{/*
|
||||
strncpy(gIps[0], "192.168.1.3", 16);
|
||||
strncpy(gIps[2], "192.168.1.4", 16);
|
||||
strncpy(gIps[3], "192.168.1.8", 16);*/
|
||||
|
||||
strncpy(gScanFirstIp, "192.168.1.1", 16);
|
||||
strncpy(gScanLastIp, "192.168.1.100", 16);
|
||||
|
||||
strncpy(name, "Modbus", elCount(name));
|
||||
strncpy(fnSysvar, "generated.vsysvar", elCount(fnSysvar));
|
||||
strncpy(fnDbc, "generated.dbc", elCount(fnDbc));
|
||||
}
|
||||
|
||||
on start
|
||||
{
|
||||
if (gIps.Size() == 0)
|
||||
DetectDevices();
|
||||
else
|
||||
MakeFiles();
|
||||
}
|
||||
|
||||
void PutString(file f, char str[])
|
||||
{
|
||||
f.PutString(str, strlen(str));
|
||||
}
|
||||
|
||||
void MakeFiles()
|
||||
{
|
||||
MakeIpNets();
|
||||
GenSysvars();
|
||||
GenDbc();
|
||||
stop();
|
||||
}
|
||||
|
||||
// Sort the IPs from gIps to gIpsSorted and add their subnet to gIpNets
|
||||
void MakeIpNets()
|
||||
{
|
||||
long ipN;
|
||||
for (long i : gIps)
|
||||
{
|
||||
ipN = ipGetAddressAsNumber(gIps[i]); // convert IP to dword
|
||||
strncpy(gIpsSorted[ipN], gIps[i], 16);
|
||||
gIps.Remove(i);
|
||||
|
||||
gIpNets[(ipN >> 16) & 0xFF] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Generate the SysVars XML
|
||||
void GenSysvars()
|
||||
{
|
||||
write("GenSysvars() -> %s", fnSysvar);
|
||||
f.Open(fnSysvar, 0, 0); // rewrite file in ASCII
|
||||
|
||||
PutString(f, "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
|
||||
PutString(f, "<systemvariables version=\"4\">\n");
|
||||
PutString(f, " <namespace name=\"\" comment=\"\">\n");
|
||||
|
||||
PutString(f, " <namespace name=\"Config\" comment=\"\">\n");
|
||||
PutString(f, " <namespace name=\"Modbus\" comment=\"\">\n");
|
||||
PutString(f, " <variable anlyzLocal=\"2\" readOnly=\"false\" valueSequence=\"false\" unit=\"ms\" name=\"RequestTimeout\" comment=\"The maximum duration for a Modbus-UDP/-TCP request in milliseconds. After timeout a retransmission may be started (see MaxRetransmissionCount). Use `ping` to get the maximum latency to a device, double it and add 2-3 ms for processing.\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\"5\" minValue=\"1\" minValuePhys=\"1\" maxValue=\"1000\" maxValuePhys=\"1000\" />\n");
|
||||
PutString(f, " <variable anlyzLocal=\"2\" readOnly=\"false\" valueSequence=\"false\" unit=\"\" name=\"Port\" comment=\"\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\"502\" minValue=\"1\" minValuePhys=\"1\" maxValue=\"65535\" maxValuePhys=\"65535\" />\n");
|
||||
PutString(f, " <variable anlyzLocal=\"2\" readOnly=\"false\" valueSequence=\"false\" unit=\"times\" name=\"MaxTransmissionCount\" comment=\"How often a retransmission of a request will be sent until it gets discarded and an error is thrown.\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\"3\" minValue=\"1\" minValuePhys=\"1\" maxValue=\"10\" maxValuePhys=\"10\" />\n");
|
||||
PutString(f, " </namespace>\n");
|
||||
PutString(f, " <namespace name=\"TcpIp\" comment=\"\">\n");
|
||||
PutString(f, " <variable anlyzLocal=\"2\" readOnly=\"false\" valueSequence=\"false\" unit=\"\" name=\"AdapterIndex\" comment=\"Index of network interface to use\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\"2\" minValue=\"1\" minValuePhys=\"1\" maxValue=\"20\" maxValuePhys=\"20\" />\n");
|
||||
PutString(f, " </namespace>\n");
|
||||
PutString(f, " </namespace>\n");
|
||||
|
||||
for (long net : gIpNets)
|
||||
{
|
||||
char netS[4];
|
||||
ltoa(net, netS, 10);
|
||||
|
||||
PutString(f, " <namespace name=\"Ethernet");
|
||||
PutString(f, netS);
|
||||
PutString(f, "\" comment=\"Subnet: 192.168.");
|
||||
PutString(f, netS);
|
||||
PutString(f, ".\">\n");
|
||||
|
||||
for (long ipN : gIpsSorted)
|
||||
{
|
||||
char ipS[16];
|
||||
char ipSlast[4];
|
||||
|
||||
if (((ipN >> 16) & 0xFF) != net)
|
||||
continue;
|
||||
|
||||
strncpy(ipS, gIpsSorted[ipN], 16); // copy IP address to local ipS
|
||||
ltoa(ipN >> 24, ipSlast, 10); // convert the last byte (= first byte) to string
|
||||
write("GenSysvars: %s", ipS);
|
||||
|
||||
PutString(f, " <namespace name=\"Client_");
|
||||
//PutString(f, netS);
|
||||
//PutString(f, "_");
|
||||
PutString(f, ipSlast);
|
||||
PutString(f, "\" comment=\"Server with ip address '");
|
||||
PutString(f, ipS);
|
||||
PutString(f, "'\">\n");
|
||||
|
||||
PutString(f, " <namespace name=\"Config\" comment=\"Configuration section for this server\">\n");
|
||||
|
||||
PutString(f, " <variable anlyzLocal=\"2\" readOnly=\"false\" valueSequence=\"false\" unit=\"\" name=\"IP\" comment=\"The IP address of this server\" bitcount=\"8\" isSigned=\"true\" encoding=\"65001\" type=\"string\" startValue=\"");
|
||||
PutString(f, ipS);
|
||||
PutString(f, "\" />\n");
|
||||
|
||||
PutString(f, " <variable anlyzLocal=\"2\" readOnly=\"false\" valueSequence=\"false\" unit=\"ms\" name=\"Interval\" comment=\"The interval with which the device will be queried\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\"100\" minValue=\"10\" minValuePhys=\"10\" maxValue=\"10000\" maxValuePhys=\"10000\" />\n");
|
||||
PutString(f, " </namespace>\n");
|
||||
|
||||
PutString(f, " <namespace name=\"Info\" comment=\"Some information about the device\">\n");
|
||||
PutString(f, " <variable anlyzLocal=\"2\" readOnly=\"false\" valueSequence=\"false\" unit=\"\" name=\"SerialCode\" comment=\"The serial code of the server\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\"0\" minValue=\"1\" minValuePhys=\"1\" maxValue=\"10000\" maxValuePhys=\"10000\" />\n");
|
||||
PutString(f, " <variable anlyzLocal=\"2\" readOnly=\"false\" valueSequence=\"false\" unit=\"\" name=\"DeviceCode\" comment=\"The device code of the server\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\"0\" minValue=\"1\" minValuePhys=\"1\" maxValue=\"10000\" maxValuePhys=\"10000\" />\n");
|
||||
PutString(f, " <variable anlyzLocal=\"2\" readOnly=\"false\" valueSequence=\"false\" unit=\"\" name=\"Modules\" comment=\"The type and number of inputs of modules that are connected to the server\" bitcount=\"8\" isSigned=\"true\" encoding=\"65001\" type=\"string\" />\n");
|
||||
PutString(f, " <variable anlyzLocal=\"2\" readOnly=\"false\" valueSequence=\"false\" unit=\"\" name=\"InputRegisters\" comment=\"Number of input registers\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\"0\" minValue=\"0\" minValuePhys=\"0\" maxValue=\"123\" maxValuePhys=\"123\" />\n");
|
||||
PutString(f, " <variable anlyzLocal=\"2\" readOnly=\"false\" valueSequence=\"false\" unit=\"\" name=\"InputBits\" comment=\"Number of input bits\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\"0\" minValue=\"0\" minValuePhys=\"0\" maxValue=\"2000\" maxValuePhys=\"2000\" />\n");
|
||||
PutString(f, " <variable anlyzLocal=\"2\" readOnly=\"false\" valueSequence=\"false\" unit=\"\" name=\"OutputRegisters\" comment=\"Number of output registers\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\"0\" minValue=\"0\" minValuePhys=\"0\" maxValue=\"123\" maxValuePhys=\"123\" />\n");
|
||||
PutString(f, " <variable anlyzLocal=\"2\" readOnly=\"false\" valueSequence=\"false\" unit=\"\" name=\"OutputBits\" comment=\"Number of output bits\" bitcount=\"32\" isSigned=\"true\" encoding=\"65001\" type=\"int\" startValue=\"0\" minValue=\"0\" minValuePhys=\"0\" maxValue=\"2000\" maxValuePhys=\"2000\" />\n");
|
||||
PutString(f, " </namespace>\n");
|
||||
PutString(f, " <namespace name=\"Data\" comment=\"The actual process image\">\n");
|
||||
PutString(f, " <variable anlyzLocal=\"2\" readOnly=\"false\" valueSequence=\"false\" unit=\"\" name=\"InputRegisters\" comment=\"The values of the input registers\" bitcount=\"8\" isSigned=\"true\" encoding=\"65001\" type=\"data\" arrayLength=\"0\" />\n");
|
||||
PutString(f, " <variable anlyzLocal=\"2\" readOnly=\"false\" valueSequence=\"false\" unit=\"\" name=\"InputBits\" comment=\"The state of the input bits\" bitcount=\"8\" isSigned=\"true\" encoding=\"65001\" type=\"data\" arrayLength=\"0\" />\n");
|
||||
PutString(f, " <variable anlyzLocal=\"2\" readOnly=\"false\" valueSequence=\"false\" unit=\"\" name=\"OutputRegisters\" comment=\"The values of the output registers. Write here and the values will be sent to the device\" bitcount=\"8\" isSigned=\"true\" encoding=\"65001\" type=\"data\" arrayLength=\"0\" />\n");
|
||||
PutString(f, " <variable anlyzLocal=\"2\" readOnly=\"false\" valueSequence=\"false\" unit=\"\" name=\"OutputBits\" comment=\"The state of the output bits. Write here and the values will be sent to the device\" bitcount=\"8\" isSigned=\"true\" encoding=\"65001\" type=\"data\" arrayLength=\"0\" />\n");
|
||||
PutString(f, " </namespace>\n");
|
||||
PutString(f, " </namespace>\n");
|
||||
}
|
||||
PutString(f, " </namespace>\n");
|
||||
}
|
||||
|
||||
PutString(f, " </namespace>\n");
|
||||
PutString(f, "</systemvariables>\n");
|
||||
|
||||
f.Close();
|
||||
}
|
||||
|
||||
// Generate the Database
|
||||
void GenDbc()
|
||||
{
|
||||
write("GenDbc() -> %s", fnDbc);
|
||||
f.Open(fnDbc, 0, 0); // rewrite file in ASCII
|
||||
|
||||
PutString(f, "VERSION \"\"\n\n\n");
|
||||
PutString(f, "NS_ :\n");
|
||||
PutString(f, " NS_DESC_\n");
|
||||
PutString(f, " CM_\n");
|
||||
PutString(f, " BA_DEF_\n");
|
||||
PutString(f, " BA_\n");
|
||||
PutString(f, " VAL_\n");
|
||||
PutString(f, " CAT_DEF_\n");
|
||||
PutString(f, " CAT_\n");
|
||||
PutString(f, " FILTER\n");
|
||||
PutString(f, " BA_DEF_DEF_\n");
|
||||
PutString(f, " EV_DATA_\n");
|
||||
PutString(f, " ENVVAR_DATA_\n");
|
||||
PutString(f, " SGTYPE_\n");
|
||||
PutString(f, " SGTYPE_VAL_\n");
|
||||
PutString(f, " BA_DEF_SGTYPE_\n");
|
||||
PutString(f, " BA_SGTYPE_\n");
|
||||
PutString(f, " SIG_TYPE_REF_\n");
|
||||
PutString(f, " VAL_TABLE_\n");
|
||||
PutString(f, " SIG_GROUP_\n");
|
||||
PutString(f, " SIG_VALTYPE_\n");
|
||||
PutString(f, " SIGTYPE_VALTYPE_\n");
|
||||
PutString(f, " BO_TX_BU_\n");
|
||||
PutString(f, " BA_DEF_REL_\n");
|
||||
PutString(f, " BA_REL_\n");
|
||||
PutString(f, " BA_DEF_DEF_REL_\n");
|
||||
PutString(f, " BU_SG_REL_\n");
|
||||
PutString(f, " BU_EV_REL_\n");
|
||||
PutString(f, " BU_BO_REL_\n");
|
||||
PutString(f, " SG_MUL_VAL_\n");
|
||||
PutString(f, "\n");
|
||||
PutString(f, "BS_:\n");
|
||||
PutString(f, "\nBU_:");
|
||||
|
||||
for (long ipN : gIpsSorted)
|
||||
{
|
||||
char ipS[16];
|
||||
char ipSlast[4];
|
||||
char netS[4];
|
||||
|
||||
strncpy(ipS, gIpsSorted[ipN], 16); // copy IP address to local ipS
|
||||
ltoa(ipN >> 24, ipSlast, 10); // convert the last byte (= first byte) to string
|
||||
ltoa((ipN >> 16) & 0xFF, netS, 10);
|
||||
write("GenDbc: %s", ipS);
|
||||
|
||||
PutString(f, " Client_");
|
||||
//PutString(f, netS);
|
||||
//PutString(f, "_");
|
||||
PutString(f, ipSlast);
|
||||
}
|
||||
PutString(f, "\n\n\n\n");
|
||||
PutString(f, "BA_DEF_ BU_ \"NodeLayerModules\" STRING ;\n");
|
||||
PutString(f, "BA_DEF_ \"DBName\" STRING ;\n");
|
||||
PutString(f, "BA_DEF_ \"BusType\" STRING ;\n");
|
||||
PutString(f, "BA_DEF_DEF_ \"NodeLayerModules\" \"Ethernet_IL.DLL\";\n");
|
||||
PutString(f, "BA_DEF_DEF_ \"DBName\" \"\";\n");
|
||||
PutString(f, "BA_DEF_DEF_ \"BusType\" \"Ethernet\";\n");
|
||||
PutString(f, "BA_ \"BusType\" \"Ethernet\";\n");
|
||||
PutString(f, "BA_ \"DBName\" \"");
|
||||
PutString(f, name);
|
||||
PutString(f, "\";\n");
|
||||
|
||||
f.Close();
|
||||
}
|
||||
|
||||
void DetectDevices()
|
||||
{
|
||||
write("Scanning from %s to %s with timeout of %d ms", gScanFirstIp, gScanLastIp, @sysvar::Config::Modbus::RequestTimeout);
|
||||
gScanFirst = ipGetAddressAsNumber(gScanFirstIp);
|
||||
gScanLast = ipGetAddressAsNumber(gScanLastIp);
|
||||
ModbusConnectTo(gScanFirst, 502);
|
||||
ModbusReadBits(0, 1);
|
||||
}
|
||||
|
||||
void DetectDevicesNext()
|
||||
{
|
||||
// next IP
|
||||
// 0xFE...... --> Skip xxx.xxx.xxx.255 which is broadcast address in 192.168.xxx.0 nets
|
||||
if ((gScanFirst & 0xFFFFFF00) == 0xFEFFFF00)
|
||||
{
|
||||
gScanFirst &= 0x000000FF;
|
||||
gScanFirst += 0x00000001;
|
||||
}
|
||||
else if ((gScanFirst & 0xFFFF0000) == 0xFEFF0000)
|
||||
{
|
||||
gScanFirst &= 0x0000FFF;
|
||||
gScanFirst += 0x00000100;
|
||||
}
|
||||
else if ((gScanFirst & 0xFF000000) == 0xFE000000)
|
||||
{
|
||||
gScanFirst &= 0x00FFFFFF;
|
||||
gScanFirst += 0x00010000;
|
||||
}
|
||||
else
|
||||
{
|
||||
gScanFirst += 0x01000000;
|
||||
}
|
||||
if (gScanFirst == gScanLast)
|
||||
{
|
||||
MakeFiles();
|
||||
return;
|
||||
}
|
||||
gRemoteIP = gScanFirst; // Don't open new socket, it takes too much time.
|
||||
ModbusReadBits(0, 1);
|
||||
}
|
||||
|
||||
|
||||
// Modbus events ----------------------------------------------------------------------
|
||||
void OnModbusReadBitsFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap)
|
||||
{
|
||||
DetectDevicesNext();
|
||||
}
|
||||
void OnModbusReadBitsSuccess(struct ModbusResReceiveBits mbr, byte bitStatus[], word numBits)
|
||||
{
|
||||
ipGetAddressAsString(gScanFirst, gIps[gScanFirst], 16);
|
||||
DetectDevicesNext();
|
||||
}
|
||||
void OnModbusReadRegistersFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
||||
void OnModbusWriteBitFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
||||
void OnModbusWriteRegisterFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
||||
void OnModbusWriteMasksFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
||||
void OnModbusReadWriteRegistersFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
||||
void OnModbusWriteBitsFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
||||
void OnModbusWriteRegistersFailed(enum ModbusRequestError error, enum ModbusException ex, struct ModbusApHeader mbap){}
|
||||
void OnModbusReadRegistersSuccess(struct ModbusResReceiveRegisters mbr, word numRegs){}
|
||||
void OnModbusWriteBitSuccess(struct ModbusResConfirmSingle mbc){}
|
||||
void OnModbusWriteRegisterSuccess(struct ModbusResConfirmSingle mbc){}
|
||||
void OnModbusWriteBitsSuccess(struct ModbusResConfirmMultiple mbc){}
|
||||
void OnModbusWriteRegistersSuccess(struct ModbusResConfirmMultiple mbc){}
|
||||
void OnModbusWriteMasksSuccess(struct ModbusResConfirmMasks mbc){}
|
4860
Modbus/MakeConfig.cfg
Normal file
4860
Modbus/MakeConfig.cfg
Normal file
File diff suppressed because it is too large
Load diff
49
Modbus/MakeConfig.dbc
Normal file
49
Modbus/MakeConfig.dbc
Normal file
|
@ -0,0 +1,49 @@
|
|||
VERSION ""
|
||||
|
||||
|
||||
NS_ :
|
||||
NS_DESC_
|
||||
CM_
|
||||
BA_DEF_
|
||||
BA_
|
||||
VAL_
|
||||
CAT_DEF_
|
||||
CAT_
|
||||
FILTER
|
||||
BA_DEF_DEF_
|
||||
EV_DATA_
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
SIG_GROUP_
|
||||
SIG_VALTYPE_
|
||||
SIGTYPE_VALTYPE_
|
||||
BO_TX_BU_
|
||||
BA_DEF_REL_
|
||||
BA_REL_
|
||||
BA_DEF_DEF_REL_
|
||||
BU_SG_REL_
|
||||
BU_EV_REL_
|
||||
BU_BO_REL_
|
||||
SG_MUL_VAL_
|
||||
|
||||
BS_:
|
||||
|
||||
BU_: MakeConfig
|
||||
|
||||
|
||||
|
||||
|
||||
BA_DEF_ BU_ "NodeLayerModules" STRING ;
|
||||
BA_DEF_ "DBName" STRING ;
|
||||
BA_DEF_ "BusType" STRING ;
|
||||
BA_DEF_DEF_ "NodeLayerModules" "ETHERNET_IL.dll";
|
||||
BA_DEF_DEF_ "DBName" "";
|
||||
BA_DEF_DEF_ "BusType" "Ethernet";
|
||||
BA_ "BusType" "Ethernet";
|
||||
BA_ "DBName" "MakeConfig";
|
||||
|
165
Modbus/MakeConfig.ini
Normal file
165
Modbus/MakeConfig.ini
Normal file
|
@ -0,0 +1,165 @@
|
|||
[View_Vehicles]
|
||||
HIDDEN=
|
||||
ORDER=0,1,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,150,
|
||||
[View_Vehicle]
|
||||
HIDDEN=
|
||||
ORDER=0,1,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,
|
||||
[View_VehicleNetworks]
|
||||
HIDDEN=3,5,
|
||||
ORDER=0,1,2,3,4,
|
||||
DEFINITIONS=2,3,
|
||||
COLUMNWIDTHS=125,125,100,100,150,100,100,
|
||||
[View_VehicleNetwork]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,
|
||||
DEFINITIONS=1,
|
||||
COLUMNWIDTHS=125,125,100,125,150,100,
|
||||
[View_VehicleNetworkTxMessages]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,55,100,50,100,100,100,150,
|
||||
[View_VehicleNetworkSignals]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,100,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_VehicleControlUnit]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,
|
||||
DEFINITIONS=1,
|
||||
COLUMNWIDTHS=125,125,100,125,150,100,
|
||||
[View_VehicleGateways]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,
|
||||
[View_VehicleGatewaySignals]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,125,125,125,125,125,
|
||||
[View_Networks]
|
||||
HIDDEN=2,4,
|
||||
ORDER=0,1,2,3,
|
||||
DEFINITIONS=2,3,
|
||||
COLUMNWIDTHS=125,100,100,150,100,100,
|
||||
[View_Network]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,
|
||||
DEFINITIONS=1,
|
||||
COLUMNWIDTHS=125,125,100,150,100,
|
||||
[View_NetworkTxMessages]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,55,100,50,100,100,100,150,
|
||||
[View_NetworkTxSignals]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,100,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_NetworkNodeGroup]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,
|
||||
DEFINITIONS=1,
|
||||
COLUMNWIDTHS=125,100,150,100,
|
||||
[View_Ecus]
|
||||
HIDDEN=
|
||||
ORDER=0,1,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,150,
|
||||
[View_Ecu]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,
|
||||
DEFINITIONS=1,
|
||||
COLUMNWIDTHS=125,125,100,150,100,
|
||||
[View_EnvVars]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,100,100,50,50,50,50,100,100,150,
|
||||
[View_EnvVar]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,100,50,50,50,50,100,100,150,
|
||||
[View_NodeGroups]
|
||||
HIDDEN=
|
||||
ORDER=0,1,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,150,
|
||||
[View_NodeGroup]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,55,150,
|
||||
[View_Nodes]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,
|
||||
DEFINITIONS=1,
|
||||
COLUMNWIDTHS=125,100,150,100,
|
||||
[View_Node]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_NodeTxMessages]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,55,100,50,100,100,150,
|
||||
[View_NodeTxMsg]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_NodeTxSignals]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_NodeRxSignals]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_NodeTxSigs]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_NodeRxSigs]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_Messages]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,55,100,50,100,100,100,150,
|
||||
[View_Message]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_Signals]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_ValueTables]
|
||||
HIDDEN=
|
||||
ORDER=0,1,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,150,
|
||||
[View_AttrDefs]
|
||||
HIDDEN=6,
|
||||
ORDER=0,1,2,3,4,5,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,100,100,50,50,100,150,
|
47
Modbus/generated.dbc
Normal file
47
Modbus/generated.dbc
Normal file
|
@ -0,0 +1,47 @@
|
|||
VERSION ""
|
||||
|
||||
|
||||
NS_ :
|
||||
NS_DESC_
|
||||
CM_
|
||||
BA_DEF_
|
||||
BA_
|
||||
VAL_
|
||||
CAT_DEF_
|
||||
CAT_
|
||||
FILTER
|
||||
BA_DEF_DEF_
|
||||
EV_DATA_
|
||||
ENVVAR_DATA_
|
||||
SGTYPE_
|
||||
SGTYPE_VAL_
|
||||
BA_DEF_SGTYPE_
|
||||
BA_SGTYPE_
|
||||
SIG_TYPE_REF_
|
||||
VAL_TABLE_
|
||||
SIG_GROUP_
|
||||
SIG_VALTYPE_
|
||||
SIGTYPE_VALTYPE_
|
||||
BO_TX_BU_
|
||||
BA_DEF_REL_
|
||||
BA_REL_
|
||||
BA_DEF_DEF_REL_
|
||||
BU_SG_REL_
|
||||
BU_EV_REL_
|
||||
BU_BO_REL_
|
||||
SG_MUL_VAL_
|
||||
|
||||
BS_:
|
||||
|
||||
BU_: Client_2
|
||||
|
||||
|
||||
|
||||
BA_DEF_ BU_ "NodeLayerModules" STRING ;
|
||||
BA_DEF_ "DBName" STRING ;
|
||||
BA_DEF_ "BusType" STRING ;
|
||||
BA_DEF_DEF_ "NodeLayerModules" "Ethernet_IL.DLL";
|
||||
BA_DEF_DEF_ "DBName" "";
|
||||
BA_DEF_DEF_ "BusType" "Ethernet";
|
||||
BA_ "BusType" "Ethernet";
|
||||
BA_ "DBName" "Modbus";
|
165
Modbus/generated.ini
Normal file
165
Modbus/generated.ini
Normal file
|
@ -0,0 +1,165 @@
|
|||
[View_Vehicles]
|
||||
HIDDEN=
|
||||
ORDER=0,1,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,150,
|
||||
[View_Vehicle]
|
||||
HIDDEN=
|
||||
ORDER=0,1,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,
|
||||
[View_VehicleNetworks]
|
||||
HIDDEN=3,5,
|
||||
ORDER=0,1,2,3,4,
|
||||
DEFINITIONS=2,3,
|
||||
COLUMNWIDTHS=125,125,100,100,150,100,100,
|
||||
[View_VehicleNetwork]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,
|
||||
DEFINITIONS=1,
|
||||
COLUMNWIDTHS=125,125,100,125,150,100,
|
||||
[View_VehicleNetworkTxMessages]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,55,100,50,100,100,100,150,
|
||||
[View_VehicleNetworkSignals]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,100,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_VehicleControlUnit]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,
|
||||
DEFINITIONS=1,
|
||||
COLUMNWIDTHS=125,125,100,125,150,100,
|
||||
[View_VehicleGateways]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,
|
||||
[View_VehicleGatewaySignals]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,125,125,125,125,125,
|
||||
[View_Networks]
|
||||
HIDDEN=2,4,
|
||||
ORDER=0,1,2,3,
|
||||
DEFINITIONS=2,3,
|
||||
COLUMNWIDTHS=125,100,100,150,100,100,
|
||||
[View_Network]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,
|
||||
DEFINITIONS=1,
|
||||
COLUMNWIDTHS=125,125,100,150,100,
|
||||
[View_NetworkTxMessages]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,55,100,50,100,100,100,150,
|
||||
[View_NetworkTxSignals]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,100,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_NetworkNodeGroup]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,
|
||||
DEFINITIONS=1,
|
||||
COLUMNWIDTHS=125,100,150,100,
|
||||
[View_Ecus]
|
||||
HIDDEN=
|
||||
ORDER=0,1,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,150,
|
||||
[View_Ecu]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,
|
||||
DEFINITIONS=1,
|
||||
COLUMNWIDTHS=125,125,100,150,100,
|
||||
[View_EnvVars]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,100,100,50,50,50,50,100,100,150,
|
||||
[View_EnvVar]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,100,50,50,50,50,100,100,150,
|
||||
[View_NodeGroups]
|
||||
HIDDEN=
|
||||
ORDER=0,1,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,150,
|
||||
[View_NodeGroup]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,55,150,
|
||||
[View_Nodes]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,
|
||||
DEFINITIONS=1,
|
||||
COLUMNWIDTHS=125,100,150,100,
|
||||
[View_Node]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_NodeTxMessages]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,55,100,50,100,100,150,
|
||||
[View_NodeTxMsg]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_NodeTxSignals]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_NodeRxSignals]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_NodeTxSigs]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_NodeRxSigs]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_Messages]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,55,100,50,100,100,100,150,
|
||||
[View_Message]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,125,100,50,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_Signals]
|
||||
HIDDEN=
|
||||
ORDER=0,1,2,3,4,5,6,7,8,9,10,11,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,50,100,100,100,50,50,50,50,100,100,150,
|
||||
[View_ValueTables]
|
||||
HIDDEN=
|
||||
ORDER=0,1,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,150,
|
||||
[View_AttrDefs]
|
||||
HIDDEN=6,
|
||||
ORDER=0,1,2,3,4,5,
|
||||
DEFINITIONS=
|
||||
COLUMNWIDTHS=125,100,100,50,50,100,150,
|
38
Modbus/generated.vsysvar
Normal file
38
Modbus/generated.vsysvar
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<systemvariables version="4">
|
||||
<namespace name="" comment="">
|
||||
<namespace name="Ethernet1" comment="Subnet: 192.168.1.">
|
||||
<namespace name="Client_2" comment="Server with ip address '192.168.1.2'">
|
||||
<namespace name="Config" comment="Configuration section for this server">
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="IP" comment="The IP address of this server" bitcount="8" isSigned="true" encoding="65001" type="string" startValue="192.168.1.2" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="ms" name="Interval" comment="The interval with which the device will be queried" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="100" minValue="10" minValuePhys="10" maxValue="10000" maxValuePhys="10000" />
|
||||
</namespace>
|
||||
<namespace name="Info" comment="Some information about the device">
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="InputRegisters" comment="Number of input registers" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="0" minValue="0" minValuePhys="0" maxValue="123" maxValuePhys="123" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="Modules" comment="The type and number of inputs of modules that are connected to the server" bitcount="8" isSigned="true" encoding="65001" type="string" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="SerialCode" comment="The serial code of the server" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="0" minValue="1" minValuePhys="1" maxValue="10000" maxValuePhys="10000" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="DeviceCode" comment="The device code of the server" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="0" minValue="1" minValuePhys="1" maxValue="10000" maxValuePhys="10000" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="InputBits" comment="Number of input bits" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="0" minValue="0" minValuePhys="0" maxValue="2000" maxValuePhys="2000" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="OutputBits" comment="Number of output bits" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="0" minValue="0" minValuePhys="0" maxValue="2000" maxValuePhys="2000" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="OutputRegisters" comment="Number of output registers" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="0" minValue="0" minValuePhys="0" maxValue="123" maxValuePhys="123" />
|
||||
</namespace>
|
||||
<namespace name="Data" comment="The actual process image">
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="InputRegisters" comment="The values of the input registers" bitcount="32" isSigned="true" encoding="65001" type="intarray" arrayLength="1" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="InputBits" comment="The state of the input bits" bitcount="32" isSigned="true" encoding="65001" type="intarray" arrayLength="2" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="OutputBits" comment="The state of the output bits. Write here and the values will be sent to the device" bitcount="32" isSigned="true" encoding="65001" type="intarray" arrayLength="16" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="OutputRegisters" comment="The values of the output registers. Write here and the values will be sent to the device" bitcount="32" isSigned="true" encoding="65001" type="intarray" arrayLength="1" />
|
||||
</namespace>
|
||||
</namespace>
|
||||
</namespace>
|
||||
<namespace name="Config" comment="">
|
||||
<namespace name="Modbus" comment="">
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="ms" name="RequestTimeout" comment="The maximum duration for a Modbus-UDP/-TCP request in milliseconds. After timeout a retransmission may be started (see MaxRetransmissionCount). Use `ping` to get the maximum latency to a device, double it and add 2-3 ms for processing." bitcount="32" isSigned="true" encoding="65001" type="int" startValue="5" minValue="1" minValuePhys="1" maxValue="1000" maxValuePhys="1000" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="Port" comment="" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="502" minValue="1" minValuePhys="1" maxValue="65535" maxValuePhys="65535" />
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="times" name="MaxTransmissionCount" comment="How often a retransmission of a request will be sent until it gets discarded and an error is thrown." bitcount="32" isSigned="true" encoding="65001" type="int" startValue="3" minValue="1" minValuePhys="1" maxValue="10" maxValuePhys="10" />
|
||||
</namespace>
|
||||
<namespace name="TcpIp" comment="">
|
||||
<variable anlyzLocal="2" readOnly="false" valueSequence="false" unit="" name="AdapterIndex" comment="Index of network interface to use" bitcount="32" isSigned="true" encoding="65001" type="int" startValue="2" minValue="1" minValuePhys="1" maxValue="20" maxValuePhys="20" />
|
||||
</namespace>
|
||||
</namespace>
|
||||
</namespace>
|
||||
</systemvariables>
|
Loading…
Reference in a new issue