How to get localized variable title from logtable?

2 Posts
2 Users
0 Likes
18 Views
(@admin_doc72)
Posts: 493
Member Admin
Topic starter
 

Hello all,

My customer has the following problem in a multilingual project:
For statistical data he is trying execute a certain query on the log table created by PcVue.

The resultset is displayed in PcVue mimics by using SCADA Basic.
Since this is a bilingual project there are certain problems with the description of the logs. The description is always logged in the primary language. The presentation of the data in a PcVue mimic on the other hand shall be bilingual.

I have discussed two possible solution approaches with the customer:

  • Upon retrieval of the resultset in SCADA Basic iterate through it and find the variable titles in the current language according to the variable name in the resultset (VARIABLE("LONGLABEL")). This solution is not very good in terms of performance (and also not completely straight forward in regard to SCADA Basic scripting...).
  • Create a stored procedure which performs the query on the log table and which also uses a join to some other table which has knowledge about the variable title in both project languages. Like so:

    VariableTitleLookupTable:
    VarName | Description_Lang1 | Description_Lang2

The second solution is the preferred solution but it has one drawback: How should the lookup table be populated? Of course, this needs to be dynamic. The project configuration tool of the customer does not have the capacity to write engineering data to the database. The idea was to rather do this on startup of the PcVue project with the help of a SvManager. But here again we find some limitations of PcVue's bilinguality. The SvManager API may browse all variables and also read their titles but only in the active presentation language.

Do you know if it is possible to switch languages in the Sv Manager API?
Or is there any other way to request both variable titles?

How do you usually workaround this kind of limitations?

 
Posted : 04/02/2014 10:45 pm
n.kunzer
(@n-kunzerarcinfo-com)
Posts: 1236
Member Moderator
 

Hmmm why not working around B)

Let say L1 is German and L2 is English.
Today the project is running in L1 then the Description recorded is in German. But, you want to display the English description after requesting the DB.

Now, let's invert the L1 and L2 in the Varexp.
L1 = English
L2 = German
Set PcVue to display the project in L2.
Now you are sure that PcVue will record the English description.

Something wrong?

 
Posted : 06/02/2014 12:39 pm