[De...] Posted June 28, 2018 Share Posted June 28, 2018 As the title says, I am looking to use a pcm variable in piWeb. My goal is to show the duration of the run on the header of my report. I have created a modified version of the StandardProtocol.ptx in a measurement plan directory and it assigned it using the options for multiple printout for ease of modification and testing. I was able to modify most things on the header the way I wanted without any real trouble, however it does not appear that duration of run is one of the available variables. Hopefully the fact it is not there does not indicate this is impossible. To give a bit of background on where I am at, So far I have done the following.. Used Resources -> Design Custom Printout -> Editor for User Defined Printout Header Variables to define a variable u_RunDuration with the name RunDuration I then assign a default value to u_RunDuration in Plan -> Advanced -> Parameter (Not sure this is necessary but it never hurts to have a default value, and since piWeb seems to be a 'live' type of report I though it might be.) Next in postsettings, I added u_RunDuration = getRecordHead("durationofrun") (I have tested and u_RunDuration is being set correctly. On the Multiple Printout -> Select printout header parameters page, I have checked off both columns for RunDuration - should these be checked? No idea - other posts seemed to make it sound like it, however the help file made it sound like this was more for what could be edited or not. Either way checked them both, also have tried with none checked and first just one and then the other checked. So far has not seemed to make a difference .. who knows? lol Finally I get to the report itself where I want to use the variable - so now the question.. How can I use the variable in the report? I cant seem to choose it from the variable picker. I am not sure what formula might be used to 'call' the variable. I cannot just put the variable name, since it will just show up as text. I am guessing this should not be difficult, however I cannot find anywhere in the help where it says HOW to use the variable from pcm in the report, just that its possible. Link to comment Share on other sites More sharing options...
[To...] Posted June 28, 2018 Share Posted June 28, 2018 What version of Calypso? Don't quote me but I believe user variables have a limited role in 2017 and non-existent in 2016. Also, 2016 did not include the variable "MeasurementDuration" It is available on 2017. Link to comment Share on other sites More sharing options...
[To...] Posted June 28, 2018 Share Posted June 28, 2018 Please sign in to view this quote. This option is to allow you to view the field in either the Run window, as a Run Variable, under Printout Header Data or as an Edit Variable under Resources - Printout Header Parameters. Link to comment Share on other sites More sharing options...
[La...] Posted June 28, 2018 Share Posted June 28, 2018 Tom's right, depending on your version of Calypso there is a much easier way of getting this into a report... If you're using an older version of Calypso (like 6.0 I think) then you will go Text Box > Right click > Variable... A box will come up, type in "property" and you'll see a line item come up named Name-Value-Pair. Then type in "u_RunDuration". Now, run something so there is actually information there and you should see this populate. Once there is information collected and you're in Designer, you can press F5 to refresh the page. Link to comment Share on other sites More sharing options...
[De...] Posted June 28, 2018 Author Share Posted June 28, 2018 First thanks for the quick replies.. Second, in reply, I am on 6.4.1404 (2017) , so apparently there should be a MeasurementDuration variable hiding somewhere. I am not sure where else to look, since I have even searched for the variable using the search function (Maybe cause i'm not on piWeb Plus?) Where might I find this elusive variable? Anyhow assuming I just wanted to get a variable working to see how it works, I removed the checkmarks from RunDuration under "Select Printout header parameters" since it is clearly not something that I want to assign under resources or printout header parameters since its not a static value - although its good to know what those actually do now - so thanks for the info. I have the following in the text property under general properties for my 'text' element in the header of the report, originally I had RunDuration not u_RunDuration. ${Qdb.Property("u_RunDuration")} However it does not seem to populate, I am not quite sure what I am doing wrong. Link to comment Share on other sites More sharing options...
[To...] Posted June 28, 2018 Share Posted June 28, 2018 Add a Text Field, right-click in the field, Variable > Select Variable - Data Provider / General / select Name-Value-Pair. In the Key field type "MeasurementDuration" You might try typing your user variable in here to see if it works for user fields. Link to comment Share on other sites More sharing options...
[De...] Posted June 28, 2018 Author Share Posted June 28, 2018 OK well the good news is your method works and I now have duration on my report, which was after all my original intent. The bad news is my variable still wont show up, using the same method. The code I posted earlier.. is what you get with a name value pair. ${Qdb.Property("MeasurementDuration")} works great.. 😃 ${Qdb.Property("u_RunDuration")} does not.. 😭 Link to comment Share on other sites More sharing options...
[To...] Posted June 28, 2018 Share Posted June 28, 2018 Somebody on the forum must know how to do this. Have you checked out the PiWeb Help file? C:\Program Files (x86)\Zeiss\CALYPSO 6.4\bin\PiWebReporting\manual.pdf There might be some insight that helps. Link to comment Share on other sites More sharing options...
[No...] Posted June 29, 2018 Share Posted June 29, 2018 Please sign in to view this quote. There's your problem. A header field is not the same as a PCM variable! How did you test that 'u_RunDuration' was set correctly? For a demonstration try this in pre- or post settings: Enter these lines: u_RunDuration="MickeyMouse" getRecordHead("u_RunDuration") Mark the first line with the mouse and click the evaluation button (magnifying glass). Then mark the second line and click evaluation again. The header variable is empty, or if it's not, it's not "MickeyMouse". Solution: Instead of u_RunDuration= getRecordHead.... use this: setRecordHead("u_RunDuration", getRecordHead("durationofrun")) Link to comment Share on other sites More sharing options...
[De...] Posted June 29, 2018 Author Share Posted June 29, 2018 Thanks for the info Norbert, totally forgot about setRecordHead() Originally I was testing just by using a message .. something still isn't quite right though.. I now have the following, and I get 'testing' from my message so its setting the header variable, I am not however getting anything inside piWeb. // set header var setRecordHead("u_RunDuration","testing") // now read to check var = getRecordHead("u_RunDuration") // report response.. message(var) I will have to read through the manual some more and see if it gives me any ideas of what I might be missing.. Link to comment Share on other sites More sharing options...
[No...] Posted July 2, 2018 Share Posted July 2, 2018 If your Calypso version was older I would have guessed that your report header misses a root data binding. This was necessary in the early versions to make u_... fields show up in the header. But in recent versions this is no longer needed (or is it already part of the standard templates?). Unfortunately I'm a bit at war with PiWeb's report templates. I don't really like editing them, since I always have to struggle endlessly with the most simple things. So I'm not much help when it comes to mysteries like data bindings etc. I'd suggest to test first with a report derived from a standard template without any other changes. Place a text field without variables and check if it's visible. If it is, add the variable and check again. If the variable field is still visible you'll have to check what's different in your own template. If it's not, something's wrong with PiWeb 😕 Link to comment Share on other sites More sharing options...
[Ca...] Posted January 31, 2022 Share Posted January 31, 2022 Hello Community I have the same problem with PiWeb. Put my PCM variable inside presetting with an external program that ask the operator for the PartNumber, all operate right, I use the PartNumber as FileName for my own database App, but not way to include it in report header LOL!!!! Now thinking in my own report based on Database, but that is the wheel reinventing again! PiWeb reporting plus 7.4.14.0 Please help with PiWeb! extra Note: at the end I have inserted the variables with the same name, no more u_... and I have used the: setRecordHead("PartNumber", PART_NUMBER_) setRecordHead("LotNumber", LOT_NUMBER_) ... for each of my variables that we want to use in report. So, they appear on the dialog attached. Alles in Ordnung noch einmal!. All is Ok now with the PCM variables inside piWeb Report Here an overview the option to insert the variable in Report that was functional for me: Are there other ways? Link to comment Share on other sites More sharing options...
[La...] Posted February 1, 2022 Share Posted February 1, 2022 Sie sollten Ihre benutzerdefinierten CALYPSO-Benutzerfelder unter Variablen --> Data Provider --> Measurement. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in