[Is...] Posted June 5, 2020 Share Posted June 5, 2020 Is it possible to detect by PCM when a feature is empty(no results)?: Currently I’m doing it generating characteristics and then comparing the getActual("Characteristic").actual with the nominal value, but this is not functional in many cases Link to comment Share on other sites More sharing options...
[Ro...] Posted June 5, 2020 Share Posted June 5, 2020 Well it should never be empty if its set up right, so once it is up and running it should never be empty again. Unless its a feature that doesn't run every cycle due to a miniplan. am i missing something? Link to comment Share on other sites More sharing options...
[Ia...] Posted June 5, 2020 Share Posted June 5, 2020 If I had to guess, he is trying to clean up his programs. Some of mine are littered with features I never ended up using. Link to comment Share on other sites More sharing options...
[Is...] Posted June 5, 2020 Author Share Posted June 5, 2020 ... Link to comment Share on other sites More sharing options...
[Ro...] Posted June 5, 2020 Share Posted June 5, 2020 So i like using code len() because in this case the statement will be either True or False, True=4 characters, False=5 characters, so depending on the answer of isParameterDefined is yes or no then the answer will be eithet 4 or 5 characters long, and you can write your if statement to react to 4 or 5. You need a characteristic tho, but you can mask it so it doesnt show up in your report. Play around with that, see if it works. xoxo=isParameterDefined("#10 Distance,actual") Length=len("xoxo") if Length == 4 then //Do Something message("Hey yo, TB3N is looking good") endif if Length == 5 then //Do Something message("Hey yo, TB3N is F'dup") endif Link to comment Share on other sites More sharing options...
[Is...] Posted June 5, 2020 Author Share Posted June 5, 2020 ... Link to comment Share on other sites More sharing options...
[Er...] Posted June 7, 2020 Share Posted June 7, 2020 .isErrorResult is the correct boolean message. But you can't send it to a double. Thats just not how it works... Here is a simple example showing you how to correctly use that boolean function: for i = 1 to baseSystem().machine.inspection.protocol.protDictionary.keys.size if getParameterNamed(baseSystem().machine.inspection.protocol.protDictionary,i).value.isErrorResult display(getParameterNamed(baseSystem().machine.inspection.protocol.protDictionary,i).key) endif next i Note, this will not give you features, it will give you characteristics. With features, errors usually have a error level below 0. Eg. -1 to -5. 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