BUG in deleting State Machine

drphil69
Posts: 139
Joined: Wed Mar 02, 2011 5:59 pm

BUG in deleting State Machine

Post by drphil69 » Thu Jul 14, 2011 11:24 am

Hello,

I think I have found a bug -

1.) Version of Configuration Tool being used: 2.2
2.) Model Number of Unit, PV750, Pv450, etc: PV750
3.) Operating System: WinXP, Bootloader 2.0
4.) Clear and accurate instructions so we may recreate and troubleshoot the issue.

In my program, I created a script called "CheckPassword," which is used for entering a password protected screen, and it works just fine (thanks to help from this forum!). I also created a State Machine, called "CheckDataLog," which has nothing to do with the aforementioned script. I no longer need the State Machine, and when I deleted the State Machine, the name for my "CheckPassword" script disappears, and I get a compile error as references disappear. The script is still there, but the name is blank, and I cannot put a name in it (it immediately disappears when I click off of it).

If you would like a copy of the program, let me know, I will send it via private message, as it is proprietary so I do not want it public. The obvious work around is to not delete the state machine, simple enough.

Thanks,
Phil
Jstoner
Posts: 8
Joined: Tue Jan 25, 2011 12:46 pm

Re: BUG in deleting State Machine

Post by Jstoner » Thu Jul 14, 2011 11:38 am

I've also had things like this happen. Delete something and get a reasonable list of bad references, but there are always one or two on there that you just didn't think referenced that... It's happened to events too.
jtabb
Enovation Controls Development
Enovation Controls Development
Posts: 37
Joined: Mon Apr 04, 2011 8:59 am

Re: BUG in deleting State Machine

Post by jtabb » Thu Aug 04, 2011 7:58 am

I was trying to reproduce this bug and wasn't able to. Could either of you send me steps to make a config that will cause a problem like this or send me a PM with your configuration so I can capture this bug?

Thanks,
jtabb
FW Murphy Development Team
mbowdich
Posts: 209
Joined: Tue Oct 05, 2010 10:54 am

Re: BUG in deleting State Machine

Post by mbowdich » Thu Aug 04, 2011 8:22 am

I have found it is based on the string characters, not specifically the entire reference. I have been plagued by this for some time, but explaining it is relatively difficult without showing.

Attached is an example that you can play with. Look at the string in the script. Then change the name of the transition "B" in the state machine and you will see that the string in the script will change to match. After looking at the configuration, you can decide if you want to read the long-winded description of it below.

For example, I had a script that was using case statements to look at individual characters in a string (a, b, c, ..., 1, 2, etc.). It would work normally, but occasionally when I would change something in a state machine or a database variable, my script would stop working correctly (but would compile). When reviewing the script, I would see that my string "B" was changed to something else. I had this happen a few times with different strings (including event references).

What is going on, and what may help you repeat it:

Since "B" is in the strings list because of plug B, if you pause for too long when creating or modifying a name or string (with only the B character) in the non-script area of the PVStudio, the software automatically thinks that it is now named "B". As you then finish or change the name, it automatically updates any reverence (or string for that matter) to "B" in in the system, including scripts. Unfortunately, it does not know the difference between a reference and an ordinary string in the script.

I think that the scripts should be completely eliminated from any automatic reference updating and should have to be manually updated.
Attachments
referenceissue.zip
(1.95 MiB) Downloaded 11 times
jtabb
Enovation Controls Development
Enovation Controls Development
Posts: 37
Joined: Mon Apr 04, 2011 8:59 am

Re: BUG in deleting State Machine

Post by jtabb » Fri Aug 05, 2011 8:46 am

Thanks for the reply. I played around with it and characterized a few different behaviors of this bug and captured it in our bug tracking system. If any of three of you has other specific instances or configs where you see this problem please let me know steps to reproduce it or send me a config.

Thanks!
jtabb
FW Murphy Development Team
mbowdich
Posts: 209
Joined: Tue Oct 05, 2010 10:54 am

Re: BUG in deleting State Machine

Post by mbowdich » Fri Aug 05, 2011 12:23 pm

It occasionally happens when changing the string in the script, expecially with cut and pasted code, but it seems to be random in nature. This is a case where I have multiple identical string in the scripts and change 1 of them, all of them change. As I said, is is not all the time, and is random.
drphil69
Posts: 139
Joined: Wed Mar 02, 2011 5:59 pm

Re: BUG in deleting State Machine

Post by drphil69 » Wed Aug 10, 2011 3:13 pm

Hello,

Strangely enough, I tried deleting the State Machine again, and had no issues... not sure what I did or changed since then.

Phil