Problem with OptoScript - old forum post


#1

jkelly

Joined on 01-25-2005
Posts 2
Problem with Opto Script

I’ve encountered a new problem that I have never seen before and frankly I’m stumped. I’ve created some Opto scripts using OptoControl 4.0c (optocdb 4.0a) and the blocks are getting skipped by the controller. I’m sure the blocks have the correct syntax because at one point they worked fine. It just seems like when i re-downloaded to the controller some of them stop working. When i go into debug mode and try to step into the block, the controller just steps right over it. The strange part is that if i create a new optoscript block, then cut and paste the code from the faulty block to the new block, it executes fine. Normally I would just do this and be done with it but i’m not sure how many of my other blocks have been effected. Has anyone ever seen or heard of something like this. I’m using windows XP service pack 2 and a SNAP-LCM4 controller with the latest kernel (4.1e i think)
Report
01-25-2005, 2:04 PM
Jeff Owens

Joined on 11-19-2003
Irving, TEXAS!
Posts 15
Re: Problem with Opto Script

The only time I have seen anything similar, I had “moved” a connection destination from one block to another. When the program ran, it followed the old path, rather than the new one. (I’m not sure what version software I was using, it was some time ago). Since then, as common practice, I will delete a connection and re-draw a new one, rather than move it. This creates a connection with a new id number, and eliminates any possible confusion with the old item.
Report
01-26-2005, 8:54 AM
rhernandez

Joined on 11-26-2003
Madrid - SPAIN
Posts 42
Re: Problem with Opto Script

I’ve experienced something similar: When you create blocks, it’s very easy to click the mouse twice instead of once. This creates two identical blocks, one on top of the other (which is invisible). When you enter OptoScript code, it goes to the block on top, then it is possible that the link goes to the one hidden so your OptoScript won’t execute. Moreover, if the exit link is ‘tied’ to the block on top, then the chart will stop. If you still have the possibility, please check there is nothing under the ‘slippery’ block
Report
01-27-2005, 12:07 PM
jkelly

Joined on 01-25-2005
Posts 2
Re: Problem with Opto Script

I’ve posted this same question to opto22 technical support and they have responded with an answer. The problem is due to a known bug in optocontrol concerning unterminated comment blocks. In other words for every open comment /* you need to terminate it with a close comment /. It doesn’t matter where in the strategy this is done because it can effect various other parts of the same strategy. I made the mistake of only placing the open comment / and the not the close in an optoscript block in one chart and it effected an optoscript block in a completely different chart. So i followed opto22 tech supports suggestion and terminated my comment. Since doing that my code has been executing just as i would expect it to. I hope this helps you guys from making the same mistake and thank you for your replys.