Commit 3d091e4a authored by Claes's avatar Claes

Hilscher cifX, diagnosis info extended

parent 27f2171e
......@@ -62,9 +62,23 @@ static void get_diag( pwr_sClass_Hilscher_cifX_Diag *diag, CIFXHANDLE chan)
if ( sts == CIFX_NO_ERROR) {
diag->SystemStatus = statusblock.ulSystemStatus;
diag->SystemError = statusblock.ulSystemError;
diag->TimeSinceStart.tv_sec = statusblock.ulTimeSinceStart;
diag->CpuLoad = (float) statusblock.usCpuLoad / 100.0;
}
}
NETX_COMMON_STATUS_BLOCK csb = {0};
sts = xChannelCommonStatusBlock( chan, CIFX_CMD_READ_DATA, 0, sizeof(csb), &csb);
if ( sts == CIFX_NO_ERROR) {
diag->CommState = csb.ulCommunicationState;
diag->CommError = csb.ulCommunicationError;
diag->ErrorCount = csb.ulErrorCount;
diag->ConfigSlaves = csb.uStackDepended.tMasterStatusBlock.ulNumOfConfigSlaves;
diag->ActiveSlaves = csb.uStackDepended.tMasterStatusBlock.ulNumOfActiveSlaves;
diag->SlaveState = csb.uStackDepended.tMasterStatusBlock.ulSlaveState;
}
sts = xChannelHostState( chan, CIFX_HOST_STATE_READ, &state, 0);
if ( sts == CIFX_NO_ERROR) {
diag->HostState = state;
......@@ -134,7 +148,7 @@ static pwr_tStatus IoAgentInit( io_tCtx ctx,
op->Diag.SystemError = boardinfo.ulSystemError;
local->channel = 0;
// CHANNEL_INFORMATION channelinfo = {{0}};
local->chan = NULL;
......@@ -145,6 +159,17 @@ static pwr_tStatus IoAgentInit( io_tCtx ctx,
return IO__INITFAIL;
}
CHANNEL_INFORMATION channelinfo = {{0}};
sts = xDriverEnumChannels( driver, board, local->channel, sizeof(channelinfo), &channelinfo);
if ( sts == CIFX_NO_ERROR) {
strncpy( op->Diag.FirmwareName, (char *)channelinfo.abFWName, sizeof(op->Diag.FirmwareName));
snprintf( op->Diag.FirmwareVersion, sizeof(op->Diag.FirmwareVersion),
"%u.%u.%u-%u (%4u-%02hu-%02hu)", channelinfo.usFWMajor, channelinfo.usFWMinor,
channelinfo.usFWBuild, channelinfo.usFWRevision, channelinfo.usFWYear,
channelinfo.bFWMonth, channelinfo.bFWDay);
}
// Init the I/O area
unsigned int input_area_offset = 0;
unsigned int input_area_chansize = 0;
......
Volume OtherIO $ClassVolume 0.0.250.10
Body SysBody 01-JAN-1970 01:00:00.00
Attr NextOix = "_X203"
Attr NextOix = "_X212"
Attr NextCix = "_X21"
Attr NextTix[0] = "_X8"
Attr NextTix[0] = "_X10"
EndBody
Object Type $TypeHier 1 15-NOV-2007 14:35:37.90
Object MotionControl_StatusEnum $TypeDef 1 15-NOV-2007 14:36:24.17
......@@ -464,6 +464,79 @@ Volume OtherIO $ClassVolume 0.0.250.10
EndBody
EndObject
EndObject
Object Hilscher_cifX_CommStateEnum $TypeDef 8 11-MAR-2011 09:57:02.13
Body SysBody 11-MAR-2011 09:57:13.54
Attr TypeRef = "pwrs:Type-$Enum"
Attr Elements = 1
EndBody
Object Unknown $Value 204 11-MAR-2011 09:57:25.59
Body SysBody 11-MAR-2011 09:57:27.92
Attr Text = "Unknown"
Attr PgmName = "Unknown"
EndBody
EndObject
Object Offline $Value 208 11-MAR-2011 09:57:47.63
Body SysBody 11-MAR-2011 09:57:50.59
Attr Text = "Offline"
Attr PgmName = "Offline"
Attr Value = 1
EndBody
EndObject
Object Stop $Value 207 11-MAR-2011 09:57:57.39
Body SysBody 11-MAR-2011 09:58:03.69
Attr Text = "Stop"
Attr PgmName = "Stop"
Attr Value = 2
EndBody
EndObject
Object Idle $Value 206 11-MAR-2011 09:58:09.22
Body SysBody 11-MAR-2011 09:58:15.87
Attr Text = "Idle"
Attr PgmName = "Idle"
Attr Value = 3
EndBody
EndObject
Object Operate $Value 205 11-MAR-2011 09:58:34.38
Body SysBody 11-MAR-2011 09:58:36.21
Attr Text = "Operate"
Attr PgmName = "Operate"
Attr Value = 4
EndBody
EndObject
EndObject
Object Hilscher_cifX_SlaveStateEnum $TypeDef 9 11-MAR-2011 10:08:09.85
Body SysBody 11-MAR-2011 10:08:21.31
Attr TypeRef = "pwrs:Type-$Enum"
Attr Elements = 1
EndBody
Object Undefined $Value 209 11-MAR-2011 10:08:33.45
Body SysBody 11-MAR-2011 10:08:35.56
Attr Text = "Undefined"
Attr PgmName = "Undefined"
EndBody
EndObject
Object Ok $Value 212 11-MAR-2011 10:08:46.88
Body SysBody 11-MAR-2011 10:08:49.67
Attr Text = "Ok"
Attr PgmName = "Ok"
Attr Value = 1
EndBody
EndObject
Object Failed $Value 211 11-MAR-2011 10:08:55.87
Body SysBody 11-MAR-2011 10:09:01.70
Attr Text = "Failed"
Attr PgmName = "Failed"
Attr Value = 2
EndBody
EndObject
Object Warning $Value 210 11-MAR-2011 10:09:07.83
Body SysBody 11-MAR-2011 10:09:12.14
Attr Text = "Warning"
Attr PgmName = "Warning"
Attr Value = 3
EndBody
EndObject
EndObject
EndObject
Object Class $ClassHier 2 15-NOV-2007 14:35:40.72
!/**
......@@ -2695,42 +2768,116 @@ Volume OtherIO $ClassVolume 0.0.250.10
Object RtBody $ObjBodyDef 1 04-MAR-2011 14:16:34.29
Body SysBody 04-MAR-2011 14:16:34.29
Attr StructName = "Hilscher_cifX_Diag"
Attr NextAix = "_X7"
Attr NextAix = "_X17"
EndBody
Object DeviceNumber $Attribute 3 04-MAR-2011 14:29:58.06
Body SysBody 04-MAR-2011 14:30:05.37
Body SysBody 11-MAR-2011 10:01:35.56
Attr PgmName = "DeviceNumber"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object SerialNumber $Attribute 4 04-MAR-2011 14:30:15.60
Body SysBody 04-MAR-2011 14:30:08.10
Body SysBody 11-MAR-2011 10:01:42.88
Attr PgmName = "SerialNumber"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object FirmwareName $Attribute 15 11-MAR-2011 11:13:13.95
Body SysBody 11-MAR-2011 11:13:29.65
Attr Flags = 16778240
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
Object FirmwareVersion $Attribute 16 11-MAR-2011 11:13:42.31
Body SysBody 11-MAR-2011 11:13:32.93
Attr Flags = 16778240
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
Object SystemError $Attribute 5 04-MAR-2011 14:30:29.02
Body SysBody 04-MAR-2011 14:30:22.30
Body SysBody 11-MAR-2011 10:01:48.67
Attr PgmName = "SystemError"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object SystemStatus $Attribute 6 04-MAR-2011 14:31:01.22
Body SysBody 04-MAR-2011 14:30:51.54
Body SysBody 11-MAR-2011 10:01:55.81
Attr PgmName = "SystemStatus"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object TimeSinceStart $Attribute 7 11-MAR-2011 09:53:27.01
Body SysBody 11-MAR-2011 10:02:03.22
Attr PgmName = "TimeSinceStart"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$DeltaTime"
EndBody
EndObject
Object CpuLoad $Attribute 8 11-MAR-2011 09:53:50.36
Body SysBody 11-MAR-2011 10:02:09.47
Attr PgmName = "CpuLoad"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
Object CommState $Attribute 9 11-MAR-2011 09:54:28.93
Body SysBody 11-MAR-2011 10:02:14.79
Attr PgmName = "CommState"
Attr Flags = 1024
Attr TypeRef = "OtherIO:Type-Hilscher_cifX_CommStateEnum"
EndBody
EndObject
Object CommError $Attribute 10 11-MAR-2011 09:54:46.70
Body SysBody 11-MAR-2011 10:02:19.62
Attr PgmName = "CommError"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ErrorCount $Attribute 11 11-MAR-2011 09:55:06.60
Body SysBody 11-MAR-2011 10:02:24.52
Attr PgmName = "ErrorCount"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ConfigSlaves $Attribute 12 11-MAR-2011 09:55:20.72
Body SysBody 11-MAR-2011 10:02:29.55
Attr PgmName = "ConfigSlaves"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object ActiveSlaves $Attribute 13 11-MAR-2011 09:55:28.90
Body SysBody 11-MAR-2011 10:02:38.38
Attr PgmName = "ActiveSlaves"
Attr Flags = 1024
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
Object SlaveState $Attribute 14 11-MAR-2011 09:55:39.61
Body SysBody 11-MAR-2011 10:10:14.15
Attr PgmName = "SlaveState"
Attr Flags = 1024
Attr TypeRef = "OtherIO:Type-Hilscher_cifX_SlaveStateEnum"
EndBody
EndObject
Object HostState $Attribute 1 04-MAR-2011 14:17:52.72
Body SysBody 04-MAR-2011 14:17:13.46
Body SysBody 11-MAR-2011 10:17:10.58
Attr PgmName = "HostState"
Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags = 1024
Attr TypeRef = "pwrb:Type-ReadyNotReadyEnum"
EndBody
EndObject
Object BusState $Attribute 2 04-MAR-2011 14:17:45.36
Body SysBody 04-MAR-2011 14:17:30.59
Body SysBody 11-MAR-2011 10:03:59.20
Attr PgmName = "BusState"
Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags = 1024
Attr TypeRef = "pwrb:Type-OnOffEnum"
EndBody
EndObject
EndObject
......@@ -2907,7 +3054,6 @@ Volume OtherIO $ClassVolume 0.0.250.10
Object FloatRepresentation $Attribute 16 09-MAR-2011 17:32:02.70
Body SysBody 09-MAR-2011 17:33:34.38
Attr PgmName = "FloatRepresentation"
Attr Flags = 16777216
Attr TypeRef = "pwrb:Type-FloatRepEnum"
EndBody
EndObject
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment