Triks-c driver prog...
 
Notifications
Clear all

Triks-c driver program

84 Posts
25 Users
0 Reactions
39.2 K Views
TimW
Posts: 554
 TimW
Topic starter
(@timw)
Honorable Member
Joined: 19 years ago

Hi Bob

By 'bombs' you mean exits nicely due to a port error or spins into hyperspace?

The code for actually opening the port has not changed much:

parameters=freefile
open "triksc.dat" for input as #parameters
    If Err Then
        PRINT
        Print "FAILED to open TRIKSC.DAT"
        Print "Would you like to setup (y/n)? ";
        decision=getkey
        print chr$(decision)
        if decision= asc("y") or decision=asc("Y") then
            close
            Goto setup
        else
            END
        endif
    Else
        Print "TRIKSC.DAT FOUND"
        line input #parameters,cp
        cp=rtrim(cp)
        line input #parameters,delays
        numpans=val(ltrim(delays))        
        line input #parameters,delays
        framedelay=val(ltrim(delays))
        line input #parameters,delays
        hedgedelay=val(ltrim(delays))
        line input #parameters,delays
        vedgedelay=val(ltrim(delays))
        line input #parameters,delays
        rotdelay=val(ltrim(delays))
    End If
 
'supress wildcards
Extern _CRT_glob Alias "_CRT_glob" As Integer
Dim Shared _CRT_glob As Integer = 0
 
'Print "exe name= "; Command( 0 )
scomopen=cp+" 57600,n,8,1,cs0,ds0,cd0,rs"
comport=freefile
Open Com sComOpen As #comport
 
If Err Then
        Print "FAILED to open Comport!!! "; cp 
'        Print "Would you like to setup (y/n)? ";
'        decision=getkey
'        print chr$(decision)
'        if decision= asc("y") or decision=asc("Y") then
'            close
'           Goto setup
'        else
'           END
'        endif
        PRINT "### IS IT ALREADY OPEN BY ANOTHER COMMAND??? #####"
        sleep 5000
        END
Else
        Print "COM port OK (";cp;")"
        Print "F_delay=";framedelay;" H_delay=";hedgedelay
        Print "V_delay=";vedgedelay;" R_delay=";rotdelay
        Print "Number of Panels=";numpans
End If

Try printing out the error code (ERR) and see if its unusual

Freebasic uses these runtime error codes:

0No error1Illegal function call2File not found3File I/O error4Out of memory5Illegal resume

Tim


Reply
rlilly
Posts: 993
(@rlilly)
Noble Member
Joined: 19 years ago

Tim, LTC states the port is already open (most of the time), then exits gracefully .

On a reboot, sometimes it opens, sometimes it doesn't. As I said, I modified the t5.bas to continually check the port until it opened successfully, then close it, wait, then start the LTC script.

With the embedded PC approach, I need it to execute without issue.

Maybe you can add something that assumes the user has the port set right, and will continually try to open it after a failure.


Reply
TimW
Posts: 554
 TimW
Topic starter
(@timw)
Honorable Member
Joined: 19 years ago

Bob,
Here's a workaround (I hope) for the embedded PC. The attached LTC_09_RL program tries (indefinitely) to open the port. If you have a monitor attached it will display a # for every failed attempt.

The reason LTC doesn't usually try indefinitely is that the port can be legitimately held open by another instance of LTC (for example different sequences triggered from the launcher plugin). In the early days it was possible to get into a bit of a mess if you tried to invoke too many simultaneous instances - so I decided to keep it simple and let each attempt try once. Timing issues are easier to identify that way.

Of course what we are doing here is masking the underlying issue - why is the port not opening? Is it a startup problem/timeout/other issue that is preventing the port from opening correctly?

Anyway this might be enought to get you over the line for now....

I would suggest that everyone else continues using LTC0_9 unless you have the same problem Bob is describing...

Tim


Reply
rlilly
Posts: 993
(@rlilly)
Noble Member
Joined: 19 years ago

Thanks, Tim. It opens every time with this version.

Can't say what the issue is for sure. As I stated, I modified the t5.bas to do what you changed in this version.

I would see the port open with t5, close it, wait a second, then launch the LTC script. LTC09 sometimes would open the port, sometimes not.

Before changing to the new version, I connected the embedded PC to the Triks power supply which seemed to make it better, but still it would miss sometimes.

Anyway, I'm good to go for this weekend! Thanks again!


Reply
TimW
Posts: 554
 TimW
Topic starter
(@timw)
Honorable Member
Joined: 19 years ago

I have updated the LTC program (atached to first post of this thread) so that the countdown will work for 2010 (and future years. Also added the option of displaying the time (on panel 1)

Tim


Reply
Page 10 / 17
Share: