Timer Basic Script Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Timer Basic Script Problem

    I have been using this basic "timer" script that I was given on the forum for couple of months now. All of a sudden I get an error that states:

    "Error executing basic script"

    Does anyone have any idea why all of a sudden this would stop working ?



    The following script is what I am using.

    Sub main
    Dim TimeStarted
    Dim TotalTime
    Dim TimeDelay
    TimeStarted = Timer
    TimeDelay = Timer + 10
    Do
    TotalTime = TimeDelay - Timer
    If TotalTime < 0 Then
    Exit Do
    Else
    End If
    Loop
    End Sub
    DEA MISTRAL
    PC DMIS CAD++
    Version 2013
    Windows 7 64bit
    DataPage+ 2011 MR1

  • #2
    What is your Else statement for? There is no argument. Just the same it should read past that and throw you into the dreaded endless loop, I don't think you'll get an error you'll just get a script that runs for eternity.
    <internet bumper sticker goes here>

    Comment


    • #3
      I have never had a problem until now, always have used the script that way. I removed the Else statment and still have the same error.

      "Error executing basic script
      C:\PCDMIS\PCDMISW\PROGRAMS\TIMER.BAS : MAIN"


      Below is in the program:

      CS2 =SCRIPT/FILENAME= C:\PCDMIS\PCDMISW\PROGRAMS\TIMER.BAS
      FUNCTION/Main,SHOW=YES,,
      STARTSCRIPT/
      ENDSCRIPT/
      DEA MISTRAL
      PC DMIS CAD++
      Version 2013
      Windows 7 64bit
      DataPage+ 2011 MR1

      Comment


      • #4
        I'm not sure. I'd hate to tell you this but I have one machine that PCDMIS stopped running scripts on some time ago. I never figured it out. I think it is a system thing in my case perhaps a registry problem somewhere I just don't know. I have uninstalled PCDMIS and reinstalled it on that PC (for other reasons) and it still does not run scripts.

        In my case I am 3.73, perhaps you have the same problem. I hope by now enough people have had this issue that this gets solved.
        <internet bumper sticker goes here>

        Comment


        • #5
          Do you have any other scripts? In other words, can you run ANY script at all?????

          I had this happen to me, but I was unable to run ANY script.

          I suggest you create another script, a simple one that does hardly do anything. Try to run that one. If that one runs, you have a problem with the specific script.

          If the other script does also NOT run, please post the a screen capture of the EXACT error message that comes up when it fails.


          Jan.
          ***************************
          PC-DMIS/NC 2010MR3; 15 December 2010; running on 18 machine tools.
          Romer Infinite; PC-DMIS 2010 MR3; 15 December 2010.

          Comment


          • #6
            Just wondering, is the script still where it's supposed to be? delete the script code in the program and reinsert it.
            I used to be high on life but I built up a tolerance.

            Brown & Sharpe Global Advantage
            PCDMIS CAD++ v2011mr2
            PH10MQ/SP600M


            sigpic

            Comment


            • #7
              yes it is still in the same location. I did add some additional lines prior to the script code but that shouldn't matter
              DEA MISTRAL
              PC DMIS CAD++
              Version 2013
              Windows 7 64bit
              DataPage+ 2011 MR1

              Comment


              • #8
                Here is the same program cleaned up for clarity. It performs only one purpose which is to provide a delay for about 10 seconds.

                Note that I've changed the name of the Subroutine from main to delay.

                Sub delay
                ' Declare a variable To mark End of time value
                Dim TimeEnd As Single

                ' Set the variable With current timer value + amount of delay
                TimeEnd = Timer + 10

                ' Loop Until Timer passes End time value
                Do Until Timer > TimeEnd
                Loop

                End Sub

                Does this work for you?

                Comment


                • #9
                  As Jan D mentions - Do you have windows permission to execute scripts?

                  Comment


                  • #10
                    I will give that a shot. I probably won't get back to seeing if that works until later today or even tomorrow. Got pushed off on something HOT ! Somethings never change around here. I'll let you know. Thanks,
                    DEA MISTRAL
                    PC DMIS CAD++
                    Version 2013
                    Windows 7 64bit
                    DataPage+ 2011 MR1

                    Comment


                    • #11
                      Matt, do you know how to check the Registry Settings? There is one that is called: UnicodeScripts. It may be corrupted! That will not allow you to run ANY scripts, resulting in a similar message as what you indicate. It happened to me while I was copying and pasting scripts from 1 program to another.

                      The default value for this setting MUST be "false". In my case, it had corrupted to a "true" setting. Changing this one back to "false" might solve your problem.

                      Again, please post your exact error message and I will be able to tell whether you have the same problem.


                      Jan.
                      ***************************
                      PC-DMIS/NC 2010MR3; 15 December 2010; running on 18 machine tools.
                      Romer Infinite; PC-DMIS 2010 MR3; 15 December 2010.

                      Comment


                      • #12
                        A change in Anti-virus setting can also block scripts from running...

                        As suggested, test to see if ANY script will work.
                        Links to my utilities for PCDMIS

                        Comment


                        • #13
                          Originally posted by kneislyd View Post
                          Here is the same program cleaned up for clarity. It performs only one purpose which is to provide a delay for about 10 seconds.

                          Note that I've changed the name of the Subroutine from main to delay.

                          Sub delay
                          ' Declare a variable To mark End of time value
                          Dim TimeEnd As Single

                          ' Set the variable With current timer value + amount of delay
                          TimeEnd = Timer + 10

                          ' Loop Until Timer passes End time value
                          Do Until Timer > TimeEnd
                          Loop

                          End Sub

                          Does this work for you?




                          Keep in mind, if you change the name of the sub within the script, the reference within the part program must also be changed.

                          Comment


                          • #14
                            It will not let me run any scripts. I also tried to find the "UnicodeScripts" in the registry and could not locate it. Guess I will continue tomorrow. Had enough for today. I'm outta here for the day.

                            Thanks
                            DEA MISTRAL
                            PC DMIS CAD++
                            Version 2013
                            Windows 7 64bit
                            DataPage+ 2011 MR1

                            Comment


                            • #15
                              Run SettingsEditor.exe. It takes a while for it to get started. On the bottom there is a row of buttons. Click on the "Find" button. Type in the word scripts , and it will find the UnicodeScripts entry. Make sure it is 0. If it is NOT, change it and save it.

                              Be very careful in the SettingsEditor. It is easy to mess things up. I am just trying to help. If you are not sure about all this, call tech support and they can talk you through it. Don't change anything unless you are very sure about what you are doing!!!!!!!!!

                              Jan.
                              ***************************
                              PC-DMIS/NC 2010MR3; 15 December 2010; running on 18 machine tools.
                              Romer Infinite; PC-DMIS 2010 MR3; 15 December 2010.

                              Comment

                              Related Topics

                              Collapse

                              Working...
                              X