Choosing which DM1s to display based on addr

Discuss issues and ideas you have to configuring displays with PowerVision
mwalker

Choosing which DM1s to display based on addr

Post by mwalker » Tue Jun 07, 2011 4:39 pm

I have just read the topic "Displaying all the active faults on screen at a time".
Would it be possible to choose which ones to display based on source address? We have a scenario where the customer has 5 devices and visualises them all generating DM1s. He does not want, say, only the engine ones to display. The DM1sInTableExample config plus John's DM1ApplicationDescription will probably show me how to do this, but I would appreciate any thoughts on the topic.
bseidl

Re: Choosing which DM1s to display based on addr

Post by bseidl » Tue Jul 05, 2011 12:35 pm

Hello mwalker

You could filter out the DM1s by using scripting or a state machine to look at the source address before it displays on the screen. Using the DM1InTableExample config, there is a script called "UpdateDM1List." Before it does the update, you could use an "if statement" to check for the Source Address. Below is that script with the "if statement" that allows the table to update only if the Source Address is not equal to 1.



void $EventName ()
{
double SourceAddr;

smRead(dm1_handles[Dm1_SourceAddress],SourceAddr);

if (SourceAddr != 1) //Here is where it checks the source address
{

// this code runs when the DM1 app has populated the DM1 variables with valid values.
// we need to read these values out, and put them in our array.

// check to see if we need to resize our list.
if(dm1List.length() < (dm1Count + 1) )
{
dm1List.resize(dm1Count+1);
}


// using shared memory API, read the values into the list.
smRead( dm1_handles[Dm1_DeviceNameId], dm1List[dm1Count].device );
smRead( dm1_handles[Dm1_PlugId], dm1List[dm1Count].plug );
smRead( dm1_handles[Dm1_SourceAddress], dm1List[dm1Count].source );
smRead( dm1_handles[Dm1_SPN], dm1List[dm1Count].spn );
smRead( dm1_handles[Dm1_FMI], dm1List[dm1Count].fmi );
smRead( dm1_handles[Dm1_OccuranceCount], dm1List[dm1Count].count);
smRead( dm1_handles[Dm1_IsActive], dm1List[dm1Count].status);
smRead( dm1_handles[Dm1_DiagnosticStringId], dm1List[dm1Count].diagnosticString);
smRead( dm1_handles[Dm1_CorrectiveActionString], dm1List[dm1Count].correctiveActionString);


// increment dm1Count for next DM1.
dm1Count++;
}
}



Brad Seidl