INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Debugging a FoRTH program 1992 era

Debugging a FoRTH program 1992 era

(OP)
I work at a Bio tech company in Framingham Ma. We manufacture a Feline Leukemia Virus vaccine and also manufacture QS21. We currently use a TCS 6366 controller(1987 vintage) to control our pH in our 500 L fermenter. The 6366 controller has been giving us some erratic out puts. We would like to program another 6366 as a backup so we can service the failing controller. In order to program the controller we have to use a 486 PC running win 3.1 using an RS232 interface to the front of the controller.
We have not had any success programing a backup controller. The program that gets uploaded to the controller is written in programming language FOURTH. Those of us working on this problem believe that there is a problem with the FOURTH program or the parameter file that loads with it. We have loaded other programs on to the controller with success (agitation and temp control). I will be attaching the two fourth files with this post. If anyone has any suggestions on the program logic or parameter files your thoughts would be greatly appreciated.

PH PROGRAM


 
: VER
    ." CBCC5A.F1 VERSION A 02/04/92 GLE "
;
: INITTM
    CB1 1K GET
    1 SETTIM
    0 2 SETTIM
;
: INITPH
    INITTM
    0 DO1 1 SETDIG
    0 DO1 2 SETDIG
    CB1 4K GET
    SP1 SL SET
;
: PHDBHI
    CB1 2K GET
    2 /
    50 +
;
: PHDBLO
    50 CB1 2K GET
    2 /
    -
;
: ACID
    -200 100 CB1 2K GET
    -
    /
    MS1 OP GET
    *
    100 +
    1E-2 *
    CB1 3K GET
    *
    2 SETTIM
    1 DO1 1 SETDIG
;
: NEUTRAL
;
: BASE
    200 100 CB1 2K GET
    -
    /
    MS1 OP GET
    *
    100 DUP
    CB1 2K GET
    +
    100 CB1 2K GET
    -
    /
    *
    -
    1E-2 *
    CB1 3K GET
    *
    2 SETTIM
    1 DO1 2 SETDIG
;
: CTLPH
    2 GETTIM
    0<
    IF
      0 DO1 1 SETDIG
      0 DO1 2 SETDIG
    ENDIF
    1 GETTIM
    0<
    IF
      0 DO1 1 SETDIG
      0 DO1 2 SETDIG
      CB1 1K GET
      1 SETTIM
      MS1 OP GET
      CASE
        PHDBLO
        OF
          ACID
        ENDOF
        PHDBHI
        OF
          NEUTRAL
        ENDOF
        ELSOF
          BASE
        ENDOF
      ENDCASE
    ENDIF
;
: PH
    DI1 7 GETDIG
    IF
      DI1 8 GETDIG
      IF
        0 DO1 1 SETDIG
        0 DO1 2 SETDIG
      ELSE
        CTLPH
        SP1 SL GET
        CB1 4K SET
      ENDIF
    ELSE
      0 DO1 1 SETDIG
      0 DO1 2 SETDIG
    ENDIF
;
: XX
    INITTM
    INITPH
    BEGIN
      PH
    REPEAT
;
: AA
    PV1
    3T1 PID
    MS1 MSCONT
;





PARAMETER FILE

( Page 001 )

(       TCS - Turnbull Control Systems Ltd.

        TCS Instrumentation DATABASE CONFIGURATION FILE

        DataBase Configuration Function   : Store Parameter DataBase.

        Communications Standard           : RS232 via Front Panel Connector.
)


(        __________________________________________________________________
        |                                                                  |
        | Order No.              :                                         |
        |                                                                  |
        | Project Title          :                                         |
        |                                                                  |
        | Customer Name          :                                         |
        |                                                                  |
        | Customer Reference No. :                                         |
        |                                                                  |
        | End User               :                                         |
        |                                                                  |
        | End User Reference No. :                                         |
        |                                                                  |
        | Instrument Tag         :                                         |
        |                                                                  |
        | Duty                   :                                         |
        |                                                                  |
        | DataBase File Title    :                                         |
        |                                                                  |
        | Program File Ref       :                                         |
        |                                                                  |
        | Module Serial No.      :                                         |
        |                                                                  |
        | Module Code            :                                         |
        |                                                                  |
        |__________________________________________________________________|
)


(       Modification Record
         __________________________________________________________________
        | Issue | Date     |  Reasons For Modification            | Author |
        |_______|__________|______________________________________|________|
        |       |          |                                      |        |
        |       |          |                                      |        |
        |       |          |                                      |        |
        |       |          |                                      |        |
        |       |          |                                      |        |
        |       |          |                                      |        |
        |       |          |                                      |        |
        |       |          |                                      |        |
        |_______|__________|______________________________________|________|
)


( Page 002 )
(       Instrument Setup
         __________________________________________________________________
        | II : 6366 | S/W Issue : 0 | Gid :   | Uid :    | BaudRate :      |
        |___________|_______________|_________|__________|_________________|

        Note : INO = 16 * Gid + Uid .

        Switch Settings
         __________________________________________________________________
        | 1=ON 0=OFF   |  Switch Bank 1  | Switch Bank 2   | Switch Bank 3 |
        |______________|_________________|_________________|_______________|
        | switch no.   | 1 2 3 4 5 6 7 8 | 1 2 3 4 5 6 7 8 |    1 2 3 4    |
        | ON           | x x x x x x x x | x x x x x x x x |    x x x x    |
        | OFF          | x x x x x x x x | x x x x x x x x |    x x x x    |
        |______________|_________________|_________________|_______________|

         __________________________________________________________________
        |   Loop 1 : REMOTE/RATIO        |   Loop 2 : REMOTE/RATIO         |
        |________________________________|_________________________________|

         __________________________________________________________________
        |   Loop  Display Allocations    |    Loop 1      |    Loop 2      |
        |________________________________|________________|________________|
        |     Bargraph 1                 |                |                |
        |                                |                |                |
        |     Bargraph 2                 |                |                |
        |                                |                |                |
        |     Bargraph 3                 |                |                |
        |                                |                |                |
        |     Digital Display            |                |                |
        |                                |                |                |
        |________________________________|________________|________________|

)

(        __________________________________________________________________
        |                      Design Notes                                |
        |__________________________________________________________________|
        |                                                                  |
        |                                                                  |
        |                                                                  |
        |                                                                  |
        |                                                                  |
        |                                                                  |
        |                                                                  |
        |                                                                  |
        |                                                                  |
        |                                                                  |
        |                                                                  |
        |                                                                  |
        |                                                                  |
        |                                                                  |
        |__________________________________________________________________|

        DataBase Configuration As Follows :

)

(Page 003 )

(   General Purpose Block                       ) BT  GP +

(   Relative Block No 1                         ) BN  1 +
(   Block status                                ) ST 0200 >
(   Instrument identity                         ) II 3662 >
(   Loop 1 program mnemonic                     ) L1  AA +
(   Loop 2 program mnemonic                     ) L2  C3 +
(   Background program                          ) BG  XX +


(   Analogue input block                        ) BT  AI +

(   Relative block No 1                         ) BN  1 +
(   Block status                                ) ST 2041 >
(   Analogue input high range                   ) HR 1400 +
(   Analogue input low limit                    ) LR 0000 +

(   Relative block No 2                         ) BN  2 +
(   Block status                                ) ST 1041 >
(   Analogue input high range                   ) HR 5000 +
(   Analogue input low limit                    ) LR 0000 +

(   Relative block No 3                         ) BN  3 +
(   Block status                                ) ST 1000 >
(   Analogue input high range                   ) HR 1000 +
(   Analogue input low limit                    ) LR 0000 +


(   Analogue Output Block                       ) BT  AO +

(   Relative block No 1                         ) BN  1 +
(   Block status                                ) ST 0000 >
(   Analogue output high range                  ) HR 0010 +
(   Analogue output low range                   ) LR 0000 +
(   High ouput limit                            ) HL 0010 +
(   Low ouput limit                             ) LL 0000 +


(   Digital input block                         ) BT  DI +

(   Relative block No 1                         ) BN  1 +
(   Block status                                ) ST 0000 >
(   Exclusive-OR mask                           ) XM 0000 >


(   Digital output block                        ) BT  DO +

(   Relative block No 1                         ) BN  1 +
(   Block status                                ) ST 0000 >
(   Write mask                                  ) WM 0000 >
(   Digital output states                       ) DS 0000 >

(Page 004 )

(   Setpoint block                              ) BT  SP +

(   Relative block  No 1                        ) BN  1 +
(   Block status                                ) ST 2021 >
(   Setpoint high range                         ) HR 1400 +
(   Setpoint low range                          ) LR 0000 +
(   Setpoint high limit                         ) HL 1400 +
(   Setpoint low limit                          ) LL 0000 +
(   Local setpoint                              ) SL 0710 +
(   Setpoint bias                               ) SB 0000 +
(   Setpoint rate limit                         ) RL 1400 +
(   High absolute alarm limit                   ) HA 1400 +
(   Low absolute alarm limit                    ) LA 0000 +
(   High deviation alarm limit                  ) HD 0014 +
(   Low deviation alarm limit                   ) LD 0014 +

(   Relative block  No 2                        ) BN  2 +
(   Block status                                ) ST 1021 >
(   Setpoint high range                         ) HR 5000 +
(   Setpoint low range                          ) LR 0000 +
(   Setpoint high limit                         ) HL 5000 +
(   Setpoint low limit                          ) LL 0000 +
(   Local setpoint                              ) SL 0321 +
(   Setpoint bias                               ) SB 0000 +
(   Setpoint rate limit                         ) RL 5000 +
(   High absolute alarm limit                   ) HA 5000 +
(   Low absolute alarm limit                    ) LA 0000 +
(   High deviation alarm limit                  ) HD 0250 +
(   Low deviation alarm limit                   ) LD 0250 +


(   Ratio block                                 ) BT  RB +

(   Relative block No 1                         ) BN  1 +
(   Block status                                ) ST 1000 >
(   Ratio setting high limit                    ) HR 1000 +
(   Ratio setting low limit                     ) LR 0000 +
(   Ratio setting                               ) RS 0000 +
(   Ratio trim                                  ) RT 0000 +
(   Ratio bias                                  ) RB 0000 +

(   Relative block No 2                         ) BN  2 +
(   Block status                                ) ST 1000 >
(   Ratio setting high limit                    ) HR 1000 +
(   Ratio setting low limit                     ) LR 0000 +
(   Ratio setting                               ) RS 0000 +
(   Ratio trim                                  ) RT 0000 +
(   Ratio bias                                  ) RB 0000 +

(Page 005 )

(   PID control block                           ) BT  3T +

(   Relative block No 1                         ) BN  1 +
(   Block status                                ) ST 0010 >
(   Proportional band constant                  ) XP 0100 +
(   Integral time constant                      ) TI 0000 +
(   Derivative time constant                    ) TD 0000 +
(   Feed-forward term                           ) FF 5000 +

(   Relative block No 2                         ) BN  2 +
(   Block status                                ) ST 0050 >
(   Proportional band constant                  ) XP 0100 +
(   Integral time constant                      ) TI 0000 +
(   Derivative time constant                    ) TD 0000 +
(   Feed-forward term                           ) FF 5000 +


(   Manual output station block                 ) BT  MS +

(   Relative block No 1                         ) BN  1 +
(   Block status                                ) ST 0000 >
(   High velocity / Rate limit                  ) HV 9999 +
(   Low velocity /  Rate limit                  ) LV 9999 +
(   High output limit                           ) HL 9999 +
(   Low output limit                            ) LL 0000 +
(   Output tracking value                       ) OT 1000 +

(   Relative block No 2                         ) BN  2 +
(   Block status                                ) ST 0000 >
(   High velocity / Rate limit                  ) HV 9999 +
(   Low velocity /  Rate limit                  ) LV 9999 +
(   High output limit                           ) HL 9999 +
(   Low output limit                            ) LL 0000 +
(   Output tracking value                       ) OT 1000 +


(   Display and control block                   ) BT  DC +

(   Relative block No 1                         ) BN  1 +
(   Block status                                ) ST 1073 >
(   Bargraph 1 data source                      ) 1B 5150 >
(   Bargraph 2 data source                      ) 2B 5160 >
(   Bargraph 3 data source                      ) 3B 8160 >
(   Digital display data                        ) DD 5150 >
(   Enable status word                          ) ES 0080 >
(   Front panel switch mask                     ) SM 0004 >

(   Relative block No 2                         ) BN  2 +
(   Block status                                ) ST 1073 >
(   Bargraph 1 data source                      ) 1B 1240 >
(   Bargraph 2 data source                      ) 2B 1241 >
(   Bargraph 3 data source                      ) 3B 8260 >
(   Digital display data                        ) DD 1240 >
(   Enable status word                          ) ES 0080 >
(   Front panel switch mask                     ) SM 0004 >

(Page 006 )

(   Alarm block                                 ) BT  AB +

(   Relative block No 1                         ) BN  1 +
(   Block status                                ) ST 00F1 >
(   High value alarm limit                      ) HV 1000 +
(   Low value alarm limit                       ) LV 0000 +
(   High alarm limit                            ) HL 1000 +
(   Low alarm limit                             ) LL 0000 +
(   Alarm hysteresis                            ) AH 0010 +

(   Relative block No 2                         ) BN  2 +
(   Block status                                ) ST 1011 >
(   High value alarm limit                      ) HV 2000 +
(   Low value alarm limit                       ) LV 0000 +
(   High alarm limit                            ) HL 2000 +
(   Low alarm limit                             ) LL 0000 +
(   Alarm hysteresis                            ) AH 0100 +


(   Constants block                             ) BT  CB +

(   Relative block No 1                         ) BN  1 +
(   Block status                                ) ST 1111 >
(   Constant 1                                  ) 1K 0300 +
(   Constant 2                                  ) 2K 0010 +
(   Constant 3                                  ) 3K 0050 +
(   Constant 4                                  ) 4K 0071 +
(   User status word                            ) US 0000 >

(   Relative block No 2                         ) BN  2 +
(   Block status                                ) ST 1111 >
(   Constant 1                                  ) 1K 0150 +
(   Constant 2                                  ) 2K 0000 +
(   Constant 3                                  ) 3K 0300 +
(   Constant 4                                  ) 4K 0370 +
(   User status word                            ) US 0000 >


(   Filter lead/lag block                       ) BT  FB +

(   Relative block No 1                         ) BN  1 +
(   Block status                                ) ST 0140 >
(   Filter gain                                 ) XK 0000 +
(   Lead time constant                          ) 1T 9999 +
(   Lag time constant                           ) 2T 0000 +
(   Feed-forward/output bias                    ) FF 0000 +

(   Relative block No 2                         ) BN  2 +
(   Block status                                ) ST 0140 >
(   Filter gain                                 ) XK 0000 +
(   Lead time constant                          ) 1T 0100 +
(   Lag time constant                           ) 2T 0000 +
(   Feed-forward/output bias                    ) FF 0000 +

(Page 007 )

(   Delay block                                 ) BT  DB +

(   Relative block No 1                         ) BN  1 +
(   Block status                                ) ST 0040 >
(   Maximum delay time                          ) DT 0000 +

(   Relative block No 2                         ) BN  2 +
(   Block status                                ) ST 0040 >
(   Maximum delay time                          ) DT 0000 +


(   Totalisation block                          ) BT  TB +

(   Relative block No 1                         ) BN  1 +
(   Block status                                ) ST 0040 >
(   Flow scaling factor                         ) FS 0000 +
(   Flow total                                  ) FT 0000 +

(   Relative block No 2                         ) BN  2 +
(   Block status                                ) ST 0040 >
(   Flow scaling factor                         ) FS 0000 +
(   Flow total                                  ) FT 0000 +


( End of file )



THANKS FOR ANY INPUT I KNEW THIS WAS THE RIGHT PLACE TO COME.

RE: Debugging a FoRTH program 1992 era

When FORTH was invented, filenames on many systems could not exceed five characters; hence there is no 'U' in the language's name.

The 'rectangle' character after the last semicolon in the PH program might be confusing the system and preventing a proper load.  It's the sort of crap you see when a true ASCII text file is manipulated on a Windows system.  It may be preventing the program loader from detecting the end of file.. or not.  Dump the program with something like Vern Buerg's LIST, and see what's really there, and if it's supposed to be there for the target system.

E.g. see where it says '( END OF FILE )' in the parameter file?  There might need to be a similar tag at the end of the program file.  Actually, that may be just a comment in parentheses; I'm used to dialects that use [END_OF_FILE] , with no spaces, as a terminating tag, and will read, but not act on, anything after that in the file.  There are other ways to do the same thing.  "When you've seen one FORTH, you've seen ... one FORTH." ... is true.

The program is fairly well factored and the verbs have apparently descriptive names, so it reads like a pidgin English, once you get used to RPN.  The program itself does not appear to have been mangled, at least according to a cursory inspection.

It may be helpful to find the 'dictionary' for that system... because there are a few 'standard' FORTHs, but applications are developed by extending the language... and that program has a lot of stuff that you won't find in a vanilla FORTH.  Probably a big ROM buried in there somewhere.  But there should be a printed manual somewhere that describes, in a fairly standard way, what each verb expects on the stack when it executes, and what it leaves on the stack when it terminates.

I.e., without a book specific to that system, things get interesting...

 

RE: Debugging a FoRTH program 1992 era

I copied both files out of the message and dumped them.
Both end with the sequence:

1A       sub
0D 0A    cr lf

I'm not sure why the 'sub' character is there.
You might try cutting it out of the files you're trying to upload, or substitute a space, hex 20, which any FORTH will ignore.
...
Or maybe that particular FORTH uses 'sub' as an end of file tag, in which case it _should_ be there; I don't know.



 

RE: Debugging a FoRTH program 1992 era

I'm betting (s)he found the problem, and it wasn't in the FORTH.

 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close