[Ri...] Posted September 5, 2023 Share Posted September 5, 2023 Below is some PCM used in a Result element. It converts Celsius (C) to Fahrenheit (F). (getTemperatureCorrection().temperaturePart)* 1.8) + 32) 1. I need to pass this value to a variable: "u_TempStart". 2. How do I use this in a Result element? Can I use it in a Result element? 3. I would like it converted for F. 4. "u_TempStart" is passed to PiWeb. (This part is working without the F conversion) in Post Settings. setRecordHead("u_TempStart", (getTemperatureCorrection().temperaturePart)) getRecordHead("u_TempStart") Any assistance is appreciated. Link to comment Share on other sites More sharing options...
[Mi...] Posted September 6, 2023 Share Posted September 6, 2023 Hello! I don't think that setRecordHead("u_TempStart", (getTemperatureCorrection().temperaturePart)) work in a result element. In general the pre- or post-settings are meant for assignments. Why don't you put (getTemperatureCorrection().temperaturePart)* 1.8) + 32) in the result element directly? As far as I know, the temperature of the workpiece is only measured at the beginning of the CNC-start. Link to comment Share on other sites More sharing options...
[Ri...] Posted September 6, 2023 Author Share Posted September 6, 2023 We are not using Compensation, we are just recording a temperature value at Start and End of the programs. I believe you are correct that setRecordHead("u_TempStart", (getTemperatureCorrection().temperaturePart)) will not work in a result element. I attaching the PCM to features. In the first temp sensor feature Post settings: StartTemp=(getActual("u_TempStart").temperature) StartTemp=formatL(StartTemp,3,1) setRecordHead("u_TempStart",StartTemp) The End temp sensor feature Post settings: EndTemp=(getActual("u_TempEnd").temperature) EndTemp=formatL(EndTemp,3,1) setRecordHead("u_TempEnd",EndTemp) Then in the last feature prior to the End temp sensor: (Forces the temp sensor to run). getActual("Temp End").temperature It would be a lot simpler if we could do this. (See attached image).Climate Change.JPG Link to comment Share on other sites More sharing options...
[Mi...] Posted September 6, 2023 Share Posted September 6, 2023 I assume you use the workpiece senors and not the temperature probe. You can also use a separate result element with readActualWPTemperature("1+2") for the start and end temperature. Link to comment Share on other sites More sharing options...
[Ri...] Posted September 8, 2023 Author Share Posted September 8, 2023 I am using a RST-T temp sensor. Link to comment Share on other sites More sharing options...
[No...] Posted September 11, 2023 Share Posted September 11, 2023 Please sign in to view this quote. I'm not sure if I'm missing the point here. In my understanding you already successfully converted the value to °F and are also able to assign it to the header variable with setRecordHead. But why do you want to use setRecordHead() in the result element formula? I would do all the calculations in the presettings of whatever feature or characteristic and assign the result to a PCM variable: myTemp=(getTemperatureCorrection().temperaturePart)* 1.8) + 32) Then use the contents of the PCM variable in the result element or wherever you see fit, by just stating it in the formula: myTemp Or am I missing something important? 😕 Link to comment Share on other sites More sharing options...
[Ri...] Posted September 11, 2023 Author Share Posted September 11, 2023 "setRecordHead" is used for passing the data to a variable. This is used to pass the data to a custom PiWeb Template. Link to comment Share on other sites More sharing options...
[No...] Posted September 12, 2023 Share Posted September 12, 2023 Please sign in to view this quote. But why does it need to happen in the result element (formula)? Link to comment Share on other sites More sharing options...
[Ri...] Posted September 12, 2023 Author Share Posted September 12, 2023 It doesn't, It was an attempt to accomplish the task, but it was the wrong way. 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