Accessing DM1 List from scripting

Discuss issues and ideas you have to configuring displays with PowerVision
mzainuddin
Posts: 14
Joined: Sat Jan 31, 2015 11:35 pm

Accessing DM1 List from scripting

Post by mzainuddin » Thu Mar 03, 2016 2:30 am

Hello,

I'm using PV780 - Powervision 2.7/2.8, May I access the DM1 List from scripting?
The ListManager API seems only to work with custom list.

Thanks
stalley
Enovation Controls Development
Enovation Controls Development
Posts: 618
Joined: Tue Mar 18, 2014 12:57 pm

Re: Accessing DM1 List from scripting

Post by stalley » Thu Mar 03, 2016 2:53 pm

Hello mzainuddin,

There are some functions you can use the ListManager to work with the ListDataType object for the DM1 lists, in particular, the ListManagerNext(), ListManagerPrevious(), ListManagerGetCount().

You can also directly get and set the DTC Message strings. cultureGetString(DMStringIDs.SPN_FMI__28_3, localString,0);
Sara Talley
Software Engineer
Enovation Controls
mzainuddin
Posts: 14
Joined: Sat Jan 31, 2015 11:35 pm

Re: Accessing DM1 List from scripting

Post by mzainuddin » Sat Mar 05, 2016 10:55 pm

Hello Sara,

I'm already proficient in the use of ListManager API, I can do whatever I need with custom list, like in the following code snippet,

Code: Select all

CustomListData data;

data.WriteInt(CustomListColumn.MY_COLUMN_1);	
data.WriteString(CustomListColumn.MY_COLUMN_2);
data.WriteDouble(CustomListColumn.MY_COLUMN_3);	

ListManagerLock(ListDataType.MY_CUSTOM_LIST);
ListManagerAddItem(ListDataType.MY_CUSTOM_LIST,data);
ListManagerUnlock(ListDataType.MY_CUSTOM_LIST);
But the columns of the DM1 (and all the one belonging to a predefined list) are not listed as CustomListColumn.

There some suitable function:
void ListManagerGetItem( uint ListManagerType, uint index, &ListStructure struct)
void ListManagerSetItem( uint ListManagerType, uint index, &ListStructure struct)

but I cannot find a way to use them, mainly because I have no documentation on how to instance and how to use a ListStructure object.

Could you please provide a script that shows the usage of both the above mentioned functions?

Thanks
stalley
Enovation Controls Development
Enovation Controls Development
Posts: 618
Joined: Tue Mar 18, 2014 12:57 pm

Re: Accessing DM1 List from scripting

Post by stalley » Mon Mar 07, 2016 10:04 am

Hello mzainuddin,

You cannot use those particular functions with the DM1 and DM2 lists from scripting. There is not a direct way from a script to add and remove records in the Diagnostic Messages lists.

PowerVision Configuration Studio provides the display the ability to add and remove records from the Diagnostic Messages lists using the DM1.Internal* variables.

The SPN/FMI/Message need to be in the Library\DTC Setup.

I have attached a demo config that shows how to raise an internal fault in a script. Just like faults received over CAN, the fault will drop out of the DM1 list when it has been acknowledged and has not been refreshed within five seconds.

The config is very basic so if you have additional questions, I'll be glad to help with more details.
Attachments
Demo - Internal DMs.zip
(688.39 KiB) Downloaded 31 times
Sara Talley
Software Engineer
Enovation Controls
mzainuddin
Posts: 14
Joined: Sat Jan 31, 2015 11:35 pm

Re: Accessing DM1 List from scripting

Post by mzainuddin » Mon Mar 07, 2016 10:57 pm

Hello Sara,

I've already used the internal fault messages and variable so the configuration you send is not addressing my concerns.
Please consider that I do not want to Add/Remove items from DM1 List (that is managed directly by the DM1 application). I only need to read the values of the columns in the List.

Thanks