turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Navigation
- Tecnomatix
- Forums
- Blogs
- Knowledge Bases
- Groups

- Siemens PLM Community
- Tecnomatix
- Plant Simulation
- code problems

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-14-2016 05:58 AM

I'm having problems with "inspect....when":

inspect machine01.EnergyTargetState

when "working"

then

wait tU;

machine02.EnergyTargetState := "operational";

end;

can someone help me?

thanks

Solved! Go to Solution.

8 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-14-2016 08:52 AM

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

work around

for the time being work with simtalk 2.0 -code ( e.g. switch...case)

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-15-2016 02:29 AM

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?

_________________________________________________________________

Did you like the answer? Then click the Thumbs Up button.

Did the answer solve your problem? Then accept the answer as solution.

Did you like the answer? Then click the Thumbs Up button.

Did the answer solve your problem? Then accept the answer as solution.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-15-2016 03:44 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-15-2016 04:18 AM - edited 02-15-2016 04:22 AM

The string comparison is case-sensitive. So you must write:

inspect machine01.EnergyTargetState

when "**W**orking" then

...

Alternatively you can write:

inspect toLower(machine01.EnergyTargetState)

when "working" then

_________________________________________________________________

Did you like the answer? Then click the Thumbs Up button.

Did the answer solve your problem? Then accept the answer as solution.

Did you like the answer? Then click the Thumbs Up button.

Did the answer solve your problem? Then accept the answer as solution.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-15-2016 05:06 AM

Thanks Michael, I tried both suggestions but unfortunately the Method still doesn't work.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-15-2016 07:57 AM

Could you upload a small example model?

Without it I cannot help you.

_________________________________________________________________

Did you like the answer? Then click the Thumbs Up button.

Did the answer solve your problem? Then accept the answer as solution.

Did you like the answer? Then click the Thumbs Up button.

Did the answer solve your problem? Then accept the answer as solution.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-15-2016 09:18 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-15-2016 10:04 AM

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.

Kind regards

Karola

------------------------------------------------------------------------------------------------------

Did you like the answer? Then click the Thumbs Up button.

Did the answer solve your problem? Then accept the answer as solution.

Did you like the answer? Then click the Thumbs Up button.

Did the answer solve your problem? Then accept the answer as solution.

Follow Siemens PLM Software

© 2018 Siemens Product Lifecycle Management Software Inc