I assume you are working with Psi v12.x and "inspect" is not highlighted
I think -for what ever reason- "inspect" is not interpreted as simtalk code in v12.x
for the time being work with simtalk 2.0 -code ( e.g. switch...case)
What do you mean with "having problems"? Could you be a bit more specific?
Do you get a compilation error when you apply the source code (then you are probably using a SimTalk 2.0 Method in Plant Simulation 12.x), or do get an error when executing the Method, or does the Method not do what you expect?
The string comparison is case-sensitive. So you must write:
when "Working" then
Alternatively you can write:
when "working" then
Could you upload a small example model?
Without it I cannot help you.
when the singleproc is failed the energyState also is failed; the inspect statement works correct;
I guess your intention is to wait for the end of the failure of the singleproc. Therefore I have changed the inspect to a waituntil.