piputval and piputvalx issue

Hi,

I have an issue with piputval and piputvalx in MS excel VBA.

Fyi, I'm using MS Excel 2016 64 bit.

When I tried to use the sample file piexam64.xls in ...\PIPC\Excel only digital and string points that succesfully written in the PI archive, while all numeric data's were failed.

 

Is there any additional setup that I need to be done for this issue?

 

Thanks,

Rochim.

  • Hello Taufiqur,

     

    One thing to consider is the PI Point security. You need to make sure your account has write access to PI Points.

    The first thing to verify is with which credentials you are connected. PI SMT -> Operation -> Network Manager Statistics can be used for verification. The first thing to look out for is the application. If you see multiple connections from PI DataLink, you could look up your clients IP address in the PeerAddress column. Scroll to the right hand side and note the value in the Identity Column. You usually see multiple identities e.g. 'Operators | PI World'. PI World reflects the minimum access level and usually provides read access. So other identities showing may provide you write access.

     


    Clipboard01.jpg.jpg

     

    Now you could use PI SMT -> Points -> Point Builder to verify if one of the identities would allow yo to write.

     


    Clipboard02.jpg.jpg

     

    Another common problem is that even with write access, writes fail due to the PI Point being locked by a PI Buffer Subsystem instance. Interfaces nodes are usually have PI Buffer Subsystem set up and running to avoid any data loss in case connection loss. If a PI System infrastructure consists of redundant PI Data Archive nodes, those are also referred to as PI Collective. In such an environment, PI Buffer Subsystem also fulfills the task of fanning data to all Collective members. The PI Services on each member of a PI Collective run independently - with a few exceptions. PI Snapshot and PI Archive Subsystem on a Collective member do not communicate with their pendants on other member nodes. This theoretically introduces the chance that compression is applied differently. To avoid a PI Point on one Collective member has different data archived compared to another member, PI Buffer Subsystem send compressed events with a corresponding marker and this operation requires an exclusive lock on the PI Point.

    The error usually logged when the write fails due to the point being locked y a PI Buffer Subsystem instance is

     

    "[-11414] Buffered point does not accept new events"

     

    This brings us to how you could troubleshoot your issue or with other words, figure out what specific problem you are facing. The first thing to check is the local PI Message Log, the PI Message Log on your PI DataLink host. Pigetmsg.exe can be used to continuously print messages to a commend prompt and you could also redirect the output to a file.

     

    Open a commend prompt

    Change to the PIHOME (cd %pihome%)

    Change to the adm subfolder (cd adm)

    Use pigetmsg -f to continuously query PI Message Log.

    Use pigetmsg -f > c:\Temp\pimessagelog.txt to dump messages to a text file.

    [Strg] + can be used to interrupt / stop the session.

     

    It may be necessary to also check the PI Message Log on the PI Data Archive (in a PI Collective environment, the Primary). This works similar to what's described above except, the environment variable to refer is %piserver% instead of %pihome%.

  • Hello Gregor Back,

     

    Thank you for the reply.

    I will check the system and inform you the result.

  • Hello Gregor Beck,

     

    Sorry for wrong name on my first reply.

    From all suggested option that you have given, please refer to following:

    1. User Credential --> I have created user name that has write access to the point ( I event tried to use administrator account as well)

    2. Point Builder check --> The data owner have set to all tested point.

    3. PI Buffer Subsystem lock --> there is no error message that I can get from this test.

     

    For Additional information:

    - Only numeric points those are failed to be written, while for text and string points are working properly.

    - I have also test the similar excel file to older excel program (MS Office 2007 32 bit) and all points are successfully written.

  • Hello Taufiqur,

     

    Your observation suggests the issue is due to 64-bit Excel.

    Can you please make sure you PI DataLink 2019 (5.5) installed?

    Also, is there any information returned when writing to numeric PI Points fails?

    What about the local PI Message Log?

    What about the PI Message Log on the PI Data Archive?

     

    I have checked our Technical Support database but couldn't find previous cases. Please consider reaching out to Technical Support for investigation. 

  • Hello Gregor Beck,

     

    Sorry to led you to some confusion,

    I have check again, apparently the MS Office that I use is 2016 32 bit.

    And I'm currently using PI Datalink 2017 SP2.

     

    Regarding the return information from the writing test is blank (no return value):


    Excel+result.JPG.jpg

     

    While for the pigetmsg reply, please refer to following:


    pigetmsg.JPG.jpg

     

    While in PI Message log there is no message that related with this process.

  • Hello Taufiqur,

     

    I kind of reproduced your issue meanwhile. In my case, the default AF Server host wasn't running. I can confirm that the piputvalx macro behaves different depending on the value type. Let's do some debugging. This exercise requires the Developer ribbon being visible to access the Visual Basic code behind the button(s) labelled "Send above values".

     

    Please open the PutVal_code module inside the VBA Editor. There are 2 different methods "put_data1" and "put_data2". The piputvalx DataLink macro is called by "put_data2" method which is introduced by the following line of code:

     

    Sub put_data2()

     

    Inside the method exist 2 "while" loops. Within the first while loop, set the breakpoint to the last line before the "wend" command which is indicating the end of the loop.

     

    Now go back to the spreadsheet and click the second "Send above values" button. The debugger should break into the breakpoint and you should recognize this by excel changing back to the Visual Basic Editor window.

     

    Move your mouse cursor over "macroResult" variable to make its value visible at the mouse cursor. Please refer to the screenshot below.

     


    Clipboard01.jpg.jpg

     

    In my case the value of macroResult is "Cannot connect to server 'Pater Tuck'" which is the default AF Server I've configured on the client I've used for this test.

     

    What's macroResult reporting in your case?

  • Hello Gregor Beck,

     

    Please refer to following for the debug result in my case:

     


    pastedImage_1.png.png

  • For additional review,

    I have tried to swap the digital point on the top:


    Excel+result.JPG.jpg

     

    And the debug result for this case is as follow:


    pastedImage_3.png.png

  • Hello Taufiqur,

     

    You managed to change the exercise. LOL!

    "True" is returned by PIPutValx (and PIPutVal) in case of a successful write. How does this help us understanding what's causing failing writes?

  • Hello Gregor Beck,

     

    I just swap the data item in Cell C14 <--> C17 and Value in D14 <--> D17.

    Regading the failing root cause, I have no idea .