Jump to content

Read environment variable to fill out protocol head variables possible?


---
 Share

Recommended Posts

Dear colleagues,

As much of CALYPSO still dates back to the 1990s, when IT was simply a tool and usually worked, I’m hoping for the standard functionality of that era.
Virtually every piece of software (even CATIA...) could be controlled or enhanced via environment variables. One example is the batch files, which still work well as user exits.

Now I would like to trigger a user input via one of these batch files, *calculation_end.bat*. I would then like to use this input – for example, a name – as a log header variable in a PiWeb log. We do not have PCM, which is probably the biggest limitation for such functionality.

So is there a way to get an environment variable into PiWeb somehow?
e.g. Zaphod_Beeblebrox=42  as environment variable

Best Regards
Karsten

Link to comment
Share on other sites

Chris, Abbas
Thank you very much for your help.

My question was about external variables that are NOT defined in CALYPSO but come from the Windows system – in other words, a user’s environment variables.
Alternatively, a way in which I can, for example, upload external test characteristics for a measurement to the (local) PiWeb database.
Example:
A measurement taken using a hand-held device that writes the data to a file. Then upload this data to the PiWeb database.
 

Regards
Karsten

Link to comment
Share on other sites

If I am following properly.

You may be able to use a PowerShell script to read the user environment variables desired and append to the measurements taken from a hand-held device file and if this is completed prior to running the program, could you use variables in Calypso Post settings to get this data to PiWeb?

I am not sure how to create the variables that would transfer to PiWeb, I haven't looked into that.

I have somewhat of what you are doing less user environment variables and calling the data at the end of the program run with:

inspection_end.bat (Starts the ps1 file)

inspection_end.ps1

I will look into what if any of my variables are being used for PiWeb information.

Link to comment
Share on other sites

Please sign in to view this quote.

I was just testing while

Please sign in to view this username.

 posted.

Example:

run powershell script with PCM:

$filepathvar = $PSScriptRoot

('Curuser="{0}"' -f $env:USERNAME) | Out-File "$filepathvar\input2.para" -Encoding UTF8

in Calypso:

readPCMFile(input2.para)
setRecordHead("Curusertest",Curuser)' 

modify PiWeb report.

 

Screenshot2026-07-16142700.png.97d593994a0b3cd3e9c2d32f2557843b.png

 

Edited
Link to comment
Share on other sites

 Share

×
×
  • Create New...